Lijn-mask reveal
A heading that wipes in line by line once it enters the viewport: each line opens left to right via clip-path. Lines are recalculated at every width.
Wij bouwen websites die rustig bewegen, snel laden en precies doen wat je bezoeker verwacht.
How to use it
- Paste the HTML where the scroll effects 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.
<!-- Lijn-mask reveal · © 2026 NedDev BV · NedDev Lab-licentie (gratis gebruik, niet doorverkopen) · neddev.com/nl/lab/gebruik/#licentie -->
<div class="jouw-container">
<div class="h3lm">
<div class="h3lm-blok">
<h2 class="h3lm-h">Wij bouwen websites die rustig bewegen, snel laden en precies doen wat je bezoeker verwacht.</h2>
<button class="h3lm-again" type="button">Speel opnieuw</button>
</div>
</div>
</div>/* Lijn-mask reveal · © 2026 NedDev BV · NedDev Lab-licentie (gratis gebruik, niet doorverkopen) · neddev.com/nl/lab/gebruik/#licentie */
/* fonts (Fontshare): switzer@400,700 */
.h3lm{width:100%;height:100%;box-sizing:border-box;container-type:inline-size;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:22px;padding:clamp(18px,6cqi,64px);background:#141414;color:#f2f0ea}
.h3lm-blok{display:flex;flex-direction:column;align-items:flex-start;gap:22px}
.h3lm-h{margin:0;max-width:20ch;font:700 clamp(22px,5.6cqi,58px)/1.08 Switzer,sans-serif;letter-spacing:-.02em}
.h3lm-r{display:block;padding-bottom:.1em;margin-bottom:-.1em;clip-path:inset(0 100% 0 0);transition:clip-path .95s cubic-bezier(.65,0,.2,1)}
.h3lm-r>span{display:inline-block;transform:translateX(-.35em);transition:transform 1.1s cubic-bezier(.2,.7,.1,1)}
.h3lm.is-in .h3lm-r{clip-path:inset(0 0 0 0)}
.h3lm.is-in .h3lm-r>span{transform:none}
.h3lm-again{border:1px solid rgba(242,240,234,.35);background:transparent;color:#f2f0ea;border-radius:4px;padding:10px 16px;font:500 14px/1 Switzer,sans-serif;cursor:pointer;transition:border-color .2s,background .2s}
.h3lm-again:hover{border-color:#F5480F;background:rgba(240,78,26,.12)}
.h3lm-again:focus-visible{outline:2px solid #F5480F;outline-offset:3px}
@media (prefers-reduced-motion:reduce){.h3lm-r,.h3lm-r>span{transition:none;clip-path:none;transform:none}.h3lm-again{display:none}}// Lijn-mask reveal · © 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 wrap = root.querySelector('.h3lm'), kop = root.querySelector('.h3lm-h'), knop = root.querySelector('.h3lm-again');
var tekst = kop.textContent.trim(), breedte = 0;
function splits() {
var w = kop.clientWidth; if (!w || w === breedte) return; breedte = w;
kop.textContent = '';
var woorden = tekst.split(/\s+/), spans = woorden.map(function (t, i) {
var s = document.createElement('span'); s.textContent = t; kop.appendChild(s);
if (i < woorden.length - 1) kop.appendChild(document.createTextNode(' '));
return s;
});
var regels = [], top = null;
spans.forEach(function (s) { if (top === null || Math.abs(s.offsetTop - top) > 4) { regels.push([]); top = s.offsetTop; } regels[regels.length - 1].push(s.textContent); });
kop.textContent = '';
regels.forEach(function (r, i) {
var buiten = document.createElement('span'), binnen = document.createElement('span');
buiten.className = 'h3lm-r'; buiten.style.transitionDelay = (i * 0.13) + 's';
binnen.style.transitionDelay = (i * 0.13) + 's'; binnen.textContent = r.join(' ');
buiten.appendChild(binnen); kop.appendChild(buiten);
});
}
splits();
if (window.ResizeObserver) new ResizeObserver(function () { splits(); }).observe(kop);
function speel() { wrap.classList.remove('is-in'); void wrap.offsetWidth; requestAnimationFrame(function () { wrap.classList.add('is-in'); }); }
if ('IntersectionObserver' in window) {
var io = new IntersectionObserver(function (es) { es.forEach(function (e) { if (e.isIntersecting) { speel(); io.disconnect(); } }); }, { threshold: 0.35 });
io.observe(wrap);
} else wrap.classList.add('is-in');
knop.addEventListener('click', speel);
}
init(document.querySelector('.jouw-container'));
More scroll effects
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 →