UNPKG

scrawl-canvas

Version:
76 lines (60 loc) 2.83 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 Particles 009</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 009</h1> <h2>Net particles: drag-and-drop functionality</h2> <h3>The yellow beads and the orange ball are draggable</h3> <div class="controls"> <div class="green label">Select filter</div> <div class="green"> <select class="controlItem" id="filter"> <option value="">none</option> <option value="grayscale">grayscale</option> <option value="invert">invert</option> <option value="matrix">matrix</option> <option value="tint">tint</option> </select> </div> <div class="green label">&nbsp;</div> <div class="green">&nbsp;</div> </div> <canvas id="mycanvas" width="600" height="500" data-scrawl-canvas data-base-background-color="slategray" ></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 particle world object and a Net entity. Make all the particles in the top row static, and mark them as draggable.</li> <li>Create a Wheel entity, and a Force object that uses that entity's position and radius to create a repulsing force (simulating a collision effect). Make the Wheel entity draggable; and that particles appear above it when it is dragged.</li> <li>Check that particles respond to the gravity and Wheel forces appropriately.</li> <li>Check that all the particles can be dragged; that static particles remain where they are placed after drag completes, while other particles rebound back into their positions relative to other particles.</li> <li>Add a selection of Filter objects to the demo; check that applying a filter to the Net entity displays both on the entity's artefact and on its Spring connection lines.</li> </ul> <p><b>Touch test:</b> should work as expected. Known issue: moving the pins is inconsistent (because pins are too small on device screens?)</p> <p><a href="../docs/demo/particles-009.html">Annotated code</a></p> </div> <script src="particles-009.js" type="module"></script> </body> </html>