"use client"; import { useEffect, useRef, useState } from "react"; import { motion, useInView } from "framer-motion"; import { Container } from "@/components/ui/Container"; import { Reveal } from "@/components/ui/Reveal"; import { EASE_OUT, VIEWPORT } from "@/lib/motion"; import { usePrefersReducedMotion } from "@/lib/useReducedMotion"; const TARGET = 3482; export function Problem() { return ( You're saving everything. Remembering nothing. Every save is a promise to your future self. Most of them become a graveyard you never walk back through. ); } function StatCard() { const ref = useRef(null); const inView = useInView(ref, VIEWPORT); const reduced = usePrefersReducedMotion(); const [count, setCount] = useState(reduced ? TARGET : 0); useEffect(() => { if (reduced || !inView) return; let raf = 0; const start = performance.now(); const dur = 1400; const tick = (now: number) => { const t = Math.min(1, (now - start) / dur); // ease-out const eased = 1 - Math.pow(1 - t, 4); setCount(Math.round(eased * TARGET)); if (t < 1) raf = requestAnimationFrame(tick); }; raf = requestAnimationFrame(tick); return () => cancelAnimationFrame(raf); }, [inView, reduced]); return ( Saved {count.toLocaleString("en-US")} Last opened Never ); }
Every save is a promise to your future self. Most of them become a graveyard you never walk back through.