du design
la vie se créa

(() => { let currentScroll = window.scrollY; let targetScroll = window.scrollY; let ticking = false; function easeOutQuad(t) { return t * (2 - t); } function onScroll(e) { targetScroll += e.deltaY; targetScroll = Math.max(0, Math.min(targetScroll, document.body.scrollHeight - window.innerHeight)); if (!ticking) { window.requestAnimationFrame(updateScroll); ticking = true; } e.preventDefault(); } function updateScroll() { const diff = targetScroll - currentScroll; currentScroll += diff * 0.15; // 0.15 = vitesse / douceur (à ajuster) window.scrollTo(0, currentScroll); if (Math.abs(diff) > 0.5) { window.requestAnimationFrame(updateScroll); } else { ticking = false; } } window.addEventListener('wheel', onScroll, { passive: false }); })();