{"name":"rebuild-screens","entry":"component","title":"RebuildScreens","description":"A phone screen assembled piece by piece, then rebuilt on each new screen that springs onto the pile; Stamp slams a loud word on top.","category":"Motion","capabilities":["replay","player"],"needsRemotion":true,"registryDependencies":["@jbm/motion-hooks","@jbm/pop","@jbm/ui-bits","@jbm/paper"],"install":"npx shadcn@latest add @jbm/rebuild-screens","installName":"rebuild-screens","page":"https://jbm-ui.bns.studio/c/rebuild-screens","registryItem":"https://jbm-ui.bns.studio/r/rebuild-screens.json","sourcePath":"registry/jbm/motion/rebuild-screens.tsx","files":[{"source":"registry/jbm/motion/rebuild-screens.tsx","target":"src/jbm/motion/rebuild-screens.tsx","import":"@/jbm/motion/rebuild-screens","type":"registry:component"}],"endpoints":{"markdown":"https://jbm-ui.bns.studio/catalog/rebuild-screens.md","json":"https://jbm-ui.bns.studio/catalog/rebuild-screens.json"},"snippet":"import { RebuildScreens } from \"@/jbm/motion/rebuild-screens\"\n\n<RebuildScreens w={936} h={1000}\n  pieces={[{ kind: \"button\", at: 1 }, { kind: \"input\", at: 2.8 }, { kind: \"card\", at: 5.3 }]}\n  again={[12.9, 14.5]} sticker={{ text: \"¿otra vez?\", at: 13 }} />","api":[{"export":"RebuildScreens","kind":"component","summary":"Fixed w × h box holding a pile of tilted PhoneFrames. The first screen is present from the start and its pieces (card, input, button, stacked in that order) pop in on their own cues. Each cue in `again` springs in another screen offset up and to the right, whose pieces rebuild in a quick stagger; the pile re-centres as screens arrive. An optional sticker stamps a word near the top left. The input piece's cursor blinks about 2.2 times per second.","props":[{"name":"w","type":"number","required":true,"default":null,"description":"Box width in stage pixels; also caps the phone width at 50% of w."},{"name":"h","type":"number","required":true,"default":null,"description":"Box height in stage pixels; the phone width is also capped at 47% of h (phone height is 1.82 × its width)."},{"name":"pieces","type":"ScreenPiece[]","required":true,"default":null,"description":"Pieces for the first screen: `kind` is button, input, or card and `at` is its entrance in seconds relative to the Sequence. One piece per kind; rendering order is always card, input, button."},{"name":"again","type":"number[]","required":false,"default":"[]","description":"Seconds at which each extra screen arrives; every cue adds one screen whose pieces rebuild starting 0.12 s after it."},{"name":"sticker","type":"{ text: string; at: number }","required":false,"default":null,"description":"Optional loud word: `text` and the `at` second it stamps in over the pile."},{"name":"rebuildStep","type":"number","required":false,"default":"0.22","description":"Seconds between pieces when a new screen rebuilds them, in the order the pieces are listed in `pieces`."},{"name":"phoneScale","type":"number","required":false,"default":"1","description":"Multiplies the default phone width; above 1 it is still limited so the whole pile fits in 90% of the box. Must be positive and finite or it throws."}],"passthrough":[]},{"export":"Stamp","kind":"component","summary":"Absolutely positioned Sticker that slams in from 1.7× to 1× scale on a bouncy spring (damping 9, stiffness 160) and fades in over the first half of the spring. Catalog reuses it.","props":[{"name":"at","type":"number","required":true,"default":null,"description":"Stamp time in seconds relative to the enclosing Sequence."},{"name":"text","type":"string","required":true,"default":null,"description":"The loud word or short phrase; it does not wrap."},{"name":"left","type":"number","required":true,"default":null,"description":"Left offset in stage pixels inside the positioned parent."},{"name":"top","type":"number","required":true,"default":null,"description":"Top offset in stage pixels inside the positioned parent."},{"name":"size","type":"number","required":true,"default":null,"description":"Sticker font size in stage pixels; the sticker's padding and corner radius scale with it."},{"name":"rotate","type":"number","required":false,"default":"-7","description":"Sticker tilt in degrees; negative tilts counter-clockwise."}],"passthrough":[]}],"stage":{"mode":"declared","landscape":{"width":1680,"height":720},"vertical":{"width":936,"height":1000},"basis":"The component is exactly `w` × `h`; w and h are required, so these are the scene-spec `screens` defaults in flow layout: the usable width (1920 − 2 × 120, 1080 − 2 × 72) and h 720 landscape / 1000 vertical (override with the block's `h`). The phone is min(470, 0.5 w, 0.47 h) wide at phoneScale 1: 338 × 615 landscape, 468 × 852 vertical. Tilts and the arrival spring can reach slightly past the box."},"examples":[{"title":"Build, then rebuild twice","code":"import { RebuildScreens } from \"@/jbm/motion/rebuild-screens\"\n\n<RebuildScreens w={936} h={1000}\n  pieces={[{ kind: \"button\", at: 1 }, { kind: \"input\", at: 2.8 }, { kind: \"card\", at: 5.3 }]}\n  again={[12.9, 14.5]} sticker={{ text: \"¿otra vez?\", at: 13 }} />"},{"title":"Stamp a word on any scene","code":"import { Stamp } from \"@/jbm/motion/rebuild-screens\"\n\n<div style={{ position: \"relative\", width: 936, height: 600 }}>\n  <Stamp at={2} text=\"¡listo!\" left={420} top={60} size={96} />\n</div>"}],"qa":["Step to the start (empty first phone), mid-build (some pieces in), the moment each `again` screen arrives (spring from the upper right, pile re-centering), and the end (all screens rebuilt, sticker settled).","Check the rotated phones and sticker stay inside the safe area in both orientations, especially with phoneScale above 1 or three or more screens.","Rebuilt pieces stagger in `pieces` array order while pieces always stack card, input, button; confirm the rebuild order reads as intended. Duplicate kinds share a React key and are not supported.","Confirm the input cursor blink is visible but not distracting at the final render scale."],"related":[{"name":"motion-hooks","relation":"installs"},{"name":"pop","relation":"installs"},{"name":"ui-bits","relation":"installs"},{"name":"paper","relation":"installs"},{"name":"catalog","relation":"installed-by"},{"name":"scene-spec","relation":"installed-by"}],"galleryPreview":{"about":"Cue times are seconds on the gallery preview's timeline, which renders the demo below; the Usage examples may use other timings. Map a cue to your own props by its place in the demo.","fps":30,"durationInFrames":132,"lastFrame":131,"strip":"https://jbm-ui.bns.studio/c/rebuild-screens?view=strip","frames":[{"label":"Begin","frame":0,"at":0},{"label":"First screen built","frame":63,"at":2.1,"note":"Button, input, and card have popped into the first phone; no second screen yet."},{"label":"Built again","frame":93,"at":3.1,"note":"The second screen has sprung in with its pieces rebuilt and the sticker stamped."},{"label":"End","frame":131,"at":4.367}],"demo":[{"component":"RebuildScreens","props":{"w":936,"h":620,"pieces":[{"kind":"button","at":0.2},{"kind":"input","at":0.7},{"kind":"card","at":1.2}],"again":[2.2,3.2],"sticker":{"text":"¿otra vez?","at":2.3}}}],"code":"<RebuildScreens w={936} h={620} pieces={[{ kind: \"button\", at: 0.2 }, { kind: \"input\", at: 0.7 }, { kind: \"card\", at: 1.2 }]} again={[2.2, 3.2]} sticker={{ text: \"¿otra vez?\", at: 2.3 }} />"},"docs":[{"title":"Scene spec guide","url":"https://jbm-ui.bns.studio/docs/scene-spec.md"}],"setup":{"namespace":"@jbm","componentsJson":{"registries":{"@jbm":"https://jbm-ui.bns.studio/r/{name}.json"}},"command":"npx shadcn@latest add @jbm/<name>","target":"src/jbm/","importAlias":"@/jbm/…","tsconfigPaths":{"@/*":["./src/*"]}},"rules":["Install through the @jbm namespace: each registry item JSON (/r/<name>.json) carries its files' contents and each guide is served at /docs/<slug>.md, so agents never need the source repository (it is public on GitHub for people browsing the code).","Files install to src/jbm/ and import as @/jbm/…, which needs the @/* → ./src/* path alias in tsconfig.json.","Items marked needsRemotion require the remotion package and must render inside a Remotion composition or Player; every other item works in any React page.","Use one vermilion accent per composition; accent2 is for annotations only and soft is for dark surfaces only.","Stages are 1920×1080 landscape and 1080×1920 vertical with declared safe areas; each item's stage field declares its size in stage pixels, and scenes compose from YAML-shaped specs with @jbm/scene-spec."],"links":{"catalog":"https://jbm-ui.bns.studio/catalog.json","llms":"https://jbm-ui.bns.studio/llms.txt"}}