diff --git a/web/src/App.tsx b/web/src/App.tsx index 454fd51..af9dbd4 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -1,4 +1,5 @@ import { Hero } from './sections/Hero'; +import { Manifest } from './sections/Manifest'; import { Ecosystem } from './sections/Ecosystem'; import { Concepts } from './sections/Concepts'; import { Tracks } from './sections/Tracks'; @@ -17,6 +18,7 @@ export default function App() {
+ diff --git a/web/src/sections/Hero.tsx b/web/src/sections/Hero.tsx index d679681..197eb43 100644 --- a/web/src/sections/Hero.tsx +++ b/web/src/sections/Hero.tsx @@ -36,9 +36,6 @@ export function Hero() { Panel admina -

- bez rejestracji z poziomu tej strony · dane treningowe zostają na Twoim serwerze -

diff --git a/web/src/sections/Manifest.tsx b/web/src/sections/Manifest.tsx new file mode 100644 index 0000000..4d2a11a --- /dev/null +++ b/web/src/sections/Manifest.tsx @@ -0,0 +1,109 @@ +import { useEffect, useRef } from 'react'; +import { Reveal } from '../components/Reveal'; + +/** + * Tło z paralaksą — elementy przesuwają się względem widoku inną prędkością + * (dane `data-parallax` = przeskalowany współczynnik). W reduced-motion statycznie. + */ +function useParallax(rootRef: React.RefObject) { + useEffect(() => { + const root = rootRef.current; + if (!root) return; + if (typeof window.matchMedia === 'function' && window.matchMedia('(prefers-reduced-motion: reduce)').matches) + return; + + const layers = Array.from(root.querySelectorAll('[data-parallax]')); + if (!layers.length) return; + + let raf = 0; + const update = () => { + const rect = root.getBoundingClientRect(); + for (const layer of layers) { + const speed = Number(layer.dataset.parallax) || 0; + const offset = (rect.top + rect.height / 2 - window.innerHeight / 2) * speed; + layer.style.transform = `translate3d(0, ${offset.toFixed(1)}px, 0)`; + } + }; + const onScroll = () => { + cancelAnimationFrame(raf); + raf = requestAnimationFrame(update); + }; + + update(); + window.addEventListener('scroll', onScroll, { passive: true }); + window.addEventListener('resize', onScroll); + return () => { + cancelAnimationFrame(raf); + window.removeEventListener('scroll', onScroll); + window.removeEventListener('resize', onScroll); + }; + }, [rootRef]); +} + +const LINES_A = [ + '$ fitos --run', + 'rdzeń: Express + Prisma + PostgreSQL', + 'plan → dzień → sesja → seria', + 'killstreak: tylko kompletne treningi', +]; + +const LINES_B = [ + 'role: ćwiczący · trener · właściciel · admin', + 'członkostwo = osoba + siłownia + rola', + 'dane: self-hosted, zero chmury', + '$ ./sciezka --twoja', +]; + +/** + * „Man” — czarna wstęga między hero a ekosystemem: o czym jest FitOS, + * z dwuwarstwową paralaksą zapisów terminala w tle. + */ +export function Manifest() { + const rootRef = useRef(null); + useParallax(rootRef); + + return ( +
+ + + + ); +} diff --git a/web/test/landing.test.tsx b/web/test/landing.test.tsx index 2898c16..fc8a7f5 100644 --- a/web/test/landing.test.tsx +++ b/web/test/landing.test.tsx @@ -8,6 +8,7 @@ describe('strona-wizytówka FitOS', () => { expect( screen.getByRole('heading', { level: 1, name: 'Trening, który się dowozi.' }), ).toBeInTheDocument(); + expect(screen.getByText('$ man FitOS')).toBeInTheDocument(); }); it('CTA kierują do aplikacji i panelu admina na domyślnych portach dev', () => {