Package Exports
- txt-shuffle
- txt-shuffle/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (txt-shuffle) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
txt-shuffle
Customisable text shuffling animations.
Install
npm install txt-shuffle
Example
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 world
Demo
API
shuffle(options)
Starts a text shuffle animation in two tiers. First shuffling through random characters and then resolving into the target text.
options
text
(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
,stay
direction
(defaultright
) possible values:left
,right
,random
onUpdate
callback function, returns the output stringonComplete
callback function, returns the output string
glyphs
default
!#$&%()*+0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuüvwxyz{|}~
License
MIT, see LICENSE for details.