From 0fc4a746bf702bf13376532e561b226ea69d5877 Mon Sep 17 00:00:00 2001 From: Armin Date: Wed, 8 Jul 2026 19:02:01 +0200 Subject: [PATCH] Make analyzer bar and VU meter gaps dynamic --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index ada7b3d..ee4c17e 100644 --- a/index.html +++ b/index.html @@ -514,7 +514,7 @@ function drawSpectrum() { grad.addColorStop(0.4, '#84a0c6'); grad.addColorStop(1, '#272c42'); const smoothFactor = barDecay; - const gap = 6; + const gap = Math.max(1, Math.floor(w / NUM_BARS * 0.10)); const barW = Math.max(1, Math.floor((w - (NUM_BARS - 1) * gap) / NUM_BARS)); const totalBar = barW + gap; const offset = Math.floor((w - NUM_BARS * totalBar + gap) / 2); @@ -561,7 +561,7 @@ function drawSpectrum() { const gap = 4; const labelW = 12; const segCount = 32; - const segG = 6; + const segG = Math.max(1, Math.floor(vw / segCount * 0.10)); const segW = Math.floor((vw - labelW - (segCount - 1) * segG) / segCount); const totalSegW = segCount * segW + (segCount - 1) * segG; const segLeft = labelW + Math.floor(((vw - labelW) - totalSegW) / 2);