Files
zeekayandGitHub ea43c5a975 Type lib, scripts, v2, home and app under strict (#8)
* Type scripts under strict

Playwright's API the checks use is declared in host.ts (the package is
the app repo's); caught errors read through why(). tabs-tree.test waits
for the typed tabsTree.

Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk

* Type the shared components under strict

Window globals (__lenis, __hzHold, google) and the two react-dom calls
are declared in components/*.d.ts, since @types/react-dom is not a
dependency and the lockfile is frozen.

Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk

* Type components/v2 under strict

Props, state, refs and DOM events in the 93 v2 files. A2Motion's easing
tuples are as const. Two real bugs: x-archimedes/MaskLines imported a
NoJs that does not exist, and x-hypatia/PinChapters returned the element
from a ref callback, which React 19 reads as a cleanup. AppSheet no
longer sets aria-label to a JSX label.

Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk

* Type components/home under strict

The race, cost and frontier figures, the plan cards, the repository card
and the product stories take Run, Models and Plan types from lib.

Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk

* Type the hero devices and the app routes under strict

HeroScene and its parts describe hero-scenes.json; the [slug] pages take
params as a Promise, and metadata and viewport carry Next's types.

Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk

* Give the integrations previews their Preview type

Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk

* Use the bench Card type for the closing cards

Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk
2026-11-14 01:34:34 -08:00

33 lines
1.5 KiB
TypeScript

'use client';
/* MaskFig (components/v2, owned by the Models chat). A figure rises once into its own line as it comes into view.
Only Hanzo's value is ever drawn: no count-up and no split-flap, so nothing on screen flashes a number Hanzo did not
print. Reduced motion and JS off show it in place (CSS below and the page's NoScript sheet).
Usage: <b className="my-big-number"><MaskFig>84.4%</MaskFig></b> (delay in seconds for a second figure)
<MaskFig now delay={0.15} dur={0.55}>1M</MaskFig> a first-screen figure rises on load, not on view, and
lands inside the first second */
import type { ReactNode } from 'react';
import { motion } from 'motion/react';
import './MaskFig.css';
const V = { hide: { y: '110%' }, show: { y: 0 } };
interface MaskFigProps {
children?: ReactNode;
delay?: number;
dur?: number;
now?: boolean;
className?: string;
}
export default function MaskFig({ children, delay = 0, dur = 0.9, now = false, className = '' }: MaskFigProps) {
// the mask is what is watched (the moving line inside it is clipped, so it could never count as "in view")
const when = now ? { animate: 'show' } : { whileInView: 'show', viewport: { once: true, amount: 0.5 } };
return (
<motion.span className={'v2-maskfig ' + className} initial="hide" {...when}>
<motion.span className="v2-maskfig-in" variants={V} transition={{ duration: dur, ease: [0.16, 1, 0.3, 1], delay }}>
{children}
</motion.span>
</motion.span>
);
}