Skip to content
This repository has been archived by the owner on Mar 14, 2021. It is now read-only.
/ typebot Public archive

Javascript library for typing animation

License

Notifications You must be signed in to change notification settings

akzhy/typebot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

typebot

Javascript library for typing animation

Usage:

include

<script src="typebot.js"></script>

And in js

new typebot(element,speed,delay,text,blinker,paused)

The argument element is the element to be selected eg: "#myElement",".myElement" speed is the typing speed and delay is the delay between the typing of each letter text must be an array containing the text to be typed. Each element in the array acts as a new line. blinker(boolean) set to true shows the blinker and set to false hides the blinker. paused(boolean) set to true will pause the typing and will not start typing until .start() is called.

Methods:

.done(function) executes after all the texts are typed with the function given in the argument

.onLayerEnd(function) executes at the end of a line

.onLayerStart(function) executes at the beginning of a line

.whileTyping(function) executes as each letter is typed

.onstart executes at the beginning of each line

.pause() pauses the typing and .start() continues it

.destroy() terminates typing

Demo on Codepen