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

jquery.type-char-animation

v2.0.1

Published

Emulates a user typing some text

Downloads

3

Readme

jQuery Type Char Animation

Emulates a user typing some text

Works with regular DOMElements as well as Forms Elements.

Demo

See this file.

Installation

npm i jquery.type-char-animation --save-dev

Usage

See below for the complete documentation

// start the animation
$('#my-div').typeCharAnimation({
    initialText: null, // string
    initialDelay: 0,
    text: null, // string
    step: null, // function (char, pos)
    complete: null, // function ()
    blockUserInput: false,
    focus: true,
    reverse: false,
    matrixEffect: 0,
    passes: 1,
    matrixValues: 'abcdefghijklmnopqrstuvwxyz'.split(''),
    charTime: getCharTime, // function (char, pos)
    spaceTime: getSpaceTime, // function (char, pos)
    isWhiteSpace: isWhiteSpace // function (char, pos)
});
// stop the animation
$('#my-div').typeCharAnimation('stop');
// stop and go to end
$('#my-div').typeCharAnimation('stop', {end: true});
// access (or change) the global defaults
$.typeCharAnimation.defaults;

Options

These are the possible config values. The format is optionName: defaultValue.

text: null

Any string

The text to animate. This option is required.

initialText: null

Any string

The initial text to prepend to the text. Will not be animated.

initialDelay: 0

Any positive integer

The initial delay (in ms) before the animation starts

step: null

function (char, pos) {}

A callback function called at each step (or frame) of the animation.

complete: null

function () {}

A callback function called once, at the end of the animation.

blockUserInput: false

true | false

Flag indicating if the plugin should prevent user input in this element while animating. Mostly usefull for editable elements.

focus: true

true | false

Flag indicating if the plugin should focus the element after changing its value.

reverse: false

true | false

Flag indicating if the animation should run in reverse (characters are removed instead of added).

matrixEffect: 0

Any positive integer

Changes the matrixEffect last characters to random ones, for one pass.

passes: 1

Any positive integer

Number of steps (or frames) to wait between animations. Usefull with matrixEffect.

matrixValues: 'abcdefghijklmnopqrstuvwxyz'.split('')

Array

Possible random values to use when matrixEffect > 0.

charTime

function (char, pos) {}

A function that must return the duration in milisecond of a given frame, when the character is not a white space.

spaceTime

function (char, pos) {}

A function that must return the duration in milisecond of a given frame, when the character is a white space.

isWhiteSpace

function (char, pos) {}

A function that must return true if the given char should be considered as a white space character.

Credits

Made with love in Montréal by https://deuxhuithuit.com/

Licensed under the MIT License: http://deuxhuithuit.mit-license.org/