UNPKG

scrawl-canvas

Version:
65 lines (50 loc) 1.91 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 034</title> <link href="css/normalize.css" rel="stylesheet" /> <link href="css/tests.css" rel="stylesheet" /> <style> canvas { background-color: lemonchiffon; } .canvas-container { border: 1px solid black; width: 400px; height: 400px; min-width: 200px; min-height: 200px; max-width: 800px; max-height: 800px; } </style> </head> <body> <h1><a href="index.html">Scrawl-canvas v8</a> - Canvas test 034</h1> <h2>Determine the displayed shape of the visible canvas; react to changes in the displayed shape</h2> <h3>This canvas is resizable - drag the bottom right corner to change its dimensions.</h3> <div class="canvas-container"> <canvas id="mycanvas" data-scrawl-canvas data-is-responsive="true" ></canvas> </div> <p id="reportmessage"></p> <div class="testinfo"> <h4>Test purpose</h4> <ul> <li>Create a resizable &lt;canvas> element</li> <li>Create a Phrase entity to display in the canvas</li> <li>Create hook functions for the Phrase that will be invoked as the &lt;canvas> dimensions are changed</li> <li>Check that appropriate hooks are fired, and the Phrase entity updated, in response to changes in the canvas element's dimensions - five states ('banner', 'landscape', 'rectangle', 'portrait', 'skyscraper') should be viewable as the canvas corner is dragged horizontally right (and up) and then diagonally down/left</li> </ul> <p><b>Touch test:</b> canvas should be resizable</p> <p><a href="../docs/demo/canvas-034.html">Annotated code</a></p> </div> <script src="canvas-034.js" type="module"></script> </body> </html>