Dot Pattern
Dotted grid background with a spotlight that follows the pointer and drifts on its own when there is none. For a dark hero or contact block that needs a little life.
Kaasboerderij De Hoeve
Boerenkaas van eigen melk, elke zaterdag op de markt in Gouda.
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.
<!-- Dot Pattern · © 2026 NedDev BV · NedDev Lab-licentie (gratis gebruik, niet doorverkopen) · neddev.com/nl/lab/gebruik/#licentie -->
<div class="jouw-container">
<div class="dtp">
<div class="dtp__laag dtp__laag--basis" aria-hidden="true"></div>
<div class="dtp__laag dtp__laag--licht" aria-hidden="true"></div>
<div class="dtp__laag dtp__laag--kern" aria-hidden="true"></div>
<div class="dtp__tekst">
<h3 class="dtp__kop">Kaasboerderij De Hoeve</h3>
<p class="dtp__regel">Boerenkaas van eigen melk, elke zaterdag op de markt in Gouda.</p>
</div>
</div>
</div>/* Dot Pattern · © 2026 NedDev BV · NedDev Lab-licentie (gratis gebruik, niet doorverkopen) · neddev.com/nl/lab/gebruik/#licentie */
.dtp{--x:50%;--y:50%;position:relative;width:100%;height:100%;background:#0a0a0a;overflow:hidden;display:flex;align-items:center;justify-content:center;font-family:Switzer,sans-serif;touch-action:pan-y}
.dtp__laag{position:absolute;inset:0;background-size:20px 20px;background-position:center}
.dtp__laag--basis{background-image:radial-gradient(circle,rgba(244,243,241,.16) 1px,transparent 1.5px)}
.dtp__laag--licht{background-image:radial-gradient(circle,rgba(244,243,241,.75) 1.3px,transparent 1.8px);-webkit-mask-image:radial-gradient(circle 170px at var(--x) var(--y),#000,rgba(0,0,0,.4) 50%,transparent 100%);mask-image:radial-gradient(circle 170px at var(--x) var(--y),#000,rgba(0,0,0,.4) 50%,transparent 100%)}
.dtp__laag--kern{background-image:radial-gradient(circle,#F5480F 1.6px,transparent 2.1px);-webkit-mask-image:radial-gradient(circle 64px at var(--x) var(--y),#000,transparent 100%);mask-image:radial-gradient(circle 64px at var(--x) var(--y),#000,transparent 100%)}
.dtp__tekst{position:relative;text-align:center;padding:0 24px;max-width:420px}
.dtp__kop{margin:0 0 8px;color:#fff;font-size:28px;font-weight:600;line-height:1.1;letter-spacing:-.01em}
.dtp__regel{margin:0;color:rgba(244,243,241,.7);font-size:15px;line-height:1.5}
@media (max-width:480px){.dtp__kop{font-size:22px}.dtp__regel{font-size:14px}}// Dot Pattern · © 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('.dtp'); if(!el) return;
var stil=window.matchMedia('(prefers-reduced-motion: reduce)').matches;
var cx=0.5, cy=0.5, tx=0.5, ty=0.5, binnen=false, t0=performance.now(), zichtbaar=true;
function zet(){ el.style.setProperty('--x',(cx*100).toFixed(2)+'%'); el.style.setProperty('--y',(cy*100).toFixed(2)+'%'); }
el.addEventListener('pointermove',function(e){ var r=el.getBoundingClientRect(); tx=(e.clientX-r.left)/r.width; ty=(e.clientY-r.top)/r.height; binnen=true; if(stil){cx=tx;cy=ty;zet();} });
el.addEventListener('pointerleave',function(){ binnen=false; if(stil){cx=cy=tx=ty=0.5;zet();} });
if(stil){ zet(); return; }
if('IntersectionObserver' in window){ new IntersectionObserver(function(es){ zichtbaar=es[0].isIntersecting; }).observe(el); }
(function stap(nu){
if(zichtbaar){
if(!binnen){ var s=(nu-t0)/1000; tx=0.5+Math.sin(s*0.45)*0.28; ty=0.5+Math.sin(s*0.7+1.3)*0.24; }
cx+=(tx-cx)*0.09; cy+=(ty-cy)*0.09; zet();
}
requestAnimationFrame(stap);
})(performance.now());
}
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 →