Lichtreclame met hapering
Een verlicht woord op een donkere muur waarvan één letter op onregelmatige momenten hapert en heel soms het hele bord even dimt, zoals een buis die aan vervanging toe is. Voor een café, bar of avondwinkel.
Open
Bar Kade · keuken tot 22.00
Zo gebruik je het
- Plak de HTML op de plek waar het onderdeel moet komen.
- Zet de CSS in je stylesheet. Alle klassen hebben een eigen voorvoegsel, dus niets botst met je eigen opmaak.
- Voeg de JavaScript toe en roep init() aan met het element waar de HTML in staat.
<!-- Lichtreclame met hapering · © 2026 NedDev BV · NedDev Lab-licentie (gratis gebruik, niet doorverkopen) · neddev.com/nl/lab/gebruik/#licentie -->
<div class="jouw-container">
<div class="h6-nft"><p class="h6-nft__sign" aria-label="Open">Open</p><p class="h6-nft__sub">Bar Kade · keuken tot 22.00</p></div>
</div>/* Lichtreclame met hapering · © 2026 NedDev BV · NedDev Lab-licentie (gratis gebruik, niet doorverkopen) · neddev.com/nl/lab/gebruik/#licentie */
.h6-nft{position:absolute;inset:0;background:radial-gradient(ellipse 60% 55% at 50% 45%,#2a1610 0%,#120d0b 60%,#0b0908 100%);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;font-family:'Switzer',sans-serif;overflow:hidden;transition:background .08s}
.h6-nft.is-dim{background:radial-gradient(ellipse 60% 55% at 50% 45%,#1a110d 0%,#100c0a 60%,#0b0908 100%)}
.h6-nft__sign{margin:0;font-size:clamp(56px,13vw,96px);font-weight:700;letter-spacing:.02em;line-height:1}
.h6-nft__ch{display:inline-block;color:#ffe4d6;text-shadow:0 0 2px #fff1ea,0 0 8px #ff9a6b,0 0 20px rgba(245,72,15,.85),0 0 46px rgba(245,72,15,.45);transition:color .05s,text-shadow .05s}
.h6-nft__ch.is-off,.h6-nft.is-dim .h6-nft__ch{color:#4d2c20;text-shadow:0 0 2px rgba(245,72,15,.15)}
.h6-nft__sub{margin:0;font-size:14px;color:rgba(255,236,226,.6)}
@media (prefers-reduced-motion:reduce){.h6-nft__ch,.h6-nft{transition:none}}// Lichtreclame met hapering · © 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 w=root.querySelector('.h6-nft');if(!w)return;var sign=w.querySelector('.h6-nft__sign');
var txt=sign.textContent;sign.textContent='';var chars=[];
txt.split('').forEach(function(c){var s=document.createElement('span');s.className='h6-nft__ch';s.setAttribute('aria-hidden','true');s.textContent=c;sign.appendChild(s);chars.push(s);});
if(matchMedia('(prefers-reduced-motion: reduce)').matches)return;
var weak=chars[chars.length-2]||chars[0],visible=true,timer=0;
function r(a,b){return a+Math.random()*(b-a);}
function burst(target,cls,left,done){if(left<=0){target.classList.remove(cls);done();return;}
target.classList.toggle(cls);timer=setTimeout(function(){burst(target,cls,left-1,done);},r(35,140));}
function next(){if(!visible){timer=0;return;}
timer=setTimeout(function(){
if(Math.random()<.18)burst(w,'is-dim',2*Math.round(r(1,2)),next);
else burst(weak,'is-off',2*Math.round(r(1,4))+(Math.random()<.25?1:0),function(){
if(weak.classList.contains('is-off'))setTimeout(function(){weak.classList.remove('is-off');next();},r(300,900));else next();});
},r(900,4200));}
if('IntersectionObserver' in window)new IntersectionObserver(function(en){var was=visible;visible=en[0].isIntersecting;if(visible&&!was&&!timer)next();}).observe(w);
next();
}
init(document.querySelector('.jouw-container'));
Meer uit tekstanimaties
Iets gezien dat je mooi vindt?
Zet het in je selectie en stuur hem op. Dan bouwen we je site eromheen, in jouw huisstijl.
Neem contact op →