txt-shuffle
v1.0.3
Published
Customisable text shuffling animations.
Maintainers
Readme
txt-shuffle
Customisable text shuffling animations.
Install
npm install txt-shuffleExample
const { shuffle } = require('txt-shuffle');
shuffle({ text: 'Hello world', fps: 5, onUpdate: (output) => {
console.log(output);
} });Output:
kE}3 7
Hep|> |dJ
Hello UAo_
Hello worlz
Hello worldDemo
API
shuffle(options)
Starts a text shuffle animation in two tiers. First shuffling through random characters and then resolving into the target text.
optionstext(default'') text stringduration(default1) duration of shuffle/resolve animation in secondsdelay(default0) delay to start shufflingdelayResolve(default0.2) delay to start resolvingfps(default60) framerateglyphs(see below) glyphs to use in the shuffle animationanimation(defaultshow) possible values:show,hide,staydirection(defaultright) possible values:left,right,randomonUpdatecallback function, returns the output stringonCompletecallback function, returns the output string
glyphs default
!#$&%()*+0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuüvwxyz{|}~License
MIT, see LICENSE for details.

