Add a motion piece
add_motionAdds one ready-made motion piece to the site, like its Ready-made tile in Xodia's Motion panel, in the site's own colours and editable there. Use it before writing motion code by hand: the pieces are vetted (lazy loading, still posters, pause controls, reduced motion, budgets) and Xodia's checks trust them. Attribute pieces (text-reveal, magnetic-button, tilt-card, spotlight-card, number-ticker) take file and line: the element whose opening tag starts on that line gets the Motion panel's attributes, no files or packages. Element pieces (scroll-story, marquee, image-trail, shader-background, hero-3d, product-3d) go next to or inside the element on line (position "before", "after" (default) or "inside"), or with page (a page's address, "/about") at the end of that page; Xodia writes the motion kit's files once (keeping kit files the owner changed) and the exact packages, package.json last (Xodia updates the lockfile). page-transition is site-wide: no place. Heavy pieces (shader-background, hero-3d, product-3d) are one a page, load after the page shows and paint a still picture first. hero-3d is React only; product-3d needs a model, hero-3d may use one: pass its Assets path from list_motion as options.model. The owner uploads the model (.glb or .gltf) in Assets: Xodia compresses it and makes its still picture. Never compress, convert or write a model file yourself. Options per piece: text-reveal: split "words" (default), "lines" or "letters"; stagger ms between parts, 0 to 300. scroll-story: steps 2 to 8 (default 4); side "left" or "right" (default right), where the pinned picture sits. marquee: seconds for one loop, 10 to 120 (default 40); direction "left" (default) or "right"; pauseOnHover true (default) or false. magnetic-button: strength 0.2 to 3 (default 1). tilt-card: strength 0.2 to 3 (default 1). spotlight-card: colour "theme" (default, the site's colours). number-ticker: to (the number, required); from (default 0); prefix and suffix up to 8 characters each; duration ms 300 to 5000. image-trail: images: 3 to 12 picture paths from Assets (required); spacing rem 2 to 16 (default 6). page-transition: style "fade" (default) or "slide"; duration ms 100 to 1000 (default 300). shader-background: shader "mesh-gradient" (default), "grain-gradient", "warp", "swirl" or "dithering"; colours "theme" (default) or 2 to 6 colours; speed 0.25 to 4 (default 0.5); stillOnSlowDevices true (default). hero-3d: shape "blob" (default), "torus-knot", "sphere", "rings" or "model" with model (an Assets path from list_motion); colours "theme" or 2 to 6 colours; autoRotate true (default); speed 0.25 to 4 (default 1); stillOnSlowDevices true (default). product-3d: model (an Assets path from list_motion, required); alt (what the model shows, required); autoRotate true (default); controls true (default, visitors turn and zoom it); ar false (default); stillOnSlowDevices true (default). Saved at once like every edit. Afterwards run run_check kind "typecheck" and kind "design", and take_screenshot of the page with frames, then frames { reducedMotion: true }, then for a heavy piece frames { weakDevice: true }. Refusals say why in plain words and what to do; Xodia AI's Fast mode adds attribute pieces only.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"piece": "<piece>",
"projectId": "<projectId>"
},
"name": "add_motion"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | The page or section file (.tsx, .jsx or .html) with the element, relative to the project root | |
| line | No | The line where the element's opening tag starts, as read_file numbers lines. Attribute pieces go on it; element pieces next to or inside it | |
| page | No | Element pieces: a page's address ("/about") to put it at the end of that page, instead of file and line | |
| piece | Yes | The piece to add: text-reveal (Text reveal), scroll-story (Scroll story), marquee (Moving strip), magnetic-button (Magnetic button), tilt-card (Tilt card), spotlight-card (Spotlight card), number-ticker (Number count), image-trail (Picture trail), page-transition (Page transition), shader-background (Moving background, heavy), hero-3d (3D hero object, heavy), product-3d (Product 3D view, heavy) | |
| branch | No | Optional branch; default the branch the workspace has open | |
| options | No | The piece's settings, defaults filled in (see the tool's description per piece). A 3D model is options.model: its Assets path from list_motion | |
| position | No | Element pieces: "before" or "after" the element (default after), or "inside" it as its last child | |
| projectId | Yes | Project id from list_projects |