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

nyan-cat-festival

v1.0.3

Published

~=[,,_,,]:3 Turn your website into a custom nyan cat festival.

Downloads

40

Readme

nyan-cat-festival

Turn your website into a custom nyan cat festival.

Demo: http://isaaclyman.com/nyan-cat-festival/docs

~=[,,_,,]:3

Ɛ:[,,_,,]=~

~=[,,_,,]:3

Installation

npm install --save nyan-cat-festival

API

First, import the library:

import Nyan from 'nyan-cat-festival'

Then set the options for your festival:

// Simple festival for simple cats
const festival = new Nyan({
  cues: [{
    start: 'left',
    end: 'right'
  }]
})

// Advanced festival for hacker cats
const festival = new Nyan({
  song: 'http://www.hochmuth.com/mp3/Haydn_Cello_Concerto_D-1.mp3',
  transitionDuration: 5 * 1000,
  transitionTiming: 'cubic-bezier(0.0, 0.0, 0.85, 1.0)',
  zIndex: 100,
  cues: [{
    delay: 0,
    start: 'left',
    zIndex: 5
  }, {
    delay: 1500,
    start: 'left-top',
    zIndex: 5
  }, {
    delay: 3000,
    start: 'left-bottom',
    end: 'right-top',
    transitionDuration: 10 * 1000,
    transitionTiming: 'ease-in',
    zIndex: 10
  }]
})

And finally, get your nyan on:

festival.nyan()

Options

song: (optional) The URL of the song to play in the background, or an HTMLAudioElement object that is ready to play. If this is null, no song will be played. By default, this is the theme song for the show Mock Trial with J. Reinhold.

transitionDuration: (optional) The default duration in milliseconds of each cat's transition from its start position to its end position. By default, this is 5000.

transitionTiming: (optional) The default timing function to use for the transition of the cats from their start position to their end position. By default, this is a cubic bezier function that makes the cats fly in very quickly, then fly at a slower speed across the screen.

zIndex: (optional) The z-index of the stacking context where all the cats will be appended. The stacking context is a <div> attached to your <body> element. By default, this is 100.

Cues

The cues option is an array of objects, each of which represents a single nyan cat. The options for a cue are:

delay: (optional) The number of milliseconds after the nyan() function is called before the cat should appear. The default is 0.

start: (optional) The position where the cat should begin (off-screen). The 12 possible values, starting at the bottom of the left side and going clockwise, are 'left-bottom', 'left', 'left-top', 'top-left', 'top', 'top-right', 'right-top', 'right', 'right-bottom', 'bottom-right', 'bottom', 'bottom-left'. By default, this is 'left'.

end: (optional) The position where the cat should end (off-screen). This accepts the same values as the start option. By default, this is 'right'.

transitionDuration: (optional) An override duration to use for this cat's transition.

transitionTiming: (optional) An override timing function to use for this specific cat.

zIndex: (optional) The z-index of this specific cat. Keep in mind that z-index can only be used to position cats relative to each other, not to your app, since they exist in a different stacking context. By default, this is 1.

Troubleshooting

If you try to nyan right when the page loads, the audio won't work on modern browsers due to autoplay policies. You'll have to nyan in response to a user event (like a click).

License

MIT Licensed.