UNPKG

animation-chain

Version:

Animation Chain is a chaining library which utilizes the browser's `requestAnimationFrame` function in place of the usual `setTimeout`. This results in a much more accurate representation of time passed based on a delta time calculation. This can be usefu

20 lines (17 loc) 668 B
<!doctype HTML> <html> <head> <title>setTimeout Replacement</title> </head> <body> <h1>Replace your calls to setTimeout</h1> <div>Pro-tip: open your console?</div> <div>First timeout length: <input class='num1' type="number" min="250" max="4000" step="250" value="500" /></div> <div>Value to log: <input class='val1' type="text" value="test1"/></div> <hr /> <div>Second timeout length: <input class='num2' type="number" min="250" max="4000" step="250" value="500" /></div> <div>Value to log: <input class='val2' type="text" value="test2" /></div> <button>Log it!</button> <script src="/__build__/set-timeout-replace.js"></script> </body> </html>