Ripple Grid Hover
A grid of tiles that grows and turns orange around the cursor; a click or tap sends a wave across the whole grid. As a playful backdrop behind a short heading.
Beweeg over het raster of tik voor een golf
How to use it
- Paste the HTML where the components 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.
<!-- Ripple Grid Hover · © 2026 NedDev BV · NedDev Lab-licentie (gratis gebruik, niet doorverkopen) · neddev.com/nl/lab/gebruik/#licentie -->
<div class="jouw-container">
<div class="rgh">
<div class="rgh__raster" aria-hidden="true"></div>
<p class="rgh__hint">Beweeg over het raster of tik voor een golf</p>
</div>
</div>/* Ripple Grid Hover · © 2026 NedDev BV · NedDev Lab-licentie (gratis gebruik, niet doorverkopen) · neddev.com/nl/lab/gebruik/#licentie */
.rgh{position:relative;width:100%;height:100%;background:#f4f3f1;overflow:hidden;touch-action:pan-y;font-family:Switzer,sans-serif;cursor:pointer}
.rgh__raster{position:absolute;inset:12px;display:grid;gap:6px}
.rgh__cel{--k:0;border-radius:4px;background:color-mix(in srgb,#F5480F calc(var(--k) * 100%),#dedbd5);transform:scale(calc(.42 + var(--k) * .58))}
.rgh__hint{position:absolute;left:12px;bottom:10px;margin:0;padding:4px 8px;background:#f4f3f1;border-radius:4px;color:#55524d;font-size:13px;pointer-events:none}// Ripple Grid Hover · © 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 el=root.querySelector('.rgh'); if(!el) return;
var raster=el.querySelector('.rgh__raster'), stil=window.matchMedia('(prefers-reduced-motion: reduce)').matches;
var cellen=[], kol=0, rij=0, muis=null, golven=[], zichtbaar=true, laatsteBeweging=0;
function bouw(){
var r=raster.getBoundingClientRect(); if(!r.width) return;
var maat=r.width<420?30:38; kol=Math.max(4,Math.round(r.width/maat)); rij=Math.max(3,Math.round(r.height/maat));
raster.style.gridTemplateColumns='repeat('+kol+',1fr)'; raster.style.gridTemplateRows='repeat('+rij+',1fr)';
raster.innerHTML=''; cellen=[];
for(var y=0;y<rij;y++) for(var x=0;x<kol;x++){ var c=document.createElement('span'); c.className='rgh__cel'; raster.appendChild(c); cellen.push({el:c,x:(x+0.5)/kol*r.width,y:(y+0.5)/rij*r.height,k:0,laatst:-1}); }
}
function punt(e){ var r=raster.getBoundingClientRect(); return {x:e.clientX-r.left,y:e.clientY-r.top}; }
el.addEventListener('pointermove',function(e){ muis=punt(e); laatsteBeweging=performance.now(); });
el.addEventListener('pointerleave',function(){ muis=null; });
el.addEventListener('pointerdown',function(e){ var p=punt(e); golven.push({x:p.x,y:p.y,t:performance.now()}); });
function stap(nu){
if(zichtbaar&&cellen.length){
if(!stil&&!muis&&nu-laatsteBeweging>2600&&(!golven.length||nu-golven[golven.length-1].t>2600)){
var r=raster.getBoundingClientRect(); golven.push({x:r.width*(0.25+Math.random()*0.5),y:r.height*(0.3+Math.random()*0.4),t:nu,zacht:true});
}
golven=golven.filter(function(g){ return nu-g.t<1800; });
for(var i=0;i<cellen.length;i++){
var c=cellen[i], doel=0;
if(muis){ var d=Math.hypot(c.x-muis.x,c.y-muis.y); doel=Math.max(0,1-d/150); doel=doel*doel*(3-2*doel); }
for(var j=0;j<golven.length;j++){
var g=golven[j], fr=(nu-g.t)/1800, rad=fr*700, dd=Math.abs(Math.hypot(c.x-g.x,c.y-g.y)-rad);
var w=Math.max(0,1-dd/48)*(1-fr)*(g.zacht?0.6:1); if(w>doel) doel=w;
}
c.k+=stil?(doel-c.k):(doel-c.k)*0.18;
var k=Math.round(c.k*100)/100;
if(k!==c.laatst){ c.laatst=k; c.el.style.setProperty('--k',k); }
}
}
requestAnimationFrame(stap);
}
if('IntersectionObserver' in window){ new IntersectionObserver(function(es){ zichtbaar=es[0].isIntersecting; }).observe(el); }
var wacht; if('ResizeObserver' in window){ new ResizeObserver(function(){ clearTimeout(wacht); wacht=setTimeout(bouw,100); }).observe(raster); }
bouw(); requestAnimationFrame(stap);
}
init(document.querySelector('.jouw-container'));
More components
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 →