UNPKG

scrawl-canvas

Version:
66 lines (53 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 032</title> <link href="css/normalize.css" rel="stylesheet" /> <link href="css/tests.css" rel="stylesheet" /> <style> canvas { background-color: lemonchiffon; } .button-menu { text-align: center; width: 100%; } </style> </head> <body> <h1><a href="index.html">Scrawl-canvas v8</a> - Canvas test 032</h1> <h2>Freehand drawing</h2> <h3>Click-drag to draw lines<br />This canvas is resizable - drag the bottom right corner to change its dimensions.</h3> <div class="button-menu"> <button id="clear-button">Clear lines</button> <button id="undo-button">Undo</button> <button id="redo-button">Redo</button> </div> <div class="canvas-container"> <canvas id="mycanvas" data-scrawl-canvas data-is-responsive="true" data-base-width="1000" data-base-height="1000" data-fit="contain" data-base-background-color="honeydew" ></canvas> </div> <p id="reportmessage"></p> <div class="testinfo"> <h4>Test purpose</h4> <ul> <li>Define a responsive canvas element with a fixed-dimensions base Cell</li> <li>Implement line drawing functionality using Polyline entitys</li> <li>Add in user interaction buttons to implement undo/redo, and clear canvas, functionality.</li> </ul> <p><b>Touch test:</b> canvas should be resizable. Known issue: new lines may not start, or may connect to previous line ends - the test needs to be reconsidered and rewritten to make UX more robust.</p> <p><a href="../docs/demo/canvas-032.html">Annotated code</a></p> </div> <script src="canvas-032.js" type="module"></script> </body> </html>