// app/app.jsx — Fightlytics landing: the fight as the model sees it. const { useEffect: aEffect, useState: aState } = React; const APP_URL = 'https://app-fightlytics.duckdns.org'; // Same-origin: Caddy (deploy/Caddyfile) and dev_server.py forward this one path to the backend. const WAITLIST_URL = '/api/auth/waitlist'; // Umami custom events. Each stored property also counts against the free plan's monthly cap. function track(name, data) { if (window.umami) window.umami.track(name, data); } function Nav() { return ( ); } // Sign-in is invite-only, so the page's call to action is the waitlist. The email never goes to analytics. function WaitlistForm({ from, joined, onJoined }) { const [email, setEmail] = aState(''); const [phase, setPhase] = aState('form'); // form | sending | leaving const [error, setError] = aState(null); const submit = async (e) => { e.preventDefault(); const value = email.trim(); if (!value.includes('@')) { setError('Enter a valid email address.'); e.target.querySelector('input').focus(); return; } setError(null); setPhase('sending'); try { const res = await fetch(WAITLIST_URL, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ email: value }), }); if (res.status === 422) throw new Error('Enter a valid email address.'); if (!res.ok) throw new Error('Something went wrong. Try again in a moment.'); track('waitlist', { from }); if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) { onJoined(value); return; } setPhase('leaving'); setTimeout(() => onJoined(value), 200); // the length of .wl-out } catch (err) { setError(err instanceof TypeError ? 'Something went wrong. Try again in a moment.' : err.message); setPhase('form'); } }; if (joined) { return (

You’re on the list.

We’ll email {joined} when Fightlytics opens to everyone.

); } const sending = phase === 'sending'; return (
setEmail(e.target.value)} disabled={phase !== 'form'} />
{error &&

{error}

}
); } function SignInNote() { return (

Invite-only for now. Already invited?{' '} Sign in

); } const STEPS = [ { mode: 'detect', id: 'how', h: 'Two fighters, 17 points each.', p: 'A pose model finds both fighters in every frame and places 17 keypoints on each. The referee is filtered out.', aside:

Hollow points are joints the pose model was unsure about.

, }, { mode: 'corners', h: 'Red corner, blue corner, every frame.', p: 'Corners are read from glove tape and torso colour, not from which side of the cage a fighter is on.', aside:
RedBlue
, }, { mode: 'strike', h: 'Read 1.2 seconds, name the strike.', p: 'The strike model reads both skeletons across a 1.2 second window, then names the shot and where it was aimed.', aside: (
Type{['jab', 'cross', 'hook', 'uppercut', 'kick', 'knee'].map((w) => {w})}
Target{['head', 'body', 'leg'].map((w) => {w})}
), }, { mode: 'log', h: 'Every strike, one click from its frame.', p: 'Each strike lands on the fight timeline with its fighter and frame number. Click one and the video jumps there.', aside:

Try it: click a row in the log.

, }, ]; function Story({ joined, onJoined }) { const [mode, setMode] = aState('full'); // the layer is worked out from the scroll position each time, so a fast flick or a scroll back to the top // never leaves a stale layer behind aEffect(() => { const els = [...document.querySelectorAll('.story [data-mode]')]; const nav = document.querySelector('.nav'), stage = document.querySelector('.story .stage'); let raf = 0; const pick = () => { raf = 0; // wide: the section that holds the middle of the screen. Narrow: the replay is pinned on top, so the step // whose heading has risen past the middle of the free space below it const narrow = window.matchMedia('(max-width: 899px)').matches; const top = narrow ? nav.offsetHeight + stage.offsetHeight : 0; const line = (top + window.innerHeight) / 2; let m = els[0].dataset.mode; els.forEach((el) => { if ((narrow ? el.firstElementChild : el).getBoundingClientRect().top < line) m = el.dataset.mode; }); setMode(m); }; const onScroll = () => { if (!raf) raf = requestAnimationFrame(pick); }; window.addEventListener('scroll', onScroll, { passive: true }); window.addEventListener('resize', onScroll); // narrow: each step is sized to the screen space left below the pinned replay, so CSS needs the replay's height const ro = new ResizeObserver(() => { document.documentElement.style.setProperty('--pin-h', stage.offsetHeight + 'px'); onScroll(); }); ro.observe(stage); pick(); return () => { cancelAnimationFrame(raf); ro.disconnect(); window.removeEventListener('scroll', onScroll); window.removeEventListener('resize', onScroll); }; }, []); return (

Every strike, analyzed.

Feed it fight video. Fightlytics tracks both fighters, reads the rounds and logs strikes by type, target and fighter.

{!joined && }
{STEPS.map((s) => (

{s.h}

{s.p}

{s.aside}
))}

Real data: 3.7 seconds of one fight, replayed from the pipeline’s pose output. Strikes shown are hand-verified labels.

); } function FightSection() { return (

A whole fight on one line.

Pipeline output for one three-round fight. Rounds come from the broadcast scoreboard, and walkouts, breaks and replays are left out of the count.

Red corner, above the lineBlue corner, belowEach bar: strikes in 10 seconds of the round clock

); } const METHOD = [ ['Label', 'Labellers mark each strike on the frame it happens, with the fighter, type and target.'], ['Verify', 'A QA pass accepts or rejects every label. Only accepted strikes are used for training.'], ['Measure', 'Each new model is scored on hand-labelled fights it never trained on.'], ]; function Method() { return (

Trained only on strikes a person confirmed.

    {METHOD.map(([k, p], i) => (
  1. {k}

    {p}

  2. ))}
); } function Live() { return (
Coming later

Live broadcast feeds.

Today Fightlytics works on recorded fights. A version that runs on a live feed, for broadcasters, is on the way.

); } function Final({ joined, onJoined }) { return (

Every round, strike by strike.

Fightlytics is invite-only while it’s in early access. Join the waitlist and we’ll email you when it opens to everyone.

{!joined && }
); } function Footer() { return ( ); } function App() { // shared, so joining in the hero also shows "on the list" in the final section const [joined, setJoined] = aState(null); aEffect(() => { const io = new IntersectionObserver((es) => es.forEach((e) => { if (e.isIntersecting) { e.target.classList.add('in'); io.unobserve(e.target); } }), { threshold: 0.15 }); document.querySelectorAll('.reveal').forEach((el) => io.observe(el)); // how far down people get; the first section is the pageview itself const seen = new IntersectionObserver((es) => es.forEach((e) => { if (e.isIntersecting) { track('section', { id: e.target.id }); seen.unobserve(e.target); } }), { threshold: 0.5 }); document.querySelectorAll('main > section:not(:first-child)').forEach((el) => seen.observe(el)); const pager = window.createPager(); // the page renders after load, so the browser's own jump to #hash found nothing const target = location.hash && document.getElementById(location.hash.slice(1)); if (target) pager ? pager.goTo(target, true) : target.scrollIntoView({ behavior: 'instant' }); return () => { io.disconnect(); seen.disconnect(); if (pager) pager.destroy(); }; }, []); return ( <> Skip to content