Typed
Welcome to Typed.js!
Constructor Summary
Public Constructor | ||
public |
|
Member Summary
Public Members | ||
public |
|
|
public |
|
|
public |
cursor: * |
|
public |
|
|
public |
sequence: * |
|
public |
stopNum: * |
|
public |
|
|
public |
|
|
public |
timeout: * |
|
public |
|
Method Summary
Public Methods | ||
public |
destroy() Destroy this instance of Typed |
|
public |
Reset Typed and optionally restarts |
|
public |
start() Start typing / backspacing after being stopped |
|
public |
stop() Stop typing / backspacing and enable cursor blinking |
|
public |
toggle() Toggle start() and stop() of the Typed instance |
Private Methods | ||
private |
Backspaces 1 character at a time |
|
private |
begin() Begins the typing animation |
|
private |
If using input elements, bind focus in order to start and stop the animation |
|
private |
complete() Full animation is complete |
|
private |
doneTyping(curString: string, curStrPos: number) We're done typing the current string |
|
private |
Speed in MS to type |
|
private |
initFadeOut(): * Adds a CSS class to fade out current string |
|
private |
On init, insert the cursor element |
|
private |
keepTyping(curString: string, curStrPos: number) Continue to the next string & begin typing |
|
private |
replaceText(str: string) Replaces current text in the HTML element depending on element type |
|
private |
setPauseStatus(curString: string, curStrPos: number, isTyping: boolean) Has the typing been stopped |
|
private |
Shuffle the sequence of the strings array |
|
private |
toggleBlinking(isBlinking: boolean) Toggle the blinking cursor |
|
private |
Called for each character typed |
Public Constructors
public constructor() source
Public Members
public cursor: * source
public cursorBlinking: * source
public sequence: * source
public stopNum: * source
public timeout: * source
Public Methods
public reset(restart: boolean) source
Reset Typed and optionally restarts
Params:
Name | Type | Attribute | Description |
restart | boolean |
Private Methods
private backspace(curString: string, curStrPos: number): * source
Backspaces 1 character at a time
Return:
* |
private bindFocusEvents() source
If using input elements, bind focus in order to start and stop the animation
private doneTyping(curString: string, curStrPos: number) source
We're done typing the current string
private humanizer(speed: number): * source
Speed in MS to type
Params:
Name | Type | Attribute | Description |
speed | number |
Return:
* |
private keepTyping(curString: string, curStrPos: number) source
Continue to the next string & begin typing
private replaceText(str: string) source
Replaces current text in the HTML element depending on element type
Params:
Name | Type | Attribute | Description |
str | string |
private setPauseStatus(curString: string, curStrPos: number, isTyping: boolean) source
Has the typing been stopped