npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

Theater

v1.0.0

Published

theatre.js ====

Downloads

2

Readme

theatre.js

Demo: http://codepen.io/markhuot/full/ueCpc/

A CSS-only method to hide / show elements on click. The onus is on the developer to set initial states and transition states. This allows you to conditionally show elements on small screens and toggle them on larger screens. To get up and running you simply need to tag your trigger and your target with data attributes. E.g.,

<a href="#" data-theatre-trigger="nav">Navigation</a>
<nav data-theatre-target="nav">...</nav>

The above will cause clicks on the anchor tag to toggle a data-theatre-active attribute on the navigation element.

Trigger and target keys are somewhat unique, but not required to be unique. That means you can target multiple elements the same way you would a single element,

<a href="#" data-theatre-trigger="nav" data-theatre-active-class="active">Navigation</a>
<nav data-theatre-target="nav" data-theatre-active-class="shown">...</nav>
<p>Page intro...</p>
<nav class="utility" data-theatre-target="nav" data-theatre-active-class="utility--shown">...</nav>

You can apply trigger-s to anchor tags, select boxes, and option elements. When applied to a select element the field must evaluate to true to show the target. E.g.,

<select data-theatre-trigger="city">
  <option></option>
  <option>Philadelphia</option>
  <option>New York</option>
  <option>Atlanta</option>
</select>
<p data-theatre-target="city">Thank you for choosing a city.</p>

For more control over a select box you can apply the trigger to the individual option elements. In this case, all option/triggers in the select box that are not selected will have their targets hidden. The selected option will have its target shown.

<select>
  <option></option>
  <option data-theatre-trigger="city-philadelphia">Philadelphia</option>
  <option data-theatre-trigger="city-new-york">New York</option>
  <option data-theatre-trigger="city-atlanta">Atlanta</option>
</select>
<p data-theatre-target="city-philadelphia">Philly was chosen.</p>
<p data-theatre-target="city-new-york">NYC was chosen.</p>
<p data-theatre-target="city-atlanta">Atlanta was chosen.</p>

Targets can request multiple triggers, in which case the target will not be shown until all the triggers are active.

<a href="#" data-theatre-trigger="tag1" class="tag">Tag 1</a>
<a href="#" data-theatre-trigger="tag2" class="tag">Tag 2</a>
<p data-theatre-target="tag1 tag2">All tags selected.</p>