diff --git a/web/src/sections/Concepts.tsx b/web/src/sections/Concepts.tsx index c80ffd5..6796d54 100644 --- a/web/src/sections/Concepts.tsx +++ b/web/src/sections/Concepts.tsx @@ -13,25 +13,32 @@ import { StreakDots } from '../components/StreakDots'; import { cn } from '../lib/utils'; import { Section, SectionHeading } from './shared'; -// Wykres w tle sekcji — opada od lewej do prawej przez całą wysokość; -// rysowany od lewej krawędzi okna w rytm scrolla (dashoffset + clip). +// Wykres w tle sekcji — pomarańczowa opada od lewej do prawej, niebieska +// wznosi się od dołu ku górze i nakłada na nią; obie rysowane w rytm scrolla. const CHART_PATH = 'M0,40 L140,110 L300,220 L470,340 L640,470 L810,560 L1000,620'; +const CHART_PATH2 = 'M0,660 L160,585 L330,455 L500,330 L670,215 L840,120 L1000,60'; function ChartBackdrop() { const wrapRef = useRef(null); const lineRef = useRef(null); + const line2Ref = useRef(null); const clipRef = useRef(null); + const clip2Ref = useRef(null); useEffect(() => { const wrap = wrapRef.current; const line = lineRef.current; + const line2 = line2Ref.current; const clip = clipRef.current; - if (!wrap || !line || !clip) return; + const clip2 = clip2Ref.current; + if (!wrap || !line || !line2 || !clip || !clip2) return; // jsdom nie implementuje getTotalLength — bez scrubbingu w testach if (typeof line.getTotalLength !== 'function') return; const len = line.getTotalLength(); line.style.strokeDasharray = String(len); + const len2 = line2.getTotalLength(); + line2.style.strokeDasharray = String(len2); const reduce = typeof window.matchMedia === 'function' && @@ -44,7 +51,9 @@ function ChartBackdrop() { // p=0 gdy nagłówek mija środek widoku, p=1 przy końcu sekcji const p = reduce ? 1 : Math.min(Math.max((vh * 0.4 - r.top) / (r.height * 0.85), 0), 1); line.style.strokeDashoffset = String(len * (1 - p)); + line2.style.strokeDashoffset = String(len2 * (1 - p)); clip.setAttribute('width', String(p * 1000)); + clip2.setAttribute('width', String(p * 1000)); }; const onScroll = () => { cancelAnimationFrame(raf); @@ -76,6 +85,9 @@ function ChartBackdrop() { + + + + + + + + + + + + + + + ); diff --git a/web/src/styles.css b/web/src/styles.css index 84e8ed2..44919c0 100644 --- a/web/src/styles.css +++ b/web/src/styles.css @@ -14,6 +14,7 @@ --accent-dark: #f0542f; --accent-ink: #1c0d06; --accent-text: #ff7e61; + --chart-blue: #5b9dff; --shadow: 0 1px 0 color-mix(in srgb, var(--text) 4%, transparent) inset; --card-grad: linear-gradient(