-
Notifications
You must be signed in to change notification settings - Fork 8
/
index.html
36 lines (31 loc) · 1 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
<!doctype html>
<html style="width: 100%; height: 100%">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>WebGL Fluid Enhanced</title>
<script type="module" defer>
import WebGLFluidEnhanced from 'webgl-fluid-enhanced';
const simulation = new WebGLFluidEnhanced();
simulation.setConfig({
colorPalette: ['#cc211b', '#f1c593', '#e87e54', '#f193a7', '#ec6fa9'],
densityDissipation: 3,
colorUpdateSpeed: 5,
hover: false,
brightness: 0.6,
velocityDissipation: 0.5,
bloom: false,
});
simulation.start();
window.addEventListener('keydown', function (event) {
if (event.code === 'Space') {
simulation.multipleSplats(1);
}
});
window.addEventListener('beforeunload', () => {
simulation.stop();
});
</script>
</head>
<body style="margin: 0; width: 100%; height: 100%; overflow: hidden"></body>
</html>