greenlight-motion 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -13
- package/cli/index.mjs +1 -1
- package/dist/bundle-inputs.json +16 -0
- package/dist/greenlight-motion-script.mjs +6 -11
- package/dist/greenlight-motion.js +626 -568
- package/dist/greenlight-motion.mjs +57906 -55346
- package/dist/script-inputs.json +2 -1
- package/package.json +1 -1
- package/skill/SKILL.md +14 -21
- package/skill/references/scene-script.md +2 -9
- package/skill/references/video-design.md +65 -0
- package/skill/references/video-projects.md +27 -13
package/README.md
CHANGED
|
@@ -17,16 +17,16 @@ The agent writes the video as data: a `project.json` and its files. The engine t
|
|
|
17
17
|
## Quick start
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
npx greenlight-motion@0.1.
|
|
21
|
-
npx greenlight-motion@0.1.
|
|
20
|
+
npx greenlight-motion@0.1.3 doctor # Node 18+, Chrome or Edge, WebGPU, H.264: what's missing and how to fix it
|
|
21
|
+
npx greenlight-motion@0.1.3 init my-video # a working starter: index.html, project.json, assets/
|
|
22
22
|
# edit my-video/project.json, put pictures / video / sound in my-video/assets/
|
|
23
23
|
# or: write my-video/script.json (a scene script, skill/references/scene-script.md), then
|
|
24
|
-
npx greenlight-motion@0.1.
|
|
25
|
-
npx greenlight-motion@0.1.
|
|
26
|
-
npx greenlight-motion@0.1.
|
|
27
|
-
npx greenlight-motion@0.1.
|
|
28
|
-
npx greenlight-motion@0.1.
|
|
29
|
-
npx greenlight-motion@0.1.
|
|
24
|
+
npx greenlight-motion@0.1.3 script my-video # script.json → project.json with the Video Editor's own presets
|
|
25
|
+
npx greenlight-motion@0.1.3 check my-video # what to fix: missing files, template mistakes, blank frames, broken plugins
|
|
26
|
+
npx greenlight-motion@0.1.3 stills my-video # frames + a labelled contact sheet, to look at
|
|
27
|
+
npx greenlight-motion@0.1.3 render my-video --fps 60 --motion-blur
|
|
28
|
+
npx greenlight-motion@0.1.3 pack my-video # everything in ONE html file
|
|
29
|
+
npx greenlight-motion@0.1.3 pack my-video --glvideo # ONE .glvideo: double-clicked, it opens in GreenLight Dash
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
Also: `trace` (every animated layer's values frame by frame, plus the layer's moments), `set key=value`
|
|
@@ -72,16 +72,21 @@ The engine is one classic script, so it runs from a double-clicked file, a CDN o
|
|
|
72
72
|
|
|
73
73
|
```html
|
|
74
74
|
<div id="app"></div>
|
|
75
|
-
<script src="https://cdn.jsdelivr.net/npm/greenlight-motion@0.1.
|
|
75
|
+
<script src="https://cdn.jsdelivr.net/npm/greenlight-motion@0.1.3/dist/greenlight-motion.js"></script>
|
|
76
76
|
<script>
|
|
77
|
-
GreenLightMotion.
|
|
77
|
+
GreenLightMotion.mountStudio(document.getElementById('app'), {
|
|
78
78
|
project: { /* project.json */ },
|
|
79
79
|
assets: { 'asset:photo.jpg': 'data:image/jpeg;base64,…' }, // ref → data: / blob: / https: URL or Blob
|
|
80
|
-
theme: 'auto', // 'dark' (default) | 'light' | 'auto'
|
|
81
80
|
});
|
|
82
81
|
</script>
|
|
83
82
|
```
|
|
84
83
|
|
|
84
|
+
`mountStudio` is the page every GreenLight surface shows (a project folder's page, a chat's GreenLight Motion page, a
|
|
85
|
+
shared link, a review card on a board): the preview with Edit · Notes · Highlight, the inspector, the layers and Render.
|
|
86
|
+
Its review (notes with drawings, highlights, changes) is text to copy for your agent; a host can send it elsewhere
|
|
87
|
+
(`config.save`). `GreenLightMotion.mountPage(el, { project, assets, theme })` is the plain page under it, without the
|
|
88
|
+
review interface.
|
|
89
|
+
|
|
85
90
|
Without the page UI (in the browser, through a bundler or the ESM build; Node runs only the CLI):
|
|
86
91
|
|
|
87
92
|
```js
|
|
@@ -104,8 +109,8 @@ artifact's `downloads` capability.
|
|
|
104
109
|
## GreenLight Dash
|
|
105
110
|
|
|
106
111
|
A project made here opens in the desktop editor for full editing: the page's **Open in GreenLight
|
|
107
|
-
Dash** imports it as a new project. The editor's **Export for agents** works the other way
|
|
108
|
-
|
|
112
|
+
Dash** imports it as a new project. The editor's **Export for agents** works the other way: one
|
|
113
|
+
`.glvideo` file to open in a Claude chat, or a ready folder with this page for an agent. MotionFast templates and effect packages with their own image or video files
|
|
109
114
|
play in GreenLight Dash only. The page shows such layers but leaves them out.
|
|
110
115
|
|
|
111
116
|
## License
|
package/cli/index.mjs
CHANGED
|
@@ -114,7 +114,7 @@ const indexHtml = (title) => `<!doctype html>
|
|
|
114
114
|
<script src="greenlight-motion.js"></script>
|
|
115
115
|
<script src="project.js"></script>
|
|
116
116
|
<script src="assets.js"></script>
|
|
117
|
-
<script>GreenLightMotion.
|
|
117
|
+
<script>GreenLightMotion.mountStudio(document.getElementById('app'), { project: window.GL_PROJECT, assets: window.GL_ASSETS });</script>
|
|
118
118
|
`;
|
|
119
119
|
// JSON inside a <script>: no "</script", no "<!--" (both escapes stay valid JSON and JS, so the app can read a page back)
|
|
120
120
|
const scriptSafe = (s) => s.replace(/<\/(script)/gi, '<\\/$1').replace(/<!--/g, '<\\u0021--');
|
package/dist/bundle-inputs.json
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"frontend/src/components/mockupGenerator/backgroundSelector.css",
|
|
16
16
|
"frontend/src/components/mockupGenerator/screenTexture.js",
|
|
17
17
|
"frontend/src/components/model3dFallback.jsx",
|
|
18
|
+
"frontend/src/components/sketch/sketchEngine.js",
|
|
18
19
|
"frontend/src/components/videoEditor/DirectionPad.jsx",
|
|
19
20
|
"frontend/src/components/videoEditor/Fields.jsx",
|
|
20
21
|
"frontend/src/components/videoEditor/KeyframePresetModal.jsx",
|
|
@@ -324,6 +325,21 @@
|
|
|
324
325
|
"frontend/src/motionEngine/soundCues.js",
|
|
325
326
|
"frontend/src/motionEngine/soundLibrary.js",
|
|
326
327
|
"frontend/src/motionEngine/stubs/motionTemplatesRegistry.js",
|
|
328
|
+
"frontend/src/motionEngine/studio/color.css",
|
|
329
|
+
"frontend/src/motionEngine/studio/color.js",
|
|
330
|
+
"frontend/src/motionEngine/studio/focus.css",
|
|
331
|
+
"frontend/src/motionEngine/studio/gizmo.js",
|
|
332
|
+
"frontend/src/motionEngine/studio/highlight.css",
|
|
333
|
+
"frontend/src/motionEngine/studio/highlight.js",
|
|
334
|
+
"frontend/src/motionEngine/studio/index.js",
|
|
335
|
+
"frontend/src/motionEngine/studio/inspector.js",
|
|
336
|
+
"frontend/src/motionEngine/studio/lab.css",
|
|
337
|
+
"frontend/src/motionEngine/studio/lab.js",
|
|
338
|
+
"frontend/src/motionEngine/studio/navigator.css",
|
|
339
|
+
"frontend/src/motionEngine/studio/notes.css",
|
|
340
|
+
"frontend/src/motionEngine/studio/notes.js",
|
|
341
|
+
"frontend/src/motionEngine/studio/review.css",
|
|
342
|
+
"frontend/src/motionEngine/studio/review.js",
|
|
327
343
|
"frontend/src/motionEngine/template.js",
|
|
328
344
|
"frontend/src/motionEngine/trace.js",
|
|
329
345
|
"frontend/src/motionEngine/useReview.js",
|
|
@@ -16591,6 +16591,11 @@ function compileScript(script, caps, files = /* @__PURE__ */ new Map()) {
|
|
|
16591
16591
|
|
|
16592
16592
|
// src/motionEngine/sceneScriptGuide.js
|
|
16593
16593
|
init_define_import_meta_env();
|
|
16594
|
+
|
|
16595
|
+
// ../skills/greenlight-dash/references/video-design.md
|
|
16596
|
+
var video_design_default = "# Motion design that looks made, not generated\n\nWhat makes a video read as designed rather than generated. The rules hold however the video is built \u2014 a project\nthrough the app's API, `project.json` with the engine's CLI, or a scene script \u2014 so read them before the first version\nand check every version against them.\n\n## Story and words\n\n- **One idea per scene**: 3\u20136 scenes of 2\u20133 s for a short video. A scene that says two things says neither.\n- **At most ~8 words on screen at once, held at least 1 s.** People read about 3 words a second; text that leaves\n before it is read is noise.\n- **9:16**: bigger text, stacked vertically, everything in the middle 80 %.\n\n## Hierarchy\n\n- One headline per scene; supporting text much smaller. Hierarchy comes from size and weight, not colour alone.\n- One accent colour and strong contrast.\n- Keep text inside the middle 80 % of the frame (in a project: |panX| and |panY| \u2264 40): players and feeds crop the\n edges.\n\n## Timing\n\n- Stagger related elements by 0.06\u20130.12 s.\n- **One focal move at a time.** If everything moves, nothing reads: supporting elements move less and later.\n- Shapes and pictures enter in 0.4\u20130.8 s; exits are faster than entrances.\n- A text animation takes at least 0.8\u20131 s over the whole line, first unit in to last unit settled, unless the video\n needs snap (a beat hit, a glitch flick): faster text flashes past before it is read. The arithmetic per kind of\n animation: video-projects.md, Text animation pace.\n\n## Easing by intent\n\n- Entrances: `AE Out` or `Expo Out` (fast start, soft landing). Camera and big moves: `AE Smooth`.\n- A layer that passes through (in, glide, out): `Smooth Glide` with the `glide` expression \u2014 the Glide keyframe\n presets build it (video-keyframes.md).\n- Playful arrivals: `Back Out` or `Overshoot`. Exits: `Ease In`.\n- `Linear` only for constant motion: tickers, rotation, progress along a path.\n\n## Text animation\n\n- Animate words or letters, never a whole line at once \u2014 the text presets do this.\n- One family per video. Calm presets for lines and captions: Glide Text (`glide-text`), Classic Fade Up\n (`classic-fade-up`), Classic Rise (Mask) (`classic-rise-mask`); Focus Type (`focus-type`) for a title.\n- Punchy presets that tilt or overshoot \u2014 Swing Pop (`swing-pop`), Whip (`whip`), Letter Vortex (`letter-vortex`) \u2014\n only on 1\u20133 words when the video wants energy. On a longer caption they read cheap.\n- Glide Continuous (`glide-continuous`) and Glide Soft Stop (`glide-soft-stop`) never let the text rest: use them\n only when the user asks for drifting text.\n- On a coloured card, pick a preset without a colour band (Classic Rise (Mask), Classic Fade Up): a band's colour can\n clash with the card.\n\n## Transitions and camera\n\n- Vary two or three kinds of transition across a video: one kind everywhere looks like a template, a new one at\n every cut looks random.\n- Camera moves are slow and small unless they are the point. Fast motion looks best at 60 fps with motion blur.\n\n## Sound\n\n- A soft whoosh on each transition and on the first headline is a good base. `data-1` or `selection-data-click` for\n UI-like pops, `cinematic-transition-13` for one big reveal.\n\n## What to check in every version\n\nLook at real frames across the video (a contact sheet) before the user sees it \u2014 the JSON doesn't show these:\nblank or empty frames, overlapping or cut-off text, text too small or gone too fast, nothing moving or everything\nmoving at once, weak hierarchy, clashing colours. Fix them and look again; two rounds are usually enough.\n";
|
|
16597
|
+
|
|
16598
|
+
// src/motionEngine/sceneScriptGuide.js
|
|
16594
16599
|
var PREFERRED = {
|
|
16595
16600
|
text: ["glide-text", "ember-type", "marker", "outline-pass", "neon-flow", "glitch", "swing-pop", "pendulum", "fan-deal", "whip", "word-swing", "letter-vortex"],
|
|
16596
16601
|
transitions: ["Cross Fade", "Advanced Zoom", "Advanced Movement", "Circular Wipe", "Pixel Blocks", "Camera Whip", "Zoom Ruler", "Gradient Glow Stack", "Gradient Map"],
|
|
@@ -16647,17 +16652,7 @@ function scriptFormatGuide(host = "chat") {
|
|
|
16647
16652
|
`;
|
|
16648
16653
|
}
|
|
16649
16654
|
function designGuide() {
|
|
16650
|
-
return
|
|
16651
|
-
|
|
16652
|
-
- **One idea per scene**, 3\u20136 scenes, 2\u20133 s each; at most ~8 words on screen at once, held \u2265 1 s (people read ~3 words a second).
|
|
16653
|
-
- **Hierarchy**: one headline per scene; supporting text much smaller; one accent colour; strong contrast.
|
|
16654
|
-
- **Timing**: stagger related elements 0.06\u20130.12 s; one focal move at a time \u2014 supporting elements move less and later; exits faster than entrances.
|
|
16655
|
-
- **Text animation** moves words or letters, never whole lines (the presets do this). Keep one family per video; use calm presets (glide-text,
|
|
16656
|
-
classic-fade-up, classic-rise-mask) for long lines, punchy ones (swing-pop, whip, letter-vortex) for 1\u20133 words. glide-continuous and
|
|
16657
|
-
glide-soft-stop never let the text rest: only when the user asks for drifting text.
|
|
16658
|
-
- **Transitions**: vary two or three kinds across the video; the camera stays subtle.
|
|
16659
|
-
- **Sound**: auto is a good base; add \`data-1\` / \`selection-data-click\` for UI-like pops, \`cinematic-transition-13\` for a big reveal.
|
|
16660
|
-
- **9:16**: bigger text, stacked vertically, everything in the middle 80 %.
|
|
16655
|
+
return `${video_design_default.replace(/^(#+) /gm, "#$1 ").trim()}
|
|
16661
16656
|
|
|
16662
16657
|
`;
|
|
16663
16658
|
}
|