From dd4021fc43c56a82b0f53ce5657b1e17cf37f18d Mon Sep 17 00:00:00 2001 From: tisachi Date: Tue, 20 Oct 2026 02:26:10 +0200 Subject: [PATCH] Web: wykres tla slownika widoczny - pelna wysokosc sekcji, punkty i wyrazistsza linia --- web/src/sections/Concepts.tsx | 44 ++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/web/src/sections/Concepts.tsx b/web/src/sections/Concepts.tsx index a222d8f..8d9af76 100644 --- a/web/src/sections/Concepts.tsx +++ b/web/src/sections/Concepts.tsx @@ -13,8 +13,9 @@ import { StreakDots } from '../components/StreakDots'; import { cn } from '../lib/utils'; import { Section, SectionHeading } from './shared'; -// Wykres w tle sekcji — rysowany od lewej do prawej w rytm scrolla. -const CHART_PATH = 'M0,150 L130,118 L250,134 L380,86 L510,112 L650,58 L780,92 L900,44 L1000,66'; +// Wykres w tle sekcji — opada od lewej do prawej przez całą wysokość; +// rysowany od lewej krawędzi okna w rytm scrolla (dashoffset + clip). +const CHART_PATH = 'M0,40 L140,110 L300,220 L470,340 L640,470 L810,560 L1000,620'; function ChartBackdrop() { const wrapRef = useRef(null); @@ -40,7 +41,8 @@ function ChartBackdrop() { const update = () => { const r = wrap.getBoundingClientRect(); const vh = window.innerHeight; - const p = reduce ? 1 : Math.min(Math.max((vh - r.top) / (r.height + vh * 0.75), 0), 1); + // p=0 gdy nagłówek sekcji wjeżdża, p=1 gdy jej dół opuszcza widok + const p = reduce ? 1 : Math.min(Math.max((vh * 0.9 - r.top) / (r.height * 0.9), 0), 1); line.style.strokeDashoffset = String(len * (1 - p)); clip.setAttribute('width', String(p * 1000)); }; @@ -61,33 +63,53 @@ function ChartBackdrop() { return ( );