scrawl-canvas
Version:
Version 8.9.4 - 19 Nov 2022
89 lines (72 loc) • 2.68 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 Filters 501</title>
<link href="css/normalize.css" rel="stylesheet" />
<link href="css/tests.css" rel="stylesheet" />
<style>
.controls {
grid-template-columns: 1fr 2fr 1fr 2fr;
}
img {
display: none;
}
canvas {
margin: 0 auto;
}
</style>
</head>
<body>
<h1><a href="index.html">Scrawl-canvas v8</a> - Filters test 501</h1>
<h2>Canvas engine filter strings (based on CSS filters)</h2>
<div class="controls">
<div class="blue label">Filter string</div>
<div class="blue">
<select class="controlItem" id="filter">
<option value="none">none</option>
<option value="blur(6px)">blur(6px)</option>
<option value="brightness(0.4)">brightness(0.4)</option>
<option value="contrast(200%)">contrast(200%)</option>
<option value="drop-shadow(4px 4px 4px blue)">drop-shadow(4px 4px 4px blue)</option>
<option value="grayscale(100%)">grayscale(100%)</option>
<option value="hue-rotate(90deg)">hue-rotate(90deg)</option>
<option value="invert(75%)">invert(75%)</option>
<option value="opacity(25%)">opacity(25%)</option>
<option value="saturate(30%)">saturate(30%)</option>
<option value="sepia(100%)">sepia(100%)</option>
</select>
</div>
<div class="blue label">Apply to</div>
<div class="blue">
<select class="controlItem" id="target">
<option value="picture">Picture entity</option>
<option value="phrase">Phrase entity</option>
<option value="cell">Cell wrapper</option>
</select>
</div>
</div>
<canvas
id="mycanvas"
width="400"
height="400"
data-scrawl-canvas
></canvas>
<img id="iris" src="img/iris.png" class="flowers" />
<p id="reportmessage"></p>
<div class="testinfo">
<h4>Test purpose</h4>
<ul>
<li>Create a test Picture entity, and a Phrase entity</li>
<li>Apply a set of CSS-based filter Strings to the entitys, and to the Cell</li>
<li>Check that the selected entity/Cell updates its display in line with the current filter String</li>
</ul>
<p><b>Known issue:</b> Webkit-based browsers (for instance, Safari) have not yet implemented the Canvas context 'filter' attribute functionality.</p>
<p><b>Touch test:</b> not required</p>
<p><a href="../docs/demo/filters-501.html">Annotated code</a></p>
</div>
<script src="filters-501.js" type="module"></script>
</body>
</html>