TypeLighter.js - Just 1.04KB gzip - 12x lighter
The world's lightest yet most powerful JS TypeWriter out there.
For more information, please, check typelighterjs.com.
Description :
TypeLighter.js is a free plugin to add typewriters in your web page. With this plugin, eight properties allow you to fine-tune the experience you want to share with your users. Most of them are predefined, but you can change their values using the data attribute.
Files :
There are three files in the compressed folder :
- README.md
- typelighter.js
- typelighter.min.js -> minified file
Installation :
Place the .js file
in your folder and import it after the body tag
You can also use the CDN version :
Add a new typewriter with a span
tag.
Properties list :
Property | Default value | Use |
---|---|---|
data-text | Null | The array holding the strings to be written one after the other. |
data-speed | 1 | The writing speed is proportionnal to this integer. |
data-start | 500 (ms) | A delay before writing the next string. |
data-end | 2000 (ms) | A delay before deleting the current string. |
data-random | True | When enabled, the TypeWriter waits for a random time before writing or deleting the next character. |
data-max | Infinity | The maximum number of full iterations before the TypeWriter stops itself. |
data-dltSpeed | True | When enabled, a given string is deleted twice as fast as it is written. |
data-checkVisible | False | When enabled, the animation begins right when the element appears in the viewport. |
Example :
Hello
CSS :
The CSS is automatically injected in the DOM for convenience, though you could also paste it in your CSS file :
@ 50% 100%}
Enjoy 😍
This project is licensed under the terms of the MIT license.