Highlighter Notatie
Hand-drawn marks (highlighter, underline, circle, box) that draw themselves one by one when the paragraph enters view, even across lines. To make the facts a customer should remember stand out in a block of text.
Onderhoud van uw cv-ketel kost € 95 per jaar, inclusief voorrijkosten. Bij een storing staan we binnen vier uur voor de deur, ook op zondag. Installatiebedrijf Verhoef werkt in heel Haaglanden.
How to use it
- Paste the HTML where the text animations 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.
<!-- Highlighter Notatie · © 2026 NedDev BV · NedDev Lab-licentie (gratis gebruik, niet doorverkopen) · neddev.com/nl/lab/gebruik/#licentie -->
<div class="jouw-container">
<div class="hln">
<p class="hln__alinea">Onderhoud van uw cv-ketel kost <span class="hln__m" data-soort="markeer">€ 95 per jaar</span>, <span class="hln__m" data-soort="onder">inclusief voorrijkosten</span>. Bij een storing staan we <span class="hln__m" data-soort="cirkel">binnen vier uur</span> voor de deur, <span class="hln__m" data-soort="kader">ook op zondag</span>. Installatiebedrijf Verhoef werkt in heel Haaglanden.</p>
<svg class="hln__laag" aria-hidden="true"></svg>
<button class="hln__opnieuw" type="button">Opnieuw</button>
</div>
</div>/* Highlighter Notatie · © 2026 NedDev BV · NedDev Lab-licentie (gratis gebruik, niet doorverkopen) · neddev.com/nl/lab/gebruik/#licentie */
.hln{position:relative;width:100%;height:100%;background:#fff;display:flex;align-items:center;justify-content:center;padding:24px 28px 56px;box-sizing:border-box;font-family:Switzer,sans-serif}
.hln__alinea{position:relative;margin:0;max-width:460px;font-size:19px;line-height:1.75;color:#0a0a0a}
.hln__m[data-soort="cirkel"],.hln__m[data-soort="kader"]{white-space:nowrap}
.hln__laag{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;overflow:visible}
.hln__laag .hln__markeer{mix-blend-mode:multiply}
.hln__opnieuw{position:absolute;right:14px;bottom:14px;font:inherit;font-size:14px;font-weight:500;padding:7px 14px;border:1px solid #0a0a0a;border-radius:4px;background:#fff;color:#0a0a0a;cursor:pointer;transition:background-color .15s ease,color .15s ease}
.hln__opnieuw:hover,.hln__opnieuw:focus-visible{background:#0a0a0a;color:#fff;outline:none}
@media (max-width:480px){.hln{padding:18px 20px 56px}.hln__alinea{font-size:16px;line-height:1.7}}// Highlighter Notatie · © 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('.hln'); if(!el) return;
var svg=el.querySelector('.hln__laag'), merken=[].slice.call(el.querySelectorAll('.hln__m'));
var stil=window.matchMedia('(prefers-reduced-motion: reduce)').matches, getoond=false, NS='http://www.w3.org/2000/svg';
function rnd(z){ return function(){ z=(z*16807)%2147483647; return z/2147483647; }; }
function f(n){ return n.toFixed(1); }
function vloeiend(p){ var d='M'+f(p[0][0])+' '+f(p[0][1]); for(var i=1;i<p.length-1;i++){ var mx=(p[i][0]+p[i+1][0])/2, my=(p[i][1]+p[i+1][1])/2; d+=' Q'+f(p[i][0])+' '+f(p[i][1])+' '+f(mx)+' '+f(my); } var l=p[p.length-1]; return d+' L'+f(l[0])+' '+f(l[1]); }
function paden(soort,r,R){
var x0=r.left,x1=r.right,y0=r.top,y1=r.bottom,h=y1-y0,w=x1-x0,j=function(a){ return (R()-0.5)*a; };
if(soort==='markeer') return [{d:'M'+f(x0-3)+' '+f(y0+h*0.55+j(2))+' Q'+f(x0+w/2)+' '+f(y0+h*0.5+j(3))+' '+f(x1+3)+' '+f(y0+h*0.52+j(2)),k:'markeer',breed:h*0.62}];
if(soort==='onder') return [{d:'M'+f(x0-2)+' '+f(y1-2+j(1))+' Q'+f(x0+w*0.45)+' '+f(y1+1.5+j(2))+' '+f(x1+3)+' '+f(y1-3+j(1)),k:'lijn',breed:2.4},{d:'M'+f(x0+w*0.1)+' '+f(y1+2.5)+' Q'+f(x0+w*0.55)+' '+f(y1+4+j(2))+' '+f(x1-w*0.05)+' '+f(y1+1+j(1)),k:'lijn',breed:1.8}];
if(soort==='cirkel'){ var cx=(x0+x1)/2, cy=(y0+y1)/2, rx=w/2+10, ry=h/2+6, pts=[]; for(var a=-2.2;a<=-2.2+Math.PI*2+0.55;a+=0.32){ var s=1+j(0.08); pts.push([cx+Math.cos(a)*rx*s,cy+Math.sin(a)*ry*s]); } return [{d:vloeiend(pts),k:'lijn',breed:2.2}]; }
if(soort==='kader'){ var p=4, hk=[[x0-p+j(2),y0-p+j(2)],[x1+p+j(2),y0-p+j(2)],[x1+p+j(2),y1+p+j(2)],[x0-p+j(2),y1+p+j(2)]]; return [{d:'M'+hk.map(function(q){ return f(q[0])+' '+f(q[1]); }).join(' L')+' L'+f(hk[0][0]+6)+' '+f(hk[0][1]-1),k:'kader',breed:1.6}]; }
return [];
}
function bouw(){
var basis=el.getBoundingClientRect(); svg.innerHTML=''; var lijst=[];
merken.forEach(function(m,mi){
var R=rnd(97+mi*131), rects=[].slice.call(m.getClientRects());
rects.forEach(function(cr){
var r={left:cr.left-basis.left,right:cr.right-basis.left,top:cr.top-basis.top,bottom:cr.bottom-basis.top};
paden(m.getAttribute('data-soort'),r,R).forEach(function(o){
var p=document.createElementNS(NS,'path'); p.setAttribute('d',o.d); p.setAttribute('fill','none');
p.setAttribute('stroke',o.k==='markeer'?'rgba(245,72,15,.32)':(o.k==='kader'?'#0a0a0a':'#F5480F'));
p.setAttribute('stroke-width',o.breed); p.setAttribute('stroke-linecap',o.k==='markeer'?'butt':'round'); p.setAttribute('stroke-linejoin','round');
if(o.k==='markeer') p.setAttribute('class','hln__markeer');
svg.appendChild(p); lijst.push({p:p,m:mi});
});
});
});
lijst.forEach(function(o){ var L=o.p.getTotalLength(); o.p.style.strokeDasharray=L+' '+(L+2); o.p.style.strokeDashoffset=getoond||stil?0:L; o.L=L; });
return lijst;
}
var huidig=[];
function speel(){
getoond=false; huidig=bouw(); if(stil){ getoond=true; return; }
svg.getBoundingClientRect();
huidig.forEach(function(o,i){ o.p.style.transition='stroke-dashoffset .55s cubic-bezier(.5,.1,.3,1) '+(0.15+o.m*0.5+(i%2)*0.12).toFixed(2)+'s'; o.p.style.strokeDashoffset=0; });
getoond=true;
}
el.querySelector('.hln__opnieuw').addEventListener('click',speel);
var wacht; window.addEventListener('resize',function(){ clearTimeout(wacht); wacht=setTimeout(function(){ if(getoond) huidig=bouw(); },120); });
function start(){ if('IntersectionObserver' in window){ var io=new IntersectionObserver(function(es){ if(es[0].isIntersecting){ speel(); io.disconnect(); } },{threshold:0.5}); io.observe(el); } else speel(); }
(document.fonts&&document.fonts.ready?document.fonts.ready:Promise.resolve()).then(start);
}
init(document.querySelector('.jouw-container'));
More text animations
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 →