scrawl-canvas
Version:
Version 8.9.4 - 19 Nov 2022
63 lines (51 loc) • 2.17 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 DOM 007</title>
<link href="css/normalize.css" rel="stylesheet" />
<link href="css/tests.css" rel="stylesheet" />
<style>
.make_round {
border-radius: 50%;
border: 5px solid lightgray;
}
.make_blue {
border: 5px solid blue;
}
.make_red {
border: 5px solid red;
}
</style>
</head>
<body>
<h1><a href="index.html">Scrawl-canvas v8</a> - DOM test 007</h1>
<h2>Animate a DOM element using the delta attribute object<br />Dynamically change classes on a DOM element</h2>
<h3>This stack is resizable - drag the bottom right corner to change its dimensions.</h3>
<div id="mystack" data-scrawl-stack>
<div id="leftbox" class="make_target"></div>
<div id="rightbox" class="make_target"></div>
<img id="flower" src="img/iris.png" alt="Picture of an iris flower" class="make_round" />
</div>
<p id="reportmessage"></p>
<div class="testinfo">
<h4>Test purpose</h4>
<ul>
<li>Animate a stack element via delta attributes</li>
<li>Dynamically reverse-sign specified delta attributes</li>
<li>Check that % string attributes work correctly, including when added together via delta functionality</li>
<li>Check that stacks and their elements respond correctly to resize actions</li>
<li>(Delta animations in Scrawl-canvas v7 needed to be called explicitly as part of a user's display cycle animation; v8 automates this process as part of the display cycle)</li>
</ul><ul>
<li>Create and populate a non-visible Group object, to contain artefacts for collision detection work.</li>
<li>Test stack element checkHit functionality</li>
<li>Dynamically change a stack element's CSS classes, adding and removing them as necessary</li>
</ul>
<p><b>Touch test:</b> canvas should be resizable</p>
<p><a href="../docs/demo/dom-007.html">Annotated code</a></p>
</div>
<script src="dom-007.js" type="module"></script>
</body>
</html>