From 27e294dbc98b5a58c1459662efaaaca2d0645fec Mon Sep 17 00:00:00 2001 From: tisachi Date: Tue, 20 Oct 2026 03:27:28 +0200 Subject: [PATCH] Web: miekkie czolo rysowania wypelnien wykresu - maska feather zamiast twardego ciecia clip --- web/src/sections/Concepts.tsx | 40 ++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/web/src/sections/Concepts.tsx b/web/src/sections/Concepts.tsx index 36bc9ce..ea0dbbc 100644 --- a/web/src/sections/Concepts.tsx +++ b/web/src/sections/Concepts.tsx @@ -24,6 +24,8 @@ function ChartBackdrop() { const line2Ref = useRef(null); const clipRef = useRef(null); const clip2Ref = useRef(null); + const solidRef = useRef(null); + const fadeRef = useRef(null); useEffect(() => { const wrap = wrapRef.current; @@ -31,7 +33,9 @@ function ChartBackdrop() { const line2 = line2Ref.current; const clip = clipRef.current; const clip2 = clip2Ref.current; - if (!wrap || !line || !line2 || !clip || !clip2) return; + const solid = solidRef.current; + const fade = fadeRef.current; + if (!wrap || !line || !line2 || !clip || !clip2 || !solid || !fade) return; // jsdom nie implementuje getTotalLength — bez scrubbingu w testach if (typeof line.getTotalLength !== 'function') return; @@ -57,6 +61,9 @@ function ChartBackdrop() { line2.style.strokeDashoffset = String(len2 * (1 - e)); clip.setAttribute('width', String(e * 1000)); clip2.setAttribute('width', String(e * 1000)); + // pierzystem wypelnien mieknie ~80 jednostek przed czolkiem rysowania + solid.setAttribute('offset', String(Math.max(e - 0.08, 0))); + fade.setAttribute('offset', String(e)); }; const run = () => { @@ -140,6 +147,29 @@ function ChartBackdrop() { + + + + + + + + + @@ -147,7 +177,7 @@ function ChartBackdrop() { - + + + - + + +