28 lines
653 B
HTML
28 lines
653 B
HTML
|
<html>
|
||
|
<head>
|
||
|
<meta charset="utf-8">
|
||
|
<script type="module">
|
||
|
import { ShaderView } from "./mod.js";
|
||
|
const shader = `
|
||
|
void main()
|
||
|
{
|
||
|
vec2 uv = (gl_FragCoord.xy * 2. - iResolution.xy) / iResolution.y;
|
||
|
float d = length(uv);
|
||
|
d = abs(sin(d * 10. + iTime)) / 10.;
|
||
|
d = smoothstep(0.95, 1., 1. - d);
|
||
|
vec3 color = d * vec3(1., 2., 3.);
|
||
|
gl_FragColor = vec4(color, 1.0);
|
||
|
}
|
||
|
`.trim();
|
||
|
new ShaderView(shader, {
|
||
|
parent: document.getElementById("container"),
|
||
|
size: { width: 512, height: 512 },
|
||
|
});
|
||
|
</script>
|
||
|
</head>
|
||
|
|
||
|
<body>
|
||
|
<div id="container"></div>
|
||
|
</body>
|
||
|
</html>
|