UNPKG

scrawl-canvas

Version:
53 lines (41 loc) 1.89 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 064</title> <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 064</h1> <h2>Animation object: gradient along a line</h2> <h3>Drag the pins to change the shape of the line. The canvas is resizable.</h3> <div class="canvas-container"> <canvas id="mycanvas" data-scrawl-canvas data-is-responsive="true" data-base-width="800" data-base-height="600" data-base-background-color="black" data-fit="contain" ></canvas> </div> <p id="reportmessage"></p> <div class="testinfo"> <h4>Test purpose</h4> <ul> <li>Create a set of draggable pin entitys, and a Polyline entity that uses the pins for positioning data, to create a line that can be shaped by the user</li> <li>Create a color object which can be used to generate a range of colors between two defined colors</li> <li>Create a template Wheel entity that we can use to colorise the line</li> <li>Create an Animation object which will undertake a Display cycle to clear the canvas; then stamp the template entity along the length of the line, varying it's fillStyle color to reflect its progress along the line; then compose and display the final canvas output</li> <li>Check that the color correctly alters along the length of the line, and updates as the user changes the shape of the line</li> </ul> <p><b>Touch test:</b> not required</p> <p><a href="../docs/demo/canvas-064.html">Annotated code</a></p> </div> <script src="canvas-064.js" type="module"></script> </body> </html>