-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
77 lines (69 loc) · 3.24 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
<!DOCTYPE html>
<html lang="en" data-theme="dark">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://unpkg.com/@picocss/pico@1.5.9/css/pico.min.css">
<link rel="stylesheet" href="assets/style.css">
<title>Emitter Based Particle System</title>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-MYQTMPZ0LS"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-MYQTMPZ0LS');
</script>
</head>
<body>
<header>
<h2>Emitter Based Particle System</h2>
<p>You can select an emitter type from the dropdown below and click the mouse anywhere on the canvas to add a
new emitter at that position.</p>
<details>
<summary>More Information</summary>
<p>This system is designed to be flexible and extendable; one only needs to implement the emitter class and its
2 main
methods to create nearly an infinite number of particle effects.</p>
<p>All emitter types use the same single PNG image. All color, size and alpha transforms are done on-the-fly
programmatically.</p>
<p>This is the single PNG image used for all emitters <img id="img-particle" src="assets/particle.png"
alt=""> scaled to 32x32; its original
size is 16x16</p>
</details>
<details>
<summary>Source Code and Credits</summary>
<p>Source code can be found on my <a href="https://github.com/topaz1008/canvas-particle-system/"
target="_blank">GitHub</a>.</p>
<p><span class="strike">Credits: This demo is Using <a href="https://github.com/josephg/noisejs"
target="_blank">noisejs</a> by
josephg for generating the perlin noise.</span> PerlinEmitter is still WIP.</p>
</details>
</header>
<main id="main-container">
<fieldset>
<legend>Controls</legend>
<label>
<button id="btn-clear" role="button" data-action="click">Clear All Active Emitters</button>
</label>
<legend>Emitter Type</legend>
<label>
<select id="emitter-type" role="combobox" data-action="change">
<option value="attracting" selected>Attracting Emitter</option>
<option value="fireworks">Fireworks Emitter</option>
<option value="spray">Spray Emitter</option>
<option value="simple">Simple Emitter</option>
<option value="mouse">Mouse Trail Emitter</option>
<option value="tunnel">Tunnel Emitter</option>
<!-- TODO: uncomment this when perlin is working properly -->
<option value="perlin">Perlin Emitter</option>
</select>
</label>
</fieldset>
<div id="canvas-container">
<canvas id="main-canvas"></canvas>
</div>
</main>
<script src="src/main.js" type="module"></script>
</body>
</html>