Lens Zoom
A round magnifier that glides over a floor plan and makes the small dimensions and room names readable. The lens shows a vector copy, so everything stays razor sharp. Works with mouse, touch and arrow keys.
Beweeg over de plattegrond. Oranje stippen zijn stopcontacten.
How to use it
- Paste the HTML where the components 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.
<!-- Lens Zoom · © 2026 NedDev BV · NedDev Lab-licentie (gratis gebruik, niet doorverkopen) · neddev.com/nl/lab/gebruik/#licentie -->
<div class="jouw-container">
<div class="h3lz">
<div class="h3lz-vlak" tabindex="0" role="img" aria-label="Plattegrond begane grond met vergrootglas. Gebruik de pijltjestoetsen om de lens te verplaatsen.">
<svg class="h3lz-plan" viewBox="0 0 800 480" aria-hidden="true">
<rect x="0" y="0" width="800" height="480" fill="#ffffff"/>
<g fill="none" stroke="#1d1d1d" stroke-width="8" stroke-linejoin="square">
<path d="M60 50H740V430H60Z"/>
<path d="M330 50V250M330 300V430M60 250H260M300 250H470M520 250H740M560 50V130M560 175V250M470 250V430M600 250V330M600 370V430"/>
</g>
<g fill="none" stroke="#1d1d1d" stroke-width="1.5">
<path d="M260 250A40 40 0 0 1 300 290"/><path d="M330 300A40 40 0 0 0 370 260"/><path d="M470 250A50 50 0 0 0 520 300"/>
<path d="M560 130A45 45 0 0 1 605 175"/><path d="M600 330A40 40 0 0 1 640 370"/>
</g>
<g fill="#bfe0f2" stroke="#1d1d1d" stroke-width="1.2"><rect x="110" y="46" width="150" height="8"/><rect x="390" y="46" width="120" height="8"/><rect x="56" y="300" width="8" height="90"/><rect x="736" y="100" width="8" height="90"/><rect x="620" y="426" width="90" height="8"/></g>
<g fill="none" stroke="#9a9a9a" stroke-width="1"><rect x="600" y="70" width="120" height="44" rx="4"/><circle cx="700" cy="215" r="14"/><rect x="630" y="265" width="90" height="40" rx="18"/><rect x="360" y="70" width="180" height="26"/><rect x="110" y="140" width="150" height="62" rx="6"/><rect x="500" y="300" width="70" height="110"/><path d="M500 318h70M500 336h70M500 354h70M500 372h70M500 390h70"/></g>
<g font-family="Switzer, sans-serif" fill="#1d1d1d">
<text x="195" y="115" font-size="15" font-weight="600" text-anchor="middle">Woonkamer</text>
<text x="195" y="130" font-size="7.5" text-anchor="middle" fill="#555">6,40 × 4,90 m · 31,4 m²</text>
<text x="185" y="225" font-size="6" text-anchor="middle" fill="#777">bank 2,40 m</text>
<text x="445" y="135" font-size="15" font-weight="600" text-anchor="middle">Keuken</text>
<text x="445" y="150" font-size="7.5" text-anchor="middle" fill="#555">5,20 × 4,90 m · 25,5 m²</text>
<text x="450" y="86" font-size="6" text-anchor="middle" fill="#777">werkblad 3,60 m · afzuiging op dak</text>
<text x="650" y="150" font-size="12" font-weight="600" text-anchor="middle">Badkamer</text>
<text x="650" y="163" font-size="7" text-anchor="middle" fill="#555">2,80 × 2,00 m</text>
<text x="660" y="94" font-size="6" text-anchor="middle" fill="#777">inloopdouche 1,20 m</text>
<text x="655" y="235" font-size="6" text-anchor="middle" fill="#777">vloerverwarming</text>
<text x="195" y="330" font-size="13" font-weight="600" text-anchor="middle">Slaapkamer</text>
<text x="195" y="344" font-size="7" text-anchor="middle" fill="#555">4,50 × 3,60 m · 16,2 m²</text>
<text x="195" y="395" font-size="6" text-anchor="middle" fill="#777">inbouwkast 2,10 m</text>
<text x="400" y="355" font-size="12" font-weight="600" text-anchor="middle">Hal</text>
<text x="400" y="368" font-size="7" text-anchor="middle" fill="#555">2,40 × 3,60 m</text>
<text x="535" y="292" font-size="6" text-anchor="middle" fill="#777">trap 14 treden</text>
<text x="670" y="350" font-size="11" font-weight="600" text-anchor="middle">Berging</text>
<text x="670" y="362" font-size="6.5" text-anchor="middle" fill="#555">2,60 × 1,80 m</text>
<text x="675" y="290" font-size="6" text-anchor="middle" fill="#777">cv-ketel en meterkast</text>
<text x="400" y="472" font-size="7" text-anchor="middle" fill="#777">voordeur, drempel 2 cm</text>
</g>
<g fill="#d8532b"><circle cx="76" cy="160" r="2.5"/><circle cx="314" cy="90" r="2.5"/><circle cx="544" cy="220" r="2.5"/><circle cx="76" cy="410" r="2.5"/><circle cx="314" cy="410" r="2.5"/></g>
</svg>
<div class="h3lz-lens" aria-hidden="true"></div>
</div>
<p class="h3lz-hint">Beweeg over de plattegrond. Oranje stippen zijn stopcontacten.</p>
</div>
</div>/* Lens Zoom · © 2026 NedDev BV · NedDev Lab-licentie (gratis gebruik, niet doorverkopen) · neddev.com/nl/lab/gebruik/#licentie */
/* fonts (Fontshare): switzer@400,500,600 */
.h3lz{width:100%;height:100%;min-height:220px;box-sizing:border-box;display:flex;flex-direction:column;gap:8px;padding:clamp(10px,2.4vw,22px);background:#dfe3e6;font-family:Switzer,sans-serif}
.h3lz-vlak{position:relative;flex:1 1 auto;min-height:0;border-radius:4px;overflow:hidden;background:#fff;cursor:none;touch-action:none;outline:none}
.h3lz-vlak:focus-visible{box-shadow:0 0 0 2px #d8532b}
.h3lz-plan{position:absolute;inset:0;width:100%;height:100%;display:block}
.h3lz-lens{position:absolute;left:0;top:0;width:var(--h3lz-d,150px);height:var(--h3lz-d,150px);border-radius:50%;overflow:hidden;background:#fff;border:2px solid #1d1d1d;box-shadow:0 12px 30px -12px rgba(0,0,0,.55),inset 0 0 0 4px rgba(255,255,255,.8);opacity:0;transform:scale(.6);transition:opacity .2s ease,transform .25s cubic-bezier(.3,1.3,.5,1);pointer-events:none;will-change:left,top}
.h3lz-lens.is-aan{opacity:1;transform:none}
.h3lz-lens svg{position:absolute;left:0;top:0;display:block}
.h3lz-hint{margin:0;font:400 13px/1.3 Switzer,sans-serif;color:#555}
@media (prefers-reduced-motion:reduce){.h3lz-lens{transition:none}}// Lens Zoom · © 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 vlak = root.querySelector('.h3lz-vlak'), plan = root.querySelector('.h3lz-plan'), lens = root.querySelector('.h3lz-lens');
var kopie = plan.cloneNode(true); kopie.removeAttribute('class'); lens.appendChild(kopie);
var VB = { w: 800, h: 480 }, Z = 3, pos = null;
function geo() {
var w = vlak.clientWidth, h = vlak.clientHeight, s = Math.min(w / VB.w, h / VB.h);
return { w: w, h: h, s: s, ox: (w - VB.w * s) / 2, oy: (h - VB.h * s) / 2 };
}
function teken() {
if (!pos) return;
var g = geo(), d = Math.round(Math.max(110, Math.min(190, g.h * 0.55)));
vlak.style.setProperty('--h3lz-d', d + 'px');
pos.x = Math.max(g.ox, Math.min(g.ox + VB.w * g.s, pos.x)); pos.y = Math.max(g.oy, Math.min(g.oy + VB.h * g.s, pos.y));
var zs = g.s * Z;
kopie.setAttribute('width', VB.w * zs); kopie.setAttribute('height', VB.h * zs);
kopie.style.transform = 'translate(' + (d / 2 - (pos.x - g.ox) * Z) + 'px,' + (d / 2 - (pos.y - g.oy) * Z) + 'px)';
lens.style.left = (pos.x - d / 2) + 'px'; lens.style.top = (pos.y - d / 2) + 'px';
}
function uitPointer(e) { var r = vlak.getBoundingClientRect(); pos = { x: e.clientX - r.left, y: e.clientY - r.top }; lens.classList.add('is-aan'); teken(); }
vlak.addEventListener('pointermove', function (e) { if (e.pointerType === 'mouse' || e.buttons) uitPointer(e); });
vlak.addEventListener('pointerdown', function (e) { uitPointer(e); if (e.pointerType !== 'mouse') vlak.setPointerCapture(e.pointerId); });
vlak.addEventListener('pointerleave', function (e) { if (e.pointerType === 'mouse' && document.activeElement !== vlak) lens.classList.remove('is-aan'); });
vlak.addEventListener('pointerup', function (e) { if (e.pointerType !== 'mouse') setTimeout(function () { lens.classList.remove('is-aan'); }, 900); });
vlak.addEventListener('focus', function () { if (!pos) { var g = geo(); pos = { x: g.w / 2, y: g.h / 2 }; } lens.classList.add('is-aan'); teken(); });
vlak.addEventListener('blur', function () { lens.classList.remove('is-aan'); });
vlak.addEventListener('keydown', function (e) {
var st = e.shiftKey ? 40 : 14, m = { ArrowLeft: [-st, 0], ArrowRight: [st, 0], ArrowUp: [0, -st], ArrowDown: [0, st] }[e.key];
if (!m) return; e.preventDefault();
if (!pos) { var g = geo(); pos = { x: g.w / 2, y: g.h / 2 }; }
pos.x += m[0]; pos.y += m[1]; lens.classList.add('is-aan'); teken();
});
if (window.ResizeObserver) new ResizeObserver(teken).observe(vlak);
}
init(document.querySelector('.jouw-container'));
More components
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 →