Scroll Layout Formations
As you scroll, nine project photos move from a loose pile into a ring and then into a tidy three by three grid. A striking lead-in to a portfolio or gallery.









StapelScroll in dit vlak
How to use it
- Paste the HTML where the scroll effects 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.
<!-- Scroll Layout Formations · © 2026 NedDev BV · NedDev Lab-licentie (gratis gebruik, niet doorverkopen) · neddev.com/nl/lab/gebruik/#licentie -->
<div class="jouw-container">
<div class="nlf" tabindex="0" aria-label="Negen projectfoto's, scroll om de opstelling te wisselen">
<div class="nlf__lang">
<div class="nlf__pin">
<div class="nlf__veld">
<figure class="nlf__kaart"><img src="https://neddev.com/lab-media/cases-filter-masonry-1.webp" alt="Landelijke keuken" loading="lazy"></figure>
<figure class="nlf__kaart"><img src="https://neddev.com/lab-media/cases-filter-masonry-2.webp" alt="Boekhandel met houten kasten" loading="lazy"></figure>
<figure class="nlf__kaart"><img src="https://neddev.com/lab-media/cases-filter-masonry-3.webp" alt="Trap met laden" loading="lazy"></figure>
<figure class="nlf__kaart"><img src="https://neddev.com/lab-media/cases-filter-masonry-4.webp" alt="Ontvangstbalie in hout" loading="lazy"></figure>
<figure class="nlf__kaart"><img src="https://neddev.com/lab-media/cases-filter-masonry-5.webp" alt="Keuken met kookeiland" loading="lazy"></figure>
<figure class="nlf__kaart"><img src="https://neddev.com/lab-media/cases-filter-masonry-6.webp" alt="Studeerkamer met boekenwand" loading="lazy"></figure>
<figure class="nlf__kaart"><img src="https://neddev.com/lab-media/cases-filter-masonry-7.webp" alt="Bakkerij met broodkasten" loading="lazy"></figure>
<figure class="nlf__kaart"><img src="https://neddev.com/lab-media/cases-filter-masonry-8.webp" alt="Kantoor met werkplekken" loading="lazy"></figure>
<figure class="nlf__kaart"><img src="https://neddev.com/lab-media/hero-projectstrip-4.webp" alt="Groene keuken" loading="lazy"></figure>
</div>
<p class="nlf__stand"><span class="nlf__naam">Stapel</span><span class="nlf__hint">Scroll in dit vlak</span></p>
</div>
</div>
</div>
</div>/* Scroll Layout Formations · © 2026 NedDev BV · NedDev Lab-licentie (gratis gebruik, niet doorverkopen) · neddev.com/nl/lab/gebruik/#licentie */
.nlf{position:absolute;inset:0;overflow-y:auto;overflow-x:hidden;container-type:size;background:#f4f3f1;font-family:'Switzer',sans-serif;color:#0a0a0a;scrollbar-width:none;outline:none}
.nlf::-webkit-scrollbar{display:none}
.nlf:focus-visible{box-shadow:inset 0 0 0 2px #F5480F}
.nlf__lang{height:500cqh}
.nlf__pin{position:sticky;top:0;height:100cqh;overflow:hidden}
.nlf__veld{position:absolute;inset:0 0 9cqh}
.nlf__kaart{position:absolute;left:50%;top:50%;margin:0;width:0;height:0;will-change:transform}
.nlf__kaart img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block;border-radius:4px;box-shadow:0 2px 8px rgba(10,10,10,.16);background:#ddd8d0}
.nlf__stand{position:absolute;left:4cqw;right:4cqw;bottom:2.5cqh;margin:0;display:flex;justify-content:space-between;font-size:13px;color:#5b5750}
.nlf__naam{color:#0a0a0a;font-weight:600}// Scroll Layout Formations · © 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 s = root.querySelector('.nlf'); if (!s) return;
var veld = s.querySelector('.nlf__veld'), naam = s.querySelector('.nlf__naam'), hint = s.querySelector('.nlf__hint');
var kaarten = Array.prototype.slice.call(s.querySelectorAll('.nlf__kaart'));
var n = kaarten.length, maat = { b: 0, h: 0 }, wacht = false;
function klem(v) { return v < 0 ? 0 : v > 1 ? 1 : v; }
function zacht(v) { return v * v * (3 - 2 * v); }
function vormen() {
var W = veld.clientWidth, H = veld.clientHeight;
var kb = Math.min(W * 0.3, H * 0.62 * 1.5), kh = kb / 1.5;
maat = { b: kb, h: kh };
kaarten.forEach(function (k) { k.style.width = kb + 'px'; k.style.height = kh + 'px'; k.style.marginLeft = (-kb / 2) + 'px'; k.style.marginTop = (-kh / 2) + 'px'; });
var gat = Math.max(6, W * 0.012);
var sg = Math.min((W * 0.92 - 2 * gat) / 3 / kb, (H * 0.96 - 2 * gat) / 3 / kh);
var sr = Math.min(0.48, sg * 0.95);
var uit = (kb + kh) * sr * 0.36;
var rx = W / 2 - uit - 10, ry = H / 2 - uit - 6;
return kaarten.map(function (k, i) {
var hoek = (i / n) * Math.PI * 2 - Math.PI / 2;
var kol = i % 3, rij = Math.floor(i / 3);
return {
stapel: { x: Math.sin(i * 2.3) * kb * 0.08, y: Math.cos(i * 1.7) * kh * 0.08, r: (i - 4) * 3.5, s: 1 },
ring: { x: Math.cos(hoek) * rx, y: Math.sin(hoek) * ry, r: hoek * 180 / Math.PI + 90, s: sr },
raster: { x: (kol - 1) * (kb * sg + gat), y: (rij - 1) * (kh * sg + gat), r: 0, s: sg }
};
});
}
var standen = vormen();
function mix(a, b, t) {
var dr = b.r - a.r; while (dr > 180) dr -= 360; while (dr < -180) dr += 360;
return { x: a.x + (b.x - a.x) * t, y: a.y + (b.y - a.y) * t, r: a.r + dr * t, s: a.s + (b.s - a.s) * t };
}
function teken() {
wacht = false;
var max = s.scrollHeight - s.clientHeight;
var p = max > 0 ? klem(s.scrollTop / max) : 0;
var label = p < 0.26 ? 'Stapel' : p < 0.7 ? 'Ring' : 'Raster';
if (naam.textContent !== label) naam.textContent = label;
hint.style.opacity = p > 0.03 ? '0' : '1';
kaarten.forEach(function (k, i) {
var st = standen[i], vertraging = i * 0.02, v;
var t1 = zacht(klem((p - 0.05 - vertraging) / 0.25));
var t2 = zacht(klem((p - 0.56 - vertraging) / 0.25));
v = t2 > 0 ? mix(st.ring, st.raster, t2) : mix(st.stapel, st.ring, t1);
k.style.transform = 'translate3d(' + v.x.toFixed(1) + 'px,' + v.y.toFixed(1) + 'px,0) rotate(' + v.r.toFixed(2) + 'deg) scale(' + v.s.toFixed(4) + ')';
k.style.zIndex = t2 > 0.5 ? i : (t1 > 0.5 ? i : n - i);
});
}
s.addEventListener('scroll', function () { if (!wacht) { wacht = true; requestAnimationFrame(teken); } }, { passive: true });
function opnieuw() { standen = vormen(); teken(); }
if (window.ResizeObserver) new ResizeObserver(opnieuw).observe(s); else window.addEventListener('resize', opnieuw);
teken();
}
init(document.querySelector('.jouw-container'));
More scroll effects
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 →