UNPKG

scrawl-canvas

Version:
89 lines (71 loc) 4.21 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 Canvas 009</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" /> </head> <body> <h1><a href="index.html">Scrawl-canvas v8</a> - Canvas test 009</h1> <h2>Pattern styles; Entity web link anchors; Dynamic accessibility</h2> <h3>Move cursor over canvas, or use keyboard tab,<br />to see dynamic hover and accessibility functionality<br />Click (or press keyboard enter) on a highlighted entity<br />to open a new web page</h3> <canvas id="mycanvas" width="600" height="400" data-scrawl-canvas ></canvas> <p id="reportmessage"></p> <div class="testinfo"> <h4>Test purpose</h4> <ul> <li>Create/clone various Pattern styles, using DOM images, and loading images</li> <li>Create/clone Block entitys to use the Patterns</li> <li>Create a new cell and add it to the canvas</li> <li>Animate a pattern-filled block in the new cell</li> <li>Use the new cell as the source for a Pattern style</li> </ul> <p>Additionally, using this demo to check zoned canvas User Interactions</p> <ul> <li>Define onEnter and onLeave functions on the first defined block, to change its linewidth attribute when the mouse cursor hovers over it</li> <li>Define anchor objects for each entity, and functionality to action mouse clicks on them</li> <li>Check that the 'on...' functions, and the anchor, successfully clone-and-adapt to the other block entitys</li> <li>Check that the functionality works by moving the cursor over and away from the blocks</li> <li>Check that clicking on an entity results in an appropriate Wikipedia page opening in a new browser tab</li> <li>Check that the functionality works using keyboard tabbing and enter (for accessibility)</li> <li>Check that the canvas's title (used in its tool prompt) adapts appropriately as user moves between Blocks</li> </ul> <p>Tracking User Interactions</p> <ul> <li>Add Google Analytics (analytics_debug.js) to the page; create a 'ga' object and tracker</li> <li>Adapt the 'on...' functions to trigger tailored analytics messages as user focuses and blurs across the Block entitys</li> <li>Adapt the anchor so that it, too, sends a tailored analytics message when the link is invoked</li> <li>Check that the tracking functionality works as expected, both for mouse/touch interactions and for keyboard interactions</li> </ul> <p>Kill and resurrect</p> <ul> <li>Kill and resurrect a Block entity to make sure it removes itself entirely from the Scrawl-canvas system, and cleanly recreate itself from saved packet, and that full functionality - including analytics tracking - can be re-applied to it</li> <li>Kill and resurrect a Pattern style to make sure it removes itself entirely from the Scrawl-canvas system, and cleanly recreate itself from saved packet</li> </ul> <p><b>Touch test:</b> should work as expected - but dragging a finger from one block to another may lead to web page navigation being blocked by browser</p> <p><a href="../docs/demo/canvas-009.html">Annotated code</a></p> </div> <img src="img/brick.png" id="brick" class="mypatterns" /> <img src="img/leaves.png" id="leaves" class="mypatterns" /> <script src="canvas-009.js" type="module"></script> </body> </html>