scrawl-canvas
Version:
Version 8.9.4 - 19 Nov 2022
58 lines (46 loc) • 2.05 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 062</title>
<link href="css/normalize.css" rel="stylesheet" />
<link href="css/tests.css" rel="stylesheet" />
<style>
canvas {
margin: 0 auto;
}
</style>
</head>
<body>
<h1><a href="index.html">Scrawl-canvas v8</a> - Canvas test 062</h1>
<h2>Group and ungroup entitys; create a bespoke drag-drop UX</h2>
<h3>Use drag action to create a selection group.<br />Selection group is draggable after creation.<br />Click outside the selection group to remove it.</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 a set of Block entitys spread randomly across the canvas, in their own group</li>
<li>Create an addition Block, in its own group, to handle box selection and movement; make the block sensitive to mouse hover (and touch) actions</li>
<li>Create functions to handle mouse down, move and up actions</li>
<ul>
<li>If no selection, or mouse down occurs outside selection, create a new selection as user drags the cursor across the canvas</li>
<li>If mouse down occurs inside the selection, move the selection and its box as user drags the cursor across the canvas</li>
</ul>
<li>When selected, check that those entitys are fully opaque and animated (by delta roll)</li>
<li>When not selected, check that those entitys are translucent and stationary</li>
<li>When user hovers mouse over selection, check that the selection box border changes and the cursor changes to a grab hand</li>
</ul>
<p><b>Touch test:</b> not required</p>
<p><a href="../docs/demo/canvas-062.html">Annotated code</a></p>
</div>
<script src="canvas-062.js" type="module"></script>
</body>
</html>