Frontend Forever App
We have a mobile app for you to download and use. And you can unlock many features in the app.
Get it now
Intall Later
Run
HTML
CSS
Javascript
Output
Ring Distance
Max Rings
Wave Count
Wave Depth
Y center
Direction
.ui { position: absolute; bottom: 0; z-index: 1; background: rgba(0,0,0,.7); color: #fff; font-family: monospace; line-height: 1.2; font-size: 133%; width: 100%; display: flex; flex-wrap: wrap; justify-content: center; opacity: 0; transition: opacity 250ms ease; } body:hover .ui { opacity: 1; } .ui__field { border-radius: 5px; background: #000; margin: .1em; padding: .1em; } label { font-size: 70%; display: block; font-size: .8; } input[type="range"] { width: 7.1em; }
const $ = (sel) => document.querySelector(sel) || {} const regl = createREGL() const $code = (sel) => ( document.getElementById(sel) || {} ).textContent || "void main() {}" const drawFrame = regl({ frag: $code('fragmentShader'), vert: $code('vertexShader'), attributes: { position: [[-1,-1], [-1, 1], [ 1,-1], [ 1,-1], [-1, 1], [ 1, 1]] }, uniforms: { color: [1,0,0], width: ctx => ctx.viewportWidth, height: ctx => ctx.viewportHeight, ringDistance: ctx => parseFloat($('#ringDistance').value), maxRings: ctx => parseInt($('#maxRings').value), waveCount: ctx => parseInt($('#waveCount').value), waveDepth: ctx => parseFloat($('#waveDepth').value), yCenter: ctx => parseFloat($('#yCenter').value), direction: ctx => parseFloat($('#direction').value), time: ctx => ctx.tick }, count: 6 }) regl.frame(ctx => { regl.clear({ color: [1,1,1,1], depth: 1 }) drawFrame() })