- React
- Quark
const on = useSignal(false); <sg.i ext={bindMotion({ mode: 'active', active: on, x: spring(0, { stiffness: 260, damping: 18 }), variants: { active: { x: 184 } }, })} />
$ npm i @quarkhz/react//
Quark.
·
//
−const [n, setN] = useState(0);+const n = useSignal(0);−<span>{n}</span>+<sg.span text={n} />−onClick={() => setN(n + 1)}+onClick={() => n.v++}
//
■
ms//
//
//
const on = useSignal(false); <sg.i ext={bindMotion({ mode: 'active', active: on, x: spring(0, { stiffness: 260, damping: 18 }), variants: { active: { x: 184 } }, })} />
<sg.div ext={bindMotion({ mode: 'progress', progress, opacity: tween(0, { durationMS: 160 }), choreo(root) { // step 2: fades in over 0.3…0.65, then stays root.seg(0.3, 1).motion({ opacity: [[0, 0], [0.5, 1], [1, 1]], }); }, })} />
const x = useSpring(pointerX, { stiffness: 120, damping: 16, }); <sg.i css={{ transform: () => `translateX(${x.v}px)`, }} />
npm i @quarkhz/react-motion//
const [n, setN] = useState(0); <Header> <Logo /> <Nav /> <Badge n={n} /> </Header>
const n = useSignal(0); <Header> <Logo /> <Nav /> <sg.b text={n} /> </Header>
const [q, setQ] = useState(''); const hits = useMemo( () => items.filter(match(q)), [items, q]); <input value={q} onChange={(e) => setQ(e.target.value)} />
const q = useSignal(''); const hits = useComputed( () => items.v.filter(match(q.v))); <sg.input bind={q} />
setOrders((list) => list.map((o) => o.id === id ? { ...o, status } : o));
orders.get(id).status.v = status;
const [x, setX] = useState(0); onPointerMove((e) => setX(e.clientX)); <Card style={{ translate: x }} />
const x = useSpring(pointer.x); <sg.div style={{ translate: x }} />
// · USDT
UQC0AE7dCB4mZEguzF5Wl-5vfvgqnqNgTveMVnubVM-Z7JI4