Skip to content
/ scrms Public

A library to manipulate the DOM and scramble text with seek, play, pause, restart and other settings..

License

Notifications You must be signed in to change notification settings

sibaiper/scrms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SCRMS: Easy-to-Use text scramble animation

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

About

A library to manipulate the DOM and scramble text with seek, play, pause, restart and other settings..

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published