Motion Lab / Heroes / char reveal / editorial
// Mechanisme: hero-char-reveal-editorial
import gsap from 'https://esm.sh/gsap@3.12.5';
// Pas toe op je eigen selector — geen stijlkeuzes hier.
import gsap from 'https://esm.sh/gsap@3.12.5';
import{ScrollTrigger}from 'https://esm.sh/gsap@3.12.5/ScrollTrigger';
gsap.registerPlugin(ScrollTrigger);
const el=document.querySelector('.char-reveal-target');
if(el){const t=el.textContent.trim();el.innerHTML=[...t].map(c=>c===' '?' ':'<span class="cw" style="display:inline-block;overflow:hidden;vertical-align:bottom"><span class="ci" style="display:inline-block">'+c+'</span></span>').join('');if(window.matchMedia('(prefers-reduced-motion: reduce)').matches)return;
gsap.fromTo(el.querySelectorAll('.ci'),{yPercent:120,autoAlpha:0},{yPercent:0,autoAlpha:1,duration:1.4,stagger:0.09,ease:'power3.out',scrollTrigger:{trigger:el,start:'top 85%',once:true}});} <!-- Skeleton: hero-char-reveal-editorial --> <div class="demo-block"> <!-- DOM-structuur hier --> </div>
/* Styling: hero-char-reveal-editorial */
:root {
--block-bg: ;
--block-fg: ;
--block-accent: ;
}