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

letters.js

v0.0.8

Published

Package to animate each letters of a word

Downloads

6

Readme

Letters.js

This is a library to animate words. It's inspired by Codedoodles.

Installation

You can pick the library from this repo (lib/letters.min.js or lib/letters.js) or install it with:

npm install letters.js

Then var Letters = require('letters.js');

Usage

new Letters( words [, options ]);

Examples

Array of words

let letters = new Letters(["Array", "Of", "Words"]);

Array of arrays

Use an array of words to change the word after the previous word's animation is done.

let words = [
  ["FirstWord", "SecondWord"],
  ["FirstWord", "SecondWord"]
];
let letters = new Letters(words);

Mix

You can mix single words with arrays of words. No matter the order.

let words = [
  "Single",
  ["FirstWord", "SecondWord"],
  ["FirstWord", "SecondWord"]
];
let letters = new Letters(words);

Options

container:
  • Type: String or DOMElement (default is document.body)
  • Usage: This is the container where the words will be inserted in
  • Warning: if you pass a String, make sure this is the element's id
duration:
  • Type: int (default is 2)
  • Usage: This is the period during which the letters will be animated
  • Warning: this is the number of seconds
paused:
  • Type: int (default is 10)
  • Usage: This is the time during which your words will be displayed in their original state
  • Warning: this is the number of seconds
alphabet:
  • Type: String or Array (default is abcdefghijklmnopqrstuvwxyz0123456789&é~\"#'{}[]()-|è``_\\ç^à@=+°$£€¤µ*%ù§!/:.;?,><)
  • Usage: Pass the alphabet you want
once:
  • Type: boolean (default is false)
  • Usage: If true, the letters animation will ocurred just once
mode:
  • Type: String (default is alphabet)
  • Usage:
    • shuffle: each letter will be replaced by another letter from the same word
    • alphabet: each letter will be replaced by a random letter