scrawl-canvas
Version:
Version 8.9.4 - 19 Nov 2022
48 lines (35 loc) • 1.8 kB
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 037</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 037</h1>
<h2>Pan and zoom using a Picture entity</h2>
<h3>Use the mouse scroll button to zoom the canvas display, and drag/drop to pan around the display</h3>
<canvas
id="mycanvas"
width="500"
height="500"
data-scrawl-canvas
data-base-background-color="honeydew"
></canvas>
<p id="reportmessage"></p>
<div class="testinfo">
<h4>Test purpose</h4>
<ul>
<li>Crerate a Picture entity hat displays a large image asset</li>
<li>Add event listeners that allow the user to zoom the image in/out within the Picture. Zooming out should be constrained so that no blank space appears at the Picture's edges: when the image edge zooms past the Picture edge, it sticks to the edge. Wherever possible (as constrained by edges), the zoom effect should center on the mouse cursor.</li>
<li>Add event listeners that allow the user to drag the image within the Picture; again, drag should be constrained so that no blank space appears at the Picture's edges</li>
</ul>
<p><b>Touch test:</b> TODO: find a way to allow touch users to zoom in on the image while not zooming the rest of the browser output; differentiate between single touch (pan dragging) and multiple touches (for zoom/pinch)</p>
<p><a href="../docs/demo/canvas-037.html">Annotated code</a></p>
</div>
<script src="canvas-037.js" type="module"></script>
</body>
</html>