Typewriter
A better typewritter effect. Texts and elements appear one by one.
Install
- In-browser installization
- Install with yarn or npm
npm install twjs
Then,
;
or
var Typewriter = ;
Usage
- Initiation
const config = interval: 30 // * Time interval for the animation, 30 // milliseconds by default skip: '.MathJax' // * Specify a selector to skip. We let // the formulas shows entirely { // * For advanced usage of the library; return true; // return false to skip default process of } // current operation;const targetElement = document;let tw = targetElement config;
config
is optional.
- Start the animation
twstart;
- Pause the animation
tw;
- Resume the animation
tw; // Currently it is just an alias of `tw.start`
- Reset the animation
tw = tw;
Example usage can be found here.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Feel free to pull requests. The bug fixes are left as exercises for the users.
Acknowledgments
As a request from @haoyun.