Fluted Glass
A photo behind vertically ribbed glass: each rib shows a slightly wider slice of the image squeezed together, with light and shade along its edge, and the refraction shifts with the cursor. For a hero for an interior designer or architect.
Beweeg over het glas
How to use it
- Paste the HTML where the backgrounds & webgl should appear.
- Add the CSS to your stylesheet. All classes are prefixed, so nothing clashes with your own styles.
- Add the JavaScript and call init() with the element that contains the HTML.
<!-- Fluted Glass · © 2026 NedDev BV · NedDev Lab-licentie (gratis gebruik, niet doorverkopen) · neddev.com/nl/lab/gebruik/#licentie -->
<div class="jouw-container">
<div class="nfg">
<img class="nfg__bron" src="https://neddev.com/lab-media/hero-slideshow-2.webp" alt="Woonkamer met houtkachel en uitzicht op zee, gezien door geribbeld glas">
<canvas class="nfg__doek" aria-hidden="true"></canvas>
<p class="nfg__hint">Beweeg over het glas</p>
</div>
</div>/* Fluted Glass · © 2026 NedDev BV · NedDev Lab-licentie (gratis gebruik, niet doorverkopen) · neddev.com/nl/lab/gebruik/#licentie */
.nfg{position:absolute;inset:0;overflow:hidden;background:#d9d4cb;font-family:'Switzer',sans-serif;touch-action:pan-y}
.nfg__bron{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}
.nfg__doek{position:absolute;inset:0;width:100%;height:100%;display:block;opacity:0;transition:opacity .4s}
.nfg.is-klaar .nfg__doek{opacity:1}
.nfg__hint{position:absolute;left:16px;bottom:14px;margin:0;padding:6px 10px;background:#0a0a0a;color:#fff;font-size:13px;border-radius:4px;transition:opacity .3s}
.nfg.is-bewogen .nfg__hint{opacity:0}// Fluted Glass · © 2026 NedDev BV · NedDev Lab-licentie (gratis gebruik, niet doorverkopen) · neddev.com/nl/lab/gebruik/#licentie
// root = het element waarin de HTML staat
function init(root){
var w = root.querySelector('.nfg'); if (!w) return;
var doek = w.querySelector('.nfg__doek'), bron = w.querySelector('.nfg__bron');
var ctx = doek.getContext && doek.getContext('2d'); if (!ctx) return;
var rustig = window.matchMedia && matchMedia('(prefers-reduced-motion: reduce)').matches;
var B = 0, H = 0, dpr = 1, doel = 0.62, nu = 0.5, frame = 0;
function maat() {
var r = w.getBoundingClientRect(); dpr = Math.min(2, window.devicePixelRatio || 1);
B = Math.max(1, r.width); H = Math.max(1, r.height);
doek.width = Math.round(B * dpr); doek.height = Math.round(H * dpr);
ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
teken();
}
function teken() {
if (!bron.naturalWidth) return;
var iw = bron.naturalWidth, ih = bron.naturalHeight;
var sc = Math.max(B / iw, H / ih), ox = (iw - B / sc) / 2, oy = (ih - H / sc) / 2;
var ribben = Math.max(14, Math.min(64, Math.round(B / 26))), rb = B / ribben;
var muis = nu * B;
ctx.clearRect(0, 0, B, H);
for (var i = 0; i < ribben; i++) {
var x0 = i * rb, mid = x0 + rb / 2;
var afstand = (mid - muis) / B;
var verschuif = afstand * rb * 2.6 + Math.sin(i * 1.3) * rb * 0.12;
var breedte = rb * (1.7 + 0.5 * Math.cos(afstand * 3));
var sx = ox + (mid + verschuif - breedte / 2) / sc, sw = breedte / sc;
if (sx < 0) sx = 0; if (sx + sw > iw) sx = iw - sw;
ctx.drawImage(bron, sx, oy, sw, H / sc, x0, 0, rb + 0.6, H);
var g = ctx.createLinearGradient(x0, 0, x0 + rb, 0);
g.addColorStop(0, 'rgba(10,10,10,0.28)');
g.addColorStop(0.28, 'rgba(255,255,255,0.22)');
g.addColorStop(0.55, 'rgba(255,255,255,0.02)');
g.addColorStop(1, 'rgba(10,10,10,0.16)');
ctx.fillStyle = g; ctx.fillRect(x0, 0, rb + 0.6, H);
}
w.classList.add('is-klaar');
}
function loop() {
nu += (doel - nu) * 0.1;
teken();
if (Math.abs(doel - nu) > 0.0008) frame = requestAnimationFrame(loop); else { nu = doel; teken(); frame = 0; }
}
function stuur(v) { doel = v; if (rustig) { nu = doel; teken(); return; } if (!frame) frame = requestAnimationFrame(loop); }
w.addEventListener('pointermove', function (e) {
var r = w.getBoundingClientRect(); w.classList.add('is-bewogen');
stuur(Math.min(1, Math.max(0, (e.clientX - r.left) / r.width)));
});
w.addEventListener('pointerleave', function () { stuur(0.5); });
function klaar() { maat(); if (!rustig) stuur(doel); }
if (bron.complete && bron.naturalWidth) klaar(); else bron.addEventListener('load', klaar);
if (window.ResizeObserver) new ResizeObserver(maat).observe(w); else window.addEventListener('resize', maat);
}
init(document.querySelector('.jouw-container'));
More backgrounds & webgl
Seen something you like?
Add it to your selection and send it over. We build your site around it, in your brand.
Get in touch →