scrms

1.0.1 • Public • Published

SCRMS: Easy-to-Use

SCRMS is a lightweight JavaScript library for implementing a scramble text animation in your web applications. With SCRMS, you can easily integrate this animation into your projects.

Installation

You can install SCRMS via npm:

npm install scrms 

to import SCRMS:

import Scramble from "scrms";

USAGE:

basic example on a single HTML element:

const animation = new Scramble("#cssSelector");

you can also use a variable instead of a CSS selector

usage with settings:

const animation = new Scramble(ele, {
  duration: 1,
  onAnimating: () => {
    seekSlider.value = parseFloat(animation.progress).toFixed(2) * 100;
  },

  onAnimationEnd: () => {
    seekSlider.value = 0;
  },
});

object methods avaiable to use:

obj.play()

obj.pause()

obj.stop()

obj.restart()

settings avaiable to change:

keep calling a function as long as the animation is happening: onAnimating: () => {}

call a function as soon as the animation ends: onAnimationEnd: () => {}}

the duration of how long should the animation take to finish: duration: number

a delay to add before the animation fires: delay: number

if you want the animation to start from somewhere in the middle: progress: number from 0 to 1

Package Sidebar

Install

npm i scrms

Weekly Downloads

3

Version

1.0.1

License

MIT

Unpacked Size

7.96 kB

Total Files

4

Last publish

Collaborators

  • sibai