Socket
Socket
Sign inDemoInstall

slimfady

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    slimfady

Create a random like animation of text characters


Version published
Weekly downloads
2
Maintainers
1
Install size
324 kB
Created
Weekly downloads
 

Readme

Source

Build Status Coverage Status npm version GitHub version

SlimFady

Randomly delay revealing of each character in a text (uses CSS3 animation).

  • Doesn't remove HTML tags of animated text
  • No extra dependencies

Demo (codepen.io)

SlimFady

Getting started

npm install slimfady --save

JS

import SlimFady from 'slimfady';

const options = {
    container: '#foo'
    delay: 50
};

const sf = new SlimFady(options);

CSS

// CSS
<link rel="stylesheet" href="node_modules/slimfady/dist/style.css">

// or import the stylesheet in a CSS pre-processor
@import 'node_modules/slimfady/dist/style.css';

DOM

<!DOCTYPE html>
<html>
  <head>  
  </head>
  <body>
    <div id="test" class="sf-container">hello</div>
  </body>
</html>

API

Options

{
    container: '#foo'
    delay: 50
}

options.container, string, required

CSS selector of a single DOM node.

options.delay, number, optional, default = 20

Defines time range between starting animation of each character, smaller value => faster animation.

Methods

sf.startAnimation()

sf.stopAnimation()

Stops and also pauses animation if it's still in progress. If you would like to remove animation and reveal the whole text immediately, use clearAnimation().

sf.isAnimating()

sf.clearAnimation()

Removes animation and reveals the whole text. It doesn't remove newly created <span> elements. After calling clearAnimation(), you can easily start animation from the beginning by using startAnimation().

License

MIT

Keywords

FAQs

Last updated on 17 Aug 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc