-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
executable file
·95 lines (91 loc) · 3.61 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS Houdini Fractals Demo</title>
<link rel="shortcut icon" href="favicon.ico" />
<link rel="stylesheet" href="fractals.css">
</head>
<body>
<h1><span>CSS</span> <span>Houdini</span> <span>Fractals</span> <span>Demo</span></h1>
<div class="flex">
<section class="demo fractals"></section>
<section>
<div>
<label>Colors</label>
<select id="colors">
<option selected>red green blue cyan magenta yellow</option>
<option>red green blue</option>
<option>black</option>
<option>#000 #222 #444 #666 #888 #aaa #ccc</option>
</select>
</div>
<div>
<label>Shape</label>
<select id="shape">
<option value="line" selected>line</option>
<option value="circle">circle</option>
<option value="square">square</option>
</select>
</div>
<div>
<label>Angle</label>
<input id="angle" type="range" min="0" max="360" value="30">
</div>
<div>
<label>Starting Length %</label>
<input id="starting-length-percent" type="range" min="5" max="95" value="22">
</div>
<div>
<label>Next Line Size</label>
<input id="next-line-size" type="range" min="0.1" max="0.9" step="0.1" value=".8">
</div>
<div>
<label>Max Draw Count</label>
<input id="max-draw-count" type="range" min="0" max="250000" step="1000" value="10000">
</div>
<div>
<label>Show Origin</label>
<select id="show-origin">
<option value="1">Yes</option>
<option value="0" selected>No</option>
</select>
</div>
<div>
<label>Debug to Console</label>
<select id="debug-to-console">
<option value="1">Yes</option>
<option value="0" selected>No</option>
</select>
</div>
<div class="center">
<a href="https://github.com/ConradSollitt/css-houdini-fractals">https://github.com/ConradSollitt/css-houdini-fractals</a>
</div>
</section>
</div>
<script type="module">
// Register the Fractals Paint Worklet
(async function () {
if (CSS['paintWorklet'] === undefined) {
await import('https://unpkg.com/css-paint-polyfill');
}
CSS.paintWorklet.addModule('fractals.js');
})();
// Setup page form
(function () {
const demo = document.querySelector('.demo');
const inputs = document.querySelectorAll('input, select');
for (const input of inputs) {
input.setAttribute('current-value', input.value);
input.oninput = () => {
demo.style.setProperty('--' + input.id, input.value);
input.setAttribute('current-value', input.value);
};
}
})();
</script>
<!-- Show a warning for Older browsers (IE, Older Mobile Devices, etc) -->
<script nomodule src="https://cdn.jsdelivr.net/npm/dataformsjs@5/js/web-components/old-browser-warning.min.js"></script>
</body>
</html>