UNPKG

scrawl-canvas

Version:
58 lines (46 loc) 2 kB
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Demo DOM 008</title> <link href="css/normalize.css" rel="stylesheet" /> <link href="css/tests.css" rel="stylesheet" /> <style> #mystack { margin: 0 auto; border: 1px solid black; width: 600px; height: 600px; touch-action: none; } </style> </head> <body> <h1><a href="index.html">Scrawl-canvas v8</a> - DOM test 008</h1> <h2>3d animated cube</h2> <div id="mystack" data-scrawl-stack> <div id="pin"></div> <canvas id="frontface" data-scrawl-canvas></canvas> <canvas id="rightface" data-scrawl-canvas></canvas> <canvas id="topface" data-scrawl-canvas></canvas> <canvas id="backface" data-scrawl-canvas></canvas> <canvas id="bottomface" data-scrawl-canvas></canvas> <canvas id="leftface" data-scrawl-canvas></canvas> </div> <p id="reportmessage"></p> <div class="testinfo"> <h4>Test purpose</h4> <ul> <li>Pivot stack elements to another element, and add translate values to each to form a cube</li> <li>Animate the cube by animating just the one element to which the others are pivoted</li> <li>(Cube animations up to scrawl v7 relied on direct manipulation of quaternions in user code; this should all be hidden in v8, leaving the user able to animate the cube entirely via rotation attributes - pitch, yaw, roll)</li> </ul> <p><b>Note:</b> transform-style: preserve-3d or backface-visibility: hidden issue? Safari displays differently from other browsers. See <a href="https://css-tricks.com/things-watch-working-css-3d/">Things to Watch Out for When Working with CSS 3D</a>.</p> <p><b>Touch test:</b> should work as expected</p> <p><a href="../docs/demo/dom-008.html">Annotated code</a></p> </div> <script src="dom-008.js" type="module"></script> </body> </html>