Cómo funciona
Una figura de libro de texto para la cinemática. Una figura plana tiene dos articulaciones: la cabeza se inclina hasta 45° y el brazo se levanta hasta 135°. Arrastra cualquiera de ellas y empieza una grabación que toma muestras de los dos ángulos en cada fotograma. Las dos curvas comparten el eje de tiempo; al reproducir, un cursor las recorre mientras la figura repite el movimiento, y cada curva indica el ángulo y la velocidad angular, que es su pendiente.
Úsalo para
- Teach position–time graphs: a flat stretch means rest, a steep one means fast motion, and the slope is the speed.
- Compare two movements on one time axis to see their order and overlap.
Busca otra opción cuando
- For measured data from sensors or video, use a chart of that data: this figure records only what is moved on screen.
Uso
import React, { useState } from 'react'
import { PuppetTake } from './PuppetTake.jsx'
export function MotionLesson() {
const [take, setTake] = useState(null)
return <PuppetTake value={take} onChange={(next) => setTake(next)} maxSeconds={8} />
}Propiedades
| Propiedad | Tipo | Por defecto | Qué hace |
|---|---|---|---|
value | { duration: number, samples: Array<{ t, head, arm }> } | null | — | Controlled recording: its length in seconds and the samples, each a time in seconds with the head angle (0–45°) and the arm angle (0–135°). null shows no recording. |
defaultValue | { duration, samples } | null | a nod, then an arm lift, 5 s | Starting recording when uncontrolled; Reset returns to it. |
onChange | (take, { reason }) => void | — | Called when a recording stops (reason 'record') or Reset is pressed (reason 'reset'). |
defaultTime | number | half the recording | Where the playhead starts, in seconds, and where Reset puts it. After a new recording it stands at the end. |
maxSeconds | number | 6 | Longest recording, in seconds (1–60); it is also the length of the time axis. |
labels | object | — | Replaces any built-in text: title, formula, head, arm, figure, help, traces, record, stop, play, pause, reset, readout, recording, empty, seconds, degrees and speed ('{n}'), started, recorded and paused ('{n}'), playing and restored. |
locale | string | 'en' | Language tag for the numbers. |
className | string | — | Extra class on the card, for example to set its width (30rem by default, never wider than its container). |
Accesibilidad
- The head and the hand are sliders with their angle as the value. Arrow keys turn them by 5° (Shift or Page keys by 15°), Home and End go to the ends of the range. The first key starts a recording and Enter on a joint stops it; while recording, the joint follows the keys at 150° per second so the trace has a real slope.
- The traces are a slider for the playhead: arrows move it by 0.1 s (Shift by 0.5 s), Home and End go to the start and the end.
- Record and Replay are buttons whose names change to Stop and Pause while active. A polite status announces when a recording starts and stops and where replay paused.
- Joints use pointer capture and touch-action none; the traces allow vertical scrolling and scrub with a horizontal drag.
Movimiento
Recording and replay run in real time, because the timing is the content. Under keyboard control the joints glide at 150° per second. With reduced motion there are no transitions and the record mark does not pulse.
Añádelo a tu proyecto
Los miembros Pro copian un prompt y su agente de programación instala el código, igual que con los gratuitos.
PuppetTake.jsxpuppet-take.csstokens.cssREADME.md
Los dos archivos se instalan juntos. La hoja de estilos lee las variables de tokens.css y lleva valores de reserva, así que también funciona sola.







