scrawl-canvas
Version:
Version 8.9.4 - 19 Nov 2022
91 lines (71 loc) • 3.06 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 007</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;
}
img {
display: none;
}
</style>
</head>
<body>
<h1><a href="index.html">Scrawl-canvas v8</a> - Particles test 007</h1>
<h2>Particle Force objects: generation and 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">Random motion intensity</div>
<div class="green"><input class="controlItem" id="brownianIntensity" type="range" value="2" min="0" max="30" step="0.1" /></div>
<div class="green label">Select filter</div>
<div class="green">
<select class="controlItem" id="filter">
<option value="">none</option>
<option value="blur">blur</option>
<option value="grayscale">grayscale</option>
<option value="invert">invert</option>
<option value="matrix">matrix</option>
<option value="pixelate">pixelate</option>
<option value="sepia">sepia</option>
<option value="tint">tint</option>
</select>
</div>
<div class="green label"> </div>
<div class="green"> </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>
<p><b>Be aware</b> that applying a filter to a particle system can cause it to fail in interesting yet mysterious ways! In some browsers, the addition of a filter can also cause a significant degradation in canvas animation speeds</p>
<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 additional forces to act on the particles.</li>
<li>Create the Emitter alongside its World object and artefact entity</li>
<li>Check that the 'brownian-motion' force function responds to changes in the World object's user-defined 'brownianIntensity' attribute.</li>
<li>Check that the 'mouse-disruptor' force follows the mouse cursor.</li>
<li>Create a set of filters. Check to make sure that selecting a filter will make it apply to all the bear images in the Demo scene.</li>
</ul>
<p><b>Touch test:</b> should work as expected</p>
<p><a href="../docs/demo/particles-007.html">Annotated code</a></p>
</div>
<script src="particles-007.js" type="module"></script>
<img id="bunny" src="img/bunny.png" />
</body>
</html>