UNPKG

scene

Version:

Scene is a simple but powerful property interpolation class for creating (CSS) animation and parallax effects.

47 lines (45 loc) 1.03 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Scene demo</title> <style> body { height: 10000px; font-family: Roboto; } #demos { /*position: fixed;*/ } #demos > div { /*position: absolute;*/ /*height: 400px;*/ display: inline-block; overflow: hidden; background: beige; } pre { display: inline-block; } canvas { border: 1px solid lightgray; } canvas.red { border: 1px solid red; } canvas.blue { border: 1px solid blue; } #myElem { position: absolute; display: inline-block; } </style> <script src="./demo.js" type="module"></script> </head> <body> <h2>Scroll down for 'Parallax' animating</h2> <div id="demos"> </div> </body> </html>