Countdown Ring
A ring drains over thirty seconds of real elapsed time, with the remaining seconds in the middle. One click refills it. For a held reservation or a time slot.
Uw tafel om 19.30 uur blijft nog even voor u vast.
How to use it
- Paste the HTML where the numbers & charts 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.
<!-- Countdown Ring · © 2026 NedDev BV · NedDev Lab-licentie (gratis gebruik, niet doorverkopen) · neddev.com/nl/lab/gebruik/#licentie -->
<div class="jouw-container">
<div class="ncr">
<button class="ncr__knop" type="button" aria-label="Aftelling opnieuw starten">
<svg class="ncr__svg" viewBox="0 0 120 120" aria-hidden="true"><circle class="ncr__spoor" cx="60" cy="60" r="52"/><circle class="ncr__rest" cx="60" cy="60" r="52"/></svg>
<span class="ncr__midden"><span class="ncr__getal">30</span><span class="ncr__eenheid">seconden</span></span>
</button>
<p class="ncr__regel">Uw tafel om 19.30 uur blijft nog even voor u vast.</p>
<p class="ncr__sr" aria-live="polite"></p>
</div>
</div>/* Countdown Ring · © 2026 NedDev BV · NedDev Lab-licentie (gratis gebruik, niet doorverkopen) · neddev.com/nl/lab/gebruik/#licentie */
.ncr{display:flex;flex-direction:column;align-items:center;gap:12px;font-family:'Switzer',sans-serif;color:#0a0a0a;padding:0 20px;text-align:center}
.ncr__knop{position:relative;width:min(150px,42vw);aspect-ratio:1;padding:0;border:0;background:none;cursor:pointer;border-radius:4px;color:inherit;font:inherit}
.ncr__knop:focus-visible{outline:2px solid #F5480F;outline-offset:4px}
.ncr__svg{display:block;width:100%;height:100%;transform:rotate(-90deg)}
.ncr__spoor{fill:none;stroke:#dedad3;stroke-width:9}
.ncr__rest{fill:none;stroke:#F5480F;stroke-width:9;stroke-linecap:round}
.ncr.is-op .ncr__rest{stroke:transparent}
.ncr__midden{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px}
.ncr__getal{font-weight:700;font-size:44px;line-height:1;font-variant-numeric:tabular-nums;letter-spacing:-.02em}
.ncr__eenheid{font-size:13px;color:#5b5750}
.ncr__knop:hover .ncr__eenheid{color:#0a0a0a}
.ncr__regel{margin:0;font-size:14px;color:#5b5750;max-width:30ch}
.ncr__sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;margin:0}// Countdown Ring · © 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('.ncr'); if (!w) return;
var knop = w.querySelector('.ncr__knop'), rest = w.querySelector('.ncr__rest'), getal = w.querySelector('.ncr__getal'), eenheid = w.querySelector('.ncr__eenheid'), sr = w.querySelector('.ncr__sr');
var DUUR = 30000, OMTREK = 2 * Math.PI * 52;
var stap = window.matchMedia && matchMedia('(prefers-reduced-motion: reduce)').matches;
var begin = 0, frame = 0, vorige = -1;
rest.style.strokeDasharray = OMTREK.toFixed(2);
function teken(nu) {
var over = Math.max(0, DUUR - (nu - begin));
var sec = Math.ceil(over / 1000);
var deel = stap ? sec * 1000 / DUUR : over / DUUR;
rest.style.strokeDashoffset = (OMTREK * (1 - deel)).toFixed(2);
if (sec !== vorige) {
vorige = sec; getal.textContent = sec;
eenheid.textContent = sec === 0 ? 'klik om te herstarten' : (sec === 1 ? 'seconde' : 'seconden');
}
if (over > 0) frame = requestAnimationFrame(teken);
else { w.classList.add('is-op'); sr.textContent = 'De tijd is om.'; }
}
function start() {
cancelAnimationFrame(frame); w.classList.remove('is-op'); sr.textContent = '';
vorige = -1; begin = performance.now(); frame = requestAnimationFrame(teken);
}
knop.addEventListener('click', start);
start();
}
init(document.querySelector('.jouw-container'));
More numbers & charts
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 →