UNPKG

scrawl-canvas

Version:
81 lines (65 loc) 2.97 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 006</title> <!-- Google Analytics tracking code, to test GA functionality with Scrawl-canvas --> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics_debug.js','ga'); ga('create', 'UA-000000-0', 'auto'); if (location.hostname == 'localhost') ga('set', 'sendHitTask', null); ga('send', 'pageview'); </script> <!-- End Google Analytics --> <link href="css/normalize.css" rel="stylesheet" /> <link href="css/tests.css" rel="stylesheet" /> <style> #mystack { width: 500px; height: 500px; margin: 0 auto; touch-action: none; } </style> </head> <body> <h1><a href="index.html">Scrawl-canvas v8</a> - DOM test 006</h1> <h2>Tween actions on a DOM element; tracking tween and ticker activity</h2> <h3>Click on the animation to make the boat reverse direction</h3> <div id="mystack" data-scrawl-stack> <div id="myelement"></div> </div> <p id="reportmessage"></p> <div class="testinfo"> <h4>Test purpose</h4> <ul> <li>Clone a stack element and add it to the stack</li> <li>Clone a tween, letting the tween subscribe to the original tween's ticker</li> <li>Clone a tween, making it create its own associated ticker</li> <li>Manipulate a tween while it is running, forcing it to stop, reverse and resume its animation</li> <li>Add action objects to the tween's ticker</li> <li>Check that action objects behave correctly, dependent on the current animation direction of the tween:</li> <ul> <li>The largest boat will change colours as it circles</li> <li>The middle boat will follow the largest boat, but will not change colour</li> <li>The smallest boat will circle slightly faster than the other two boats</li> <li>On reversing, the smallest boat will halt while the other two boats reverse direction</li> </ul> </ul> <p>We can also test tracking tween/ticker activity (in this case, using Google Analytics):</p> <ul> <li>Setup Google Analytics</li> <li>Check that appropriate GA hit reports get generated when tweens start, halt, resume and reverse</li> <li>Check that appropriate GA hit reports get generated at specific points in the ticker timeline's progress (50%, 100%)</li> </ul> <p><b>Touch test:</b> should work as expected</p> <p><a href="../docs/demo/dom-006.html">Annotated code</a></p> </div> <script src="dom-006.js" type="module"></script> </body> </html>