scrawl-canvas
Version:
Version 8.9.4 - 19 Nov 2022
64 lines (50 loc) • 2.33 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 Particles 006</title>
<link href="css/normalize.css" rel="stylesheet" />
<link href="css/tests.css" rel="stylesheet" />
<style>
.controls {
grid-template-columns: 1fr 2fr 1fr 2fr;
}
canvas {
margin: 0 auto;
}
</style>
</head>
<body>
<h1><a href="index.html">Scrawl-canvas v8</a> - Particles test 006</h1>
<h2>Fixed number of particles in a field; preAction and postAction functionality</h2>
<div class="controls">
<div class="green label">Particle count</div>
<div class="green"><input class="controlItem" id="particleCount" type="range" value="50" min="10" max="500" step="10" /></div>
<div class="green label">Connection radius</div>
<div class="green"><input class="controlItem" id="connectionRadius" type="range" value="80" min="10" max="150" step="1" /></div>
</div>
<canvas
id="mycanvas"
width="600"
height="400"
data-scrawl-canvas
data-base-background-color="beige"
></canvas>
<p id="reportmessage"></p>
<div class="testinfo">
<h4>Test purpose</h4>
<ul>
<li>Create a Block entity to match the canvas dimensions, to act as a generation area for an Emitter with a set number of required particles.</li>
<li>Create the Emitter alongside its World object, artefact entity and pre-, post- and stampAction functions.</li>
<li>Check that the pre- and post- actions work as expected, displaying lines between close Particles, and between Particles and the mouse cursor. Check that the functions respond to changes in the World object's user-defined 'connectionRadius' attribute.</li>
<li>Check that Particles that move beyond the canvas display are killed and replaced by new Particles.</li>
<li>Check that the requested number of particles, and the actual number of particles displayed, match (with allowances for particle generation and natural particle culling).</li>
</ul>
<p><b>Touch test:</b> should work as expected</p>
<p><a href="../docs/demo/particles-006.html">Annotated code</a></p>
</div>
<script src="particles-006.js" type="module"></script>
</body>
</html>