diff --git a/projects/script.js b/projects/script.js index 41903eb..bba15a0 100644 --- a/projects/script.js +++ b/projects/script.js @@ -112,5 +112,7 @@ document.querySelectorAll('.node').forEach(node => { }); // ─── Initial draw ───────────────────────────────────────────── -// Wait two frames so the browser has laid out the divs -requestAnimationFrame(() => requestAnimationFrame(redraw)); +window.addEventListener('load', redraw); + +// also redraws if anything inside the scene changes size +new ResizeObserver(redraw).observe(scene);