forked from google/swissgl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtiny.html
39 lines (38 loc) · 856 Bytes
/
tiny.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
<!doctype html>
<html lang="en">
<head>
<title>Tiny SwissGL example</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<style>
body,
html {
margin: 0;
padding: 0;
overflow: hidden;
}
#c {
width: 100vw;
height: 100vh;
}
</style>
</head>
<body>
<canvas id="c"></canvas>
<script type="module">
import SwissGL from './src/swissgl.js';
const canvas = document.getElementById('c');
const glsl = SwissGL(canvas);
glsl.loop(({ time }) => {
glsl.adjustCanvas();
glsl({
time,
Aspect: 'cover',
FP: `
sin(length(XY)*vec3(30,30.5,31)
-time+atan(XY.x,XY.y)*3.),1`,
});
});
</script>
</body>
</html>