1. Start with a simple target element
<div id="editor"><div>
2. Initate code animator
new PrismAnimator( {
element: document.getElementById( 'editor' ),
language: 'javascript',
code: 'var example = "Hello world";',
charactersPerMinute: 600
} );
3. Output 🎉
By grabbing the contents of the script#example-2-code
tag we can animate exact code that initiates the animation.
The PrismAnimator class comes with methods to play, pause and reset the animation.