diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 4ac2788..c86cea2 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -74,6 +74,7 @@ let cx = w / 2; let cy = h / 2 + 10; + let scaleFactor = Math.min(1, w / 1024); const color = '#e8654a'; // ── VIS: Bar Chart ── @@ -170,14 +171,20 @@ for (let b = 0; b < bars.length; b++) { const bar = bars[b]; const bh = -bar.dTopY; - const barX = cx + bar.dx; + const barX = cx + bar.dx * scaleFactor; const barTopY = cy + bar.dTopY; const breathe = organicNoise(idleTime * bar.speed, bar.phaseOffset) * 0.5 + 0.5; const targetAlpha = 0.4 + breathe * 0.25; const drift = organicNoise(idleTime * bar.speed * 0.8, bar.phaseOffset) * 10; ctx.globalAlpha = targetAlpha * barsProgress; ctx.fillStyle = color; - drawRoundedBar(barX - barW / 2, barTopY + drift, barW, bh - drift, 5); + drawRoundedBar( + barX - (barW * scaleFactor) / 2, + barTopY + drift, + barW * scaleFactor, + bh - drift, + 5 * scaleFactor + ); } if (nodes.length > 0) { @@ -192,10 +199,10 @@ const driftX = organicNoise(idleTime * node.speed * 0.5, node.phaseOffset) * 5; const driftY = organicNoise(idleTime * node.speed * 0.6, node.phaseOffset * 1.3) * 5; - cNode.x = cx + node.dx + driftX; + cNode.x = cx + node.dx * scaleFactor + driftX; cNode.y = cy + node.dy + driftY; cNode.alpha = nAlpha; - cNode.radius = 5 + nBreathe * 1.5; + cNode.radius = (5 + nBreathe * 1.5) * Math.max(0.6, scaleFactor); } for (const edge of netEdges) { @@ -243,6 +250,7 @@ h = rect.height; cx = w / 2; cy = h / 2 + 10; + scaleFactor = Math.min(1, w / 1024); }); resizeObserver.observe(canvas); } @@ -267,7 +275,7 @@ > -