Looking forward to your feedback
A simple typewriter for browser,Typing effects can be achieved using chained methods
- support custom typing effect
- support custom cursor
- support move cursor
- support add any document node
- ...
- use Web Animations API Api to achieve typing effect
- Support custom typing speed
- Support chained methods
npm install untyper
import { UnTyper } from 'untyper'
const text = document.querySelector('#text')
const unTyper = new UnTyper(text, { speed: 100, startDelay: 1000 })
unTyper.type('hi', { delay: 200 }).go()
Warning: only support string input
- text
string
- opts:
object
{ delay?:number
, startDelay:number
, animationspancontent:string
, animate: { cancel:boolean
, },}
output
this
input
- ms
number
output
this
input
- charAt:
number
> 0 - opts:
object
-> delay?:number
output
this
input
- movementArg:
number | null
- opts?:
object
-> {to?:string
, delay?:number
}
output
this
input
- text
string | HTMLElement
- opts:
object
-> delay?:number
output
this
output
Promise