Web: czarna wstepna Man z paralaksa miedzy hero a ekosystemem
This commit is contained in:
@@ -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() {
|
||||
<SiteHeader />
|
||||
<main>
|
||||
<Hero />
|
||||
<Manifest />
|
||||
<Ecosystem />
|
||||
<Concepts />
|
||||
<Tracks />
|
||||
|
||||
@@ -36,9 +36,6 @@ export function Hero() {
|
||||
Panel admina
|
||||
</a>
|
||||
</div>
|
||||
<p className="mt-4 font-mono text-[11px] text-dim">
|
||||
bez rejestracji z poziomu tej strony · dane treningowe zostają na Twoim serwerze
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="relative">
|
||||
|
||||
109
web/src/sections/Manifest.tsx
Normal file
109
web/src/sections/Manifest.tsx
Normal file
@@ -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<HTMLDivElement | null>) {
|
||||
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<HTMLElement>('[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<HTMLDivElement>(null);
|
||||
useParallax(rootRef);
|
||||
|
||||
return (
|
||||
<div ref={rootRef} className="relative overflow-hidden border-y border-line bg-terminal">
|
||||
<div
|
||||
aria-hidden="true"
|
||||
className="pointer-events-none absolute inset-x-0 -top-10 left-[4%] flex flex-col gap-1 font-mono text-[13px] leading-7 whitespace-nowrap text-dim/10 select-none"
|
||||
data-parallax="0.28"
|
||||
>
|
||||
{[...LINES_A, ...LINES_A].map((l, i) => (
|
||||
<span key={i}>{l}</span>
|
||||
))}
|
||||
</div>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
className="pointer-events-none absolute inset-x-0 -bottom-10 right-[4%] flex flex-col items-end gap-1 font-mono text-[13px] leading-7 whitespace-nowrap text-dim/10 select-none"
|
||||
data-parallax="-0.18"
|
||||
>
|
||||
{[...LINES_B, ...LINES_B].map((l, i) => (
|
||||
<span key={i}>{l}</span>
|
||||
))}
|
||||
</div>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
className="pointer-events-none absolute inset-0 bg-(image:--ambient)"
|
||||
data-parallax="0.06"
|
||||
/>
|
||||
|
||||
<div className="relative mx-auto w-full max-w-3xl px-5 py-20 text-center sm:py-24">
|
||||
<Reveal>
|
||||
<p className="font-mono text-xs tracking-widest text-accent">$ man FitOS</p>
|
||||
<p className="mt-5 text-2xl leading-snug font-bold text-ink sm:text-[2rem]">
|
||||
Trening to dane: plan, seria, ciężar, pomiar.{' '}
|
||||
<span className="text-accent">
|
||||
FitOS trzyma te dane w jednym systemie — zamiast w szesnastu aplikacjach.
|
||||
</span>
|
||||
</p>
|
||||
<p className="mx-auto mt-5 max-w-xl text-[14.5px] leading-relaxed text-dim">
|
||||
{'Ćwiczący, trener i siłownia pracują na tych samych planach, sesjach i pomiarach — '}
|
||||
{'self-hosted, w Twojej infrastrukturze. Poniżej: rdzeń ekosystemu, słownik pojęć i '}
|
||||
{'ścieżka dla każdej roli.'}
|
||||
</p>
|
||||
</Reveal>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user