Lijn-mask reveal
Heading lines wipe in via clip-path, one by one.
We bouwen interfacesdie bewegen metintentie.
How to use it
- Paste the HTML where the scroll effects should appear. Include the script tags at the top once per page.
- 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 · NedDev · eigen werk. -->
<!-- benodigd, één keer per pagina: -->
<script src="https://cdn.jsdelivr.net/npm/gsap@3.13.0/dist/gsap.min.js"></script>
<div class="jouw-container">
<div class="slm-root"><h3 class="slm-h"><span class="slm-line">We bouwen interfaces</span><span class="slm-line">die bewegen met</span><span class="slm-line">intentie.</span></h3></div>
</div>/* Lijn-mask reveal · NedDev · eigen werk. */
.slm-root{position:absolute;inset:0;display:flex;align-items:center;padding:0 22px;background:#0d0d12}
.slm-h{margin:0;font:800 clamp(20px,4.5vw,38px)/1.05 'Boldonse','Switzer',sans-serif;color:#f6f6fb;text-transform:uppercase}
.slm-line{display:block;clip-path:inset(0 100% 0 0);will-change:clip-path}// Lijn-mask reveal · NedDev · eigen werk.
// root = het element waarin de HTML staat
function init(root){
var lines=root.querySelectorAll('.slm-line');if(!window.gsap){lines.forEach(function(l){l.style.clipPath='inset(0 0 0 0)';});return;}gsap.to(lines,{clipPath:'inset(0 0% 0 0)',ease:'power3.out',stagger:.25,scrollTrigger:{trigger:root,start:'top 80%',end:'center center',scrub:.8}});
}
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 →