@biunow/agent-biutalk 0.0.0-stage → 1.1.0
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/bin/server.js +355 -0
- package/engine/AGENTS.md +1414 -0
- package/engine/CLAUDE.md +1 -0
- package/engine/LICENSE +21 -0
- package/engine/README.md +216 -0
- package/engine/bin/explainroo.js +19 -0
- package/engine/dev/audio-lab.mjs +268 -0
- package/engine/docs/media/contact-sheet.jpg +0 -0
- package/engine/docs/media/dns-poster.jpg +0 -0
- package/engine/docs/media/intro-poster.jpg +0 -0
- package/engine/docs/media/logo-dark.png +0 -0
- package/engine/docs/media/logo-light.png +0 -0
- package/engine/docs/media/looks-dark.webp +0 -0
- package/engine/docs/media/looks-light.webp +0 -0
- package/engine/docs/media/product-demo.webp +0 -0
- package/engine/docs/media/rebase-poster.jpg +0 -0
- package/engine/docs/media/sizes-dark.webp +0 -0
- package/engine/docs/media/sizes-light.webp +0 -0
- package/engine/engine/audio/dsp.js +69 -0
- package/engine/engine/audio/instruments.js +147 -0
- package/engine/engine/audio/music.js +576 -0
- package/engine/engine/audio/pcm.js +93 -0
- package/engine/engine/audio/rng.js +40 -0
- package/engine/engine/audio/sfx.js +287 -0
- package/engine/engine/audio/soundtrack.js +201 -0
- package/engine/engine/audio/synth.js +721 -0
- package/engine/engine/audio/theory.js +105 -0
- package/engine/engine/audio/wav.js +47 -0
- package/engine/engine/captions.js +131 -0
- package/engine/engine/clips.js +107 -0
- package/engine/engine/code.js +179 -0
- package/engine/engine/director.js +475 -0
- package/engine/engine/frame.html +135 -0
- package/engine/engine/icons/LICENSE-lucide.txt +43 -0
- package/engine/engine/icons/lucide-tags.json +1 -0
- package/engine/engine/icons/lucide.json +1 -0
- package/engine/engine/layout.js +69 -0
- package/engine/engine/pathdata.js +234 -0
- package/engine/engine/pen.js +240 -0
- package/engine/engine/player.html +67 -0
- package/engine/engine/player.js +219 -0
- package/engine/engine/readability.js +9 -0
- package/engine/engine/runtime.js +690 -0
- package/engine/engine/stage.js +2247 -0
- package/engine/engine/studio.html +216 -0
- package/engine/engine/text.js +81 -0
- package/engine/engine/themes.js +360 -0
- package/engine/engine/transitions.js +161 -0
- package/engine/engine/ui.js +1042 -0
- package/engine/engine/upload.js +32 -0
- package/engine/engine/util.js +204 -0
- package/engine/examples/callbacks-to-async-await/code-versions.js +34 -0
- package/engine/examples/callbacks-to-async-await/scenes.js +106 -0
- package/engine/examples/callbacks-to-async-await/script.md +22 -0
- package/engine/examples/callbacks-to-async-await/video.json +16 -0
- package/engine/examples/circle-area/scenes.js +228 -0
- package/engine/examples/circle-area/script.md +37 -0
- package/engine/examples/circle-area/video.json +14 -0
- package/engine/examples/explainroo-intro/scenes.js +133 -0
- package/engine/examples/explainroo-intro/script.md +27 -0
- package/engine/examples/explainroo-intro/video.json +8 -0
- package/engine/examples/how-dns-works/scenes.js +130 -0
- package/engine/examples/how-dns-works/script.md +28 -0
- package/engine/examples/how-dns-works/video.json +8 -0
- package/engine/examples/leap-years/scenes.js +156 -0
- package/engine/examples/leap-years/script.md +25 -0
- package/engine/examples/leap-years/video.json +16 -0
- package/engine/examples/leap-years-ja/scenes.js +194 -0
- package/engine/examples/leap-years-ja/script.md +32 -0
- package/engine/examples/leap-years-ja/video.json +17 -0
- package/engine/examples/merge-vs-rebase/scenes.js +129 -0
- package/engine/examples/merge-vs-rebase/script.md +22 -0
- package/engine/examples/merge-vs-rebase/video.json +8 -0
- package/engine/examples/password-storage-zh/scenes.js +185 -0
- package/engine/examples/password-storage-zh/script.md +25 -0
- package/engine/examples/password-storage-zh/video.json +19 -0
- package/engine/examples/sqlite-demo/README.md +19 -0
- package/engine/examples/sqlite-demo/scenes.js +423 -0
- package/engine/examples/sqlite-demo/script.md +35 -0
- package/engine/examples/sqlite-demo/video.json +17 -0
- package/engine/examples/unspar-demo/assets/fonts/Figtree-400.woff2 +0 -0
- package/engine/examples/unspar-demo/assets/fonts/Figtree-500.woff2 +0 -0
- package/engine/examples/unspar-demo/assets/fonts/Figtree-600.woff2 +0 -0
- package/engine/examples/unspar-demo/assets/fonts/Figtree-700.woff2 +0 -0
- package/engine/examples/unspar-demo/assets/fonts/Figtree-OFL.txt +93 -0
- package/engine/examples/unspar-demo/assets/unspar-logo.svg +23 -0
- package/engine/examples/unspar-demo/scenes.js +367 -0
- package/engine/examples/unspar-demo/script.md +25 -0
- package/engine/examples/unspar-demo/video.json +21 -0
- package/engine/examples/why-is-the-sky-blue-es/scenes.js +160 -0
- package/engine/examples/why-is-the-sky-blue-es/script.md +22 -0
- package/engine/examples/why-is-the-sky-blue-es/video.json +15 -0
- package/engine/fonts/ArchitectsDaughter-400-latin-ext.woff2 +0 -0
- package/engine/fonts/ArchitectsDaughter-400-latin.woff2 +0 -0
- package/engine/fonts/CabinSketch-400-latin.woff2 +0 -0
- package/engine/fonts/CabinSketch-700-latin.woff2 +0 -0
- package/engine/fonts/InstrumentSerif-400-italic-latin-ext.woff2 +0 -0
- package/engine/fonts/InstrumentSerif-400-italic-latin.woff2 +0 -0
- package/engine/fonts/InstrumentSerif-400-normal-latin-ext.woff2 +0 -0
- package/engine/fonts/InstrumentSerif-400-normal-latin.woff2 +0 -0
- package/engine/fonts/Inter-400-latin-ext.woff2 +0 -0
- package/engine/fonts/Inter-400-latin.woff2 +0 -0
- package/engine/fonts/JetBrainsMono-400-latin-ext.woff2 +0 -0
- package/engine/fonts/JetBrainsMono-400-latin.woff2 +0 -0
- package/engine/fonts/Kalam-400-latin-ext.woff2 +0 -0
- package/engine/fonts/Kalam-400-latin.woff2 +0 -0
- package/engine/fonts/Kalam-700-latin-ext.woff2 +0 -0
- package/engine/fonts/Kalam-700-latin.woff2 +0 -0
- package/engine/fonts/NotoSansDevanagari-400.ttf +0 -0
- package/engine/fonts/NotoSansDevanagari-700.ttf +0 -0
- package/engine/fonts/PatrickHand-400-latin-ext.woff2 +0 -0
- package/engine/fonts/PatrickHand-400-latin.woff2 +0 -0
- package/engine/fonts/PlusJakartaSans-600-latin-ext.woff2 +0 -0
- package/engine/fonts/PlusJakartaSans-600-latin.woff2 +0 -0
- package/engine/fonts/SpaceGrotesk-500-latin-ext.woff2 +0 -0
- package/engine/fonts/SpaceGrotesk-500-latin.woff2 +0 -0
- package/engine/fonts/fonts.json +216 -0
- package/engine/fonts/licenses/ArchitectsDaughter-OFL.txt +93 -0
- package/engine/fonts/licenses/CabinSketch-OFL.txt +93 -0
- package/engine/fonts/licenses/InstrumentSerif-OFL.txt +93 -0
- package/engine/fonts/licenses/Inter-OFL.txt +93 -0
- package/engine/fonts/licenses/JetBrainsMono-OFL.txt +93 -0
- package/engine/fonts/licenses/Kalam-OFL.txt +93 -0
- package/engine/fonts/licenses/NotoSansDevanagari-OFL.txt +118 -0
- package/engine/fonts/licenses/PatrickHand-OFL.txt +93 -0
- package/engine/fonts/licenses/PlusJakartaSans-OFL.txt +93 -0
- package/engine/fonts/licenses/SpaceGrotesk-OFL.txt +93 -0
- package/engine/package-lock.json +1201 -0
- package/engine/package.json +67 -0
- package/engine/scripts/build-icons.mjs +74 -0
- package/engine/scripts/fetch-fonts.mjs +68 -0
- package/engine/skills/explainroo/SKILL.md +51 -0
- package/engine/src/align.js +357 -0
- package/engine/src/browser.js +121 -0
- package/engine/src/capture.js +315 -0
- package/engine/src/chapters.js +32 -0
- package/engine/src/cli.js +421 -0
- package/engine/src/clips.js +19 -0
- package/engine/src/elevenlabs.js +90 -0
- package/engine/src/env.js +16 -0
- package/engine/src/export.js +187 -0
- package/engine/src/ffmpeg.js +103 -0
- package/engine/src/fonts.js +86 -0
- package/engine/src/g2p.py +76 -0
- package/engine/src/images.js +151 -0
- package/engine/src/licenses/misaki-Apache-2.0.txt +201 -0
- package/engine/src/math.js +83 -0
- package/engine/src/models.js +161 -0
- package/engine/src/phonemes.js +162 -0
- package/engine/src/pipeline.js +63 -0
- package/engine/src/project.js +331 -0
- package/engine/src/qa.js +186 -0
- package/engine/src/recordings.js +89 -0
- package/engine/src/render.js +156 -0
- package/engine/src/script.js +266 -0
- package/engine/src/server.js +288 -0
- package/engine/src/subtitles.js +78 -0
- package/engine/src/timeline.js +55 -0
- package/engine/src/voice.js +240 -0
- package/engine/src/wav.js +98 -0
- package/engine/templates/starter/scenes.js +31 -0
- package/engine/templates/starter/script.md +14 -0
- package/engine/test/align.test.js +108 -0
- package/engine/test/brand.test.js +41 -0
- package/engine/test/browser.test.js +89 -0
- package/engine/test/camera-browser.test.js +225 -0
- package/engine/test/caption-phrases.test.js +35 -0
- package/engine/test/capture-browser.test.js +90 -0
- package/engine/test/capture-fixture.js +46 -0
- package/engine/test/capture.test.js +62 -0
- package/engine/test/chapters.test.js +41 -0
- package/engine/test/cjk-browser.test.js +101 -0
- package/engine/test/cjk.test.js +232 -0
- package/engine/test/cli-exit.test.js +25 -0
- package/engine/test/cli.test.js +116 -0
- package/engine/test/clips-browser.test.js +125 -0
- package/engine/test/clips.test.js +67 -0
- package/engine/test/code-morph-browser.test.js +99 -0
- package/engine/test/code-morph.test.js +110 -0
- package/engine/test/contrast-browser.test.js +63 -0
- package/engine/test/contrast.test.js +80 -0
- package/engine/test/director.test.js +316 -0
- package/engine/test/engine-pure.test.js +29 -0
- package/engine/test/export-browser.test.js +224 -0
- package/engine/test/export.test.js +96 -0
- package/engine/test/fixtures/capture.html +55 -0
- package/engine/test/formats-pace.test.js +104 -0
- package/engine/test/languages-browser.test.js +78 -0
- package/engine/test/languages.test.js +140 -0
- package/engine/test/looks-browser.test.js +109 -0
- package/engine/test/looks-preview.test.js +57 -0
- package/engine/test/looks.test.js +130 -0
- package/engine/test/math-browser.test.js +114 -0
- package/engine/test/math.test.js +54 -0
- package/engine/test/multi-size-browser.test.js +133 -0
- package/engine/test/multi-size.test.js +116 -0
- package/engine/test/phonemes.test.js +92 -0
- package/engine/test/readability-browser.test.js +36 -0
- package/engine/test/readability.test.js +20 -0
- package/engine/test/render-options.test.js +52 -0
- package/engine/test/script.test.js +67 -0
- package/engine/test/server.test.js +256 -0
- package/engine/test/stills-browser.test.js +70 -0
- package/engine/test/subtitles.test.js +83 -0
- package/engine/test/timeline.test.js +31 -0
- package/engine/test/transparent-browser.test.js +123 -0
- package/engine/test/ui-kit.test.js +96 -0
- package/engine/test/upload-browser.test.js +55 -0
- package/engine/test/voice-providers.test.js +338 -0
- package/lib/host.mjs +480 -0
- package/manifest.json +54 -0
- package/package.json +8 -4
- package/skills/biutalk/SKILL.md +21 -0
- package/studio/app.js +209 -0
- package/studio/assert-panel-permit.mjs +67 -0
- package/studio/composer.css +354 -0
- package/studio/composer.js +169 -0
- package/studio/index.html +82 -0
- package/studio/looks/blueprint.svg +21 -0
- package/studio/looks/chalk.svg +15 -0
- package/studio/looks/clean.svg +20 -0
- package/studio/looks/editorial.svg +18 -0
- package/studio/looks/midnight.svg +17 -0
- package/studio/looks/paper.svg +11 -0
- package/studio/select-menu.js +268 -0
- package/studio/styles.css +4 -0
- package/README.md +0 -3
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
// A product demo for Unspar, drawn with the UI kit (s.ui). The screens are
|
|
2
|
+
// rebuilt from the real app's wording and look; brand colors, fonts and the
|
|
3
|
+
// logo come from "brand" and "fonts" in video.json.
|
|
4
|
+
|
|
5
|
+
// Background and drifting cards, then the camera, then the scene's headline,
|
|
6
|
+
// so the headline moves with the camera like everything else.
|
|
7
|
+
function stage(s, title, o = {}) {
|
|
8
|
+
const u = s.ui;
|
|
9
|
+
u.backdrop();
|
|
10
|
+
u.floaters();
|
|
11
|
+
if (o.camera) s.camera(o.camera);
|
|
12
|
+
if (title) u.headline(title, s.W / 2, 178, { size: 84, at: o.at ?? 0.15 });
|
|
13
|
+
return u;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
hook(s) {
|
|
18
|
+
const u = stage(s, null, { camera: [{ at: 0.2, zoom: 1.05, dur: s.dur, ease: 'linear' }] });
|
|
19
|
+
// The logo starts big in the middle and moves up when the voice goes on.
|
|
20
|
+
const up = s.p('#writes', 0.9, 'inOut');
|
|
21
|
+
const grow = s.p(0.1, 0.9, 'outBack');
|
|
22
|
+
s.ctx.save();
|
|
23
|
+
s.ctx.globalAlpha = s.clamp(s.p(0.1, 0.45, 'out'));
|
|
24
|
+
u.logo(960, s.lerp(540, 300, up), s.lerp(620, 380, up) * s.lerp(0.86, 1, grow));
|
|
25
|
+
s.ctx.restore();
|
|
26
|
+
u.headline("*Content that doesn't* read like AI.", 960, 610, { size: 116, at: s.time('#writes') + 0.35 });
|
|
27
|
+
const chips = [
|
|
28
|
+
{ label: 'Blog posts', icon: 'newspaper', at: '#blog', x: 770, w: 210 },
|
|
29
|
+
{ label: 'Guides', icon: 'book-open', at: '#guides', x: 1000, w: 170 },
|
|
30
|
+
];
|
|
31
|
+
for (const ch of chips) {
|
|
32
|
+
u.pop(ch.at, ch.x + ch.w / 2, 735, () => {
|
|
33
|
+
u.card(ch.x, 705, ch.w, 60, { r: 30, lift: 0.5 });
|
|
34
|
+
u.icon(ch.icon, ch.x + 36, 735, 26, u.colors.accent, 2.2);
|
|
35
|
+
u.text(ch.label, ch.x + 60, 736, { size: 23, weight: 600 });
|
|
36
|
+
}, { sfx: 'pop' });
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
brief(s) {
|
|
41
|
+
const px = 410;
|
|
42
|
+
const py = 270;
|
|
43
|
+
const site = s.time('#site');
|
|
44
|
+
const pick = s.time('#pick');
|
|
45
|
+
const topic = s.time('#topic');
|
|
46
|
+
const ideas = s.time('#ideas');
|
|
47
|
+
const chosen = pick + 1.0;
|
|
48
|
+
const u = stage(s, 'Tell it what to write about', {
|
|
49
|
+
camera: [
|
|
50
|
+
{ at: site - 0.9, x: px + 470, y: py + 330, zoom: 1.3, dur: 0.9 },
|
|
51
|
+
{ at: pick - 0.65, x: px + 700, y: py + 390, zoom: 1.3, dur: 0.7 },
|
|
52
|
+
{ at: topic - 0.6, x: px + 560, y: py + 440, zoom: 1.24, dur: 0.7 },
|
|
53
|
+
{ at: ideas - 0.7, x: px + 760, y: py + 500, zoom: 1.32, dur: 0.7 },
|
|
54
|
+
{ at: ideas + 1.2, x: 960, y: 540, zoom: 1, dur: 1 },
|
|
55
|
+
],
|
|
56
|
+
});
|
|
57
|
+
let rows = [];
|
|
58
|
+
u.panel(px, py, 1100, 600, { at: 0.3 }, () => {
|
|
59
|
+
u.icon('sparkles', px + 66, py + 62, 24, u.colors.accent, 2);
|
|
60
|
+
u.eyebrow('First article', px + 88, py + 63);
|
|
61
|
+
u.text('Tell us what you have', px + 56, py + 118, { size: 38, weight: 700 });
|
|
62
|
+
u.para('Share a site, a goal, or both. We will suggest a first article and queue it with the normal generation workflow.', px + 56, py + 150, 980, { size: 21, color: u.colors.muted });
|
|
63
|
+
u.input(px + 56, py + 296, 560, 62, {
|
|
64
|
+
label: 'Website URL',
|
|
65
|
+
placeholder: 'https://example.com',
|
|
66
|
+
value: u.typed('https://example.com', site + 0.15, 26),
|
|
67
|
+
focus: s.t >= site ? 1 - s.p(pick, 0.2) : 0,
|
|
68
|
+
caret: true,
|
|
69
|
+
});
|
|
70
|
+
u.input(px + 56, py + 430, 988, 62, {
|
|
71
|
+
label: 'Topic or goal',
|
|
72
|
+
placeholder: 'e.g. teach small SaaS teams how to write a launch plan',
|
|
73
|
+
value: u.typed('home baking for beginners', topic + 0.15, 24),
|
|
74
|
+
focus: s.t >= topic ? 1 - s.p(ideas, 0.2) : 0,
|
|
75
|
+
caret: true,
|
|
76
|
+
});
|
|
77
|
+
const loading = s.t >= ideas + 0.12;
|
|
78
|
+
const label = !loading ? 'Get article ideas' : s.t < ideas + 1.5 ? 'Looking at your site...' : 'Drafting first ideas...';
|
|
79
|
+
const bw = loading ? 340 : 280;
|
|
80
|
+
u.button(label, px + 1044 - bw, py + 516, bw, 60, { press: u.press(ideas), loading, icon: loading ? null : 'sparkles' });
|
|
81
|
+
// The dropdown goes last, so its open menu covers the fields below.
|
|
82
|
+
rows = u.select(px + 640, py + 296, 404, 62, {
|
|
83
|
+
label: 'What do you want to create?',
|
|
84
|
+
value: s.t >= chosen ? 'Website articles or blog posts' : '',
|
|
85
|
+
placeholder: 'Choose one',
|
|
86
|
+
open: s.t < pick ? 0 : s.t < chosen + 0.1 ? s.p(pick, 0.3) : 1 - s.p(chosen + 0.1, 0.25),
|
|
87
|
+
options: ['Website articles or blog posts', 'Social media content', 'Email newsletters', 'Something else'],
|
|
88
|
+
hover: s.t >= pick + 0.55 && s.t < chosen + 0.1 ? 0 : -1,
|
|
89
|
+
selected: s.t >= chosen ? 0 : -1,
|
|
90
|
+
size: 20,
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
u.cursor([
|
|
94
|
+
{ at: '#tell', x: 1560, y: 960 },
|
|
95
|
+
{ at: site - 0.75, x: px + 330, y: py + 330 },
|
|
96
|
+
{ at: site, click: true },
|
|
97
|
+
{ at: pick - 0.6, x: px + 870, y: py + 330 },
|
|
98
|
+
{ at: pick, click: true },
|
|
99
|
+
// Point past the end of the option's text, not on it.
|
|
100
|
+
{ at: pick + 0.35, x: px + 1016, y: (rows[0] ?? py + 405) + 6, dur: 0.5 },
|
|
101
|
+
{ at: chosen, click: true },
|
|
102
|
+
{ at: topic - 0.6, x: px + 420, y: py + 462 },
|
|
103
|
+
{ at: topic, click: true },
|
|
104
|
+
{ at: ideas - 0.7, x: px + 900, y: py + 548 },
|
|
105
|
+
{ at: ideas, click: true },
|
|
106
|
+
]);
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
ideas(s) {
|
|
110
|
+
const px = 430;
|
|
111
|
+
const py = 250;
|
|
112
|
+
const choose = s.time('#choose');
|
|
113
|
+
const u = stage(s, 'Pick one of its ideas', { at: 0.1, camera: [{ at: choose - 0.8, x: 960, y: 560, zoom: 1.08, dur: 1.2 }] });
|
|
114
|
+
const ideas = [
|
|
115
|
+
['Your first sourdough loaf, step by step', 'A beginner guide with a simple timeline'],
|
|
116
|
+
['Why bread goes stale and how to slow it down', 'The science, explained in plain words'],
|
|
117
|
+
['Five easy bakes for your first weekend', 'One short recipe for each bake'],
|
|
118
|
+
];
|
|
119
|
+
u.panel(px, py, 1060, 660, { at: 0.05, from: 0.98 }, () => {
|
|
120
|
+
u.icon('sparkles', px + 66, py + 62, 24, u.colors.accent, 2);
|
|
121
|
+
u.eyebrow('First article', px + 88, py + 63);
|
|
122
|
+
u.text('Tell us what you have', px + 56, py + 116, { size: 36, weight: 700 });
|
|
123
|
+
ideas.forEach(([title, sub], i) => {
|
|
124
|
+
const y = py + 170 + i * 118;
|
|
125
|
+
const sel = i === 0 ? s.p(choose, 0.3) : 0;
|
|
126
|
+
u.panel(px + 56, y, 948, 100, { at: s.time('#list') + i * 0.18, r: 14, shadow: false, lift: 0, from: 1, rise: 24, fill: sel > 0 ? u.colors.accentTint : '#ffffff', border: sel > 0.5 ? u.colors.accent : u.colors.line, borderWidth: 1.5 + sel, sfx: i === 0 ? 'blip' : null }, () => {
|
|
127
|
+
u.radio(px + 100, y + 50, sel);
|
|
128
|
+
u.text(title, px + 136, y + 36, { size: 25, weight: 600 });
|
|
129
|
+
u.text(sub, px + 136, y + 70, { size: 20, color: u.colors.muted });
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
s.ctx.save();
|
|
133
|
+
s.ctx.globalAlpha *= s.p(s.time('#list') + 0.7, 0.4, 'out');
|
|
134
|
+
u.button('Try a different topic', px + 480, py + 560, 260, 60, { variant: 'secondary' });
|
|
135
|
+
u.button('Queue first article', px + 754, py + 560, 250, 60);
|
|
136
|
+
s.ctx.restore();
|
|
137
|
+
});
|
|
138
|
+
u.cursor([
|
|
139
|
+
{ at: 0.3, x: 1350, y: 900 },
|
|
140
|
+
{ at: choose - 0.7, x: px + 900, y: py + 226 },
|
|
141
|
+
{ at: choose, click: true },
|
|
142
|
+
]);
|
|
143
|
+
},
|
|
144
|
+
|
|
145
|
+
price(s) {
|
|
146
|
+
const u = stage(s, 'You see the price first', { at: 0.1, camera: [{ at: 0.1, zoom: 1.04, dur: 3, ease: 'out' }] });
|
|
147
|
+
const px = 560;
|
|
148
|
+
const py = 250;
|
|
149
|
+
const price = s.time('#price');
|
|
150
|
+
const queue = s.time('#queue');
|
|
151
|
+
u.panel(px, py, 800, 640, { at: price }, () => {
|
|
152
|
+
u.text('Estimated credits', px + 56, py + 70, { size: 34, weight: 700 });
|
|
153
|
+
u.text('Credits are reserved before generation starts.', px + 56, py + 114, { size: 21, color: u.colors.muted });
|
|
154
|
+
u.text('Run tier', px + 56, py + 178, { size: 20, weight: 600 });
|
|
155
|
+
// The tier comes from the job; this one is Standard.
|
|
156
|
+
const on = s.p(price + 0.7, 0.35, 'out');
|
|
157
|
+
[['Quick', 1], ['Standard', 5], ['Advanced', 15], ['Flagship', 40]].forEach(([name, credits], i) => {
|
|
158
|
+
const x = px + 56 + i * 176;
|
|
159
|
+
const sel = i === 1 ? on : 0;
|
|
160
|
+
u.card(x, py + 206, 160, 104, { r: 14, shadow: false, fill: sel > 0 ? u.colors.accentTint : '#ffffff', border: sel > 0.5 ? u.colors.accent : u.colors.line, borderWidth: 1.5 + sel * 1.5 });
|
|
161
|
+
u.text(name, x + 22, py + 242, { size: 22, weight: 600, color: sel > 0.5 ? u.colors.accent : u.colors.text });
|
|
162
|
+
u.text(`${credits} credit${credits === 1 ? '' : 's'}`, x + 22, py + 278, { size: 19, color: u.colors.muted });
|
|
163
|
+
});
|
|
164
|
+
s.ctx.fillStyle = u.colors.line;
|
|
165
|
+
s.ctx.fillRect(px + 56, py + 350, 688, 1.5);
|
|
166
|
+
u.text('Credit charge', px + 56, py + 398, { size: 22, color: u.colors.soft });
|
|
167
|
+
u.text(`${u.count(5, price + 0.8, 0.8)} credits`, px + 744, py + 398, { size: 26, weight: 700, align: 'right' });
|
|
168
|
+
u.text('Available Credits', px + 56, py + 452, { size: 22, color: u.colors.soft });
|
|
169
|
+
u.text('120', px + 744, py + 452, { size: 26, weight: 700, align: 'right' });
|
|
170
|
+
u.button('Queue first article', px + 56, py + 530, 688, 64, { press: u.press(queue) });
|
|
171
|
+
});
|
|
172
|
+
u.toast('Your first article is queued.', { at: queue + 0.35, y: 930 });
|
|
173
|
+
u.cursor([
|
|
174
|
+
{ at: price + 0.4, x: 1500, y: 900 },
|
|
175
|
+
{ at: queue - 0.75, x: 960, y: py + 562 },
|
|
176
|
+
{ at: queue, click: true },
|
|
177
|
+
], { out: queue + 1.2 });
|
|
178
|
+
},
|
|
179
|
+
|
|
180
|
+
agents(s) {
|
|
181
|
+
const u = stage(s, 'Its agents do the work', { at: 0.1, camera: [{ at: 0.2, zoom: 1.05, dur: s.dur, ease: 'linear' }] });
|
|
182
|
+
const agents = s.time('#agents');
|
|
183
|
+
const done = s.voice.end + 0.15;
|
|
184
|
+
u.panel(410, 250, 1100, 130, { at: 0.2 }, () => {
|
|
185
|
+
u.card(446, 279, 72, 72, { r: 16, shadow: false, border: false, fill: u.colors.accentTint });
|
|
186
|
+
u.icon('file-text', 482, 315, 34, u.colors.accent, 2);
|
|
187
|
+
u.text('Your first sourdough loaf, step by step', 548, 300, { size: 27, weight: 600 });
|
|
188
|
+
u.text('My First Project · Standard', 548, 336, { size: 20, color: u.colors.muted });
|
|
189
|
+
if (s.t < agents) u.pill('Queued for Generation', 1474, 315, 'blue', { align: 'right' });
|
|
190
|
+
else if (s.t < done) u.pill('Generating', 1474, 315, 'yellow', { align: 'right', dot: true, pulse: true });
|
|
191
|
+
else u.pop(done, 1404, 315, () => u.pill('Completed', 1474, 315, 'green', { align: 'right', dot: true }), { from: 0.8, sfx: 'chime' });
|
|
192
|
+
});
|
|
193
|
+
// Research, writing and fact check light up as the voice names them.
|
|
194
|
+
const steps = [
|
|
195
|
+
{ title: 'Research', sub: 'Looks up the topic', icon: 'search', at: '#research' },
|
|
196
|
+
{ title: 'Writing', sub: 'Writes in your voice', icon: 'pen-line', at: '#write' },
|
|
197
|
+
{ title: 'Fact check', sub: 'Checks the facts', icon: 'shield-check', at: '#check' },
|
|
198
|
+
];
|
|
199
|
+
const W = 330;
|
|
200
|
+
const gap = 55;
|
|
201
|
+
const x0 = 960 - (W * 3 + gap * 2) / 2;
|
|
202
|
+
const y = 470;
|
|
203
|
+
const fill = s.t < s.time('#write') ? 0 : s.t < s.time('#check') ? 0.5 * s.p('#write', 0.6) : 0.5 + 0.5 * s.p('#check', 0.6);
|
|
204
|
+
s.ctx.fillStyle = u.colors.line;
|
|
205
|
+
s.ctx.fillRect(x0 + W / 2, y + 90, W * 2 + gap * 2, 4);
|
|
206
|
+
s.ctx.fillStyle = u.colors.accent;
|
|
207
|
+
s.ctx.fillRect(x0 + W / 2, y + 90, (W * 2 + gap * 2) * fill, 4);
|
|
208
|
+
steps.forEach((st, i) => {
|
|
209
|
+
const x = x0 + i * (W + gap);
|
|
210
|
+
const start = s.time(st.at);
|
|
211
|
+
const end = i < 2 ? s.time(steps[i + 1].at) : done;
|
|
212
|
+
const active = s.t >= start ? s.p(start, 0.35, 'out') : 0;
|
|
213
|
+
const finished = s.t >= end;
|
|
214
|
+
u.panel(x, y, W, 330, { at: agents + 0.1 + i * 0.12, lift: 0.7 + active * 0.5, border: active > 0.5 ? u.colors.accent : u.colors.line, borderWidth: 1.5 + active * 1.5, sfx: i === 0 ? 'pop' : null }, () => {
|
|
215
|
+
s.ctx.beginPath();
|
|
216
|
+
s.ctx.arc(x + W / 2, y + 92, 44, 0, Math.PI * 2);
|
|
217
|
+
s.ctx.fillStyle = active > 0.5 ? u.colors.accent : u.colors.accentTint;
|
|
218
|
+
s.ctx.fill();
|
|
219
|
+
u.icon(finished ? 'check' : st.icon, x + W / 2, y + 92, 40, active > 0.5 ? '#ffffff' : u.colors.accent, 2.2);
|
|
220
|
+
u.text(st.title, x + W / 2, y + 176, { size: 28, weight: 700, align: 'center' });
|
|
221
|
+
u.text(st.sub, x + W / 2, y + 214, { size: 21, color: u.colors.muted, align: 'center' });
|
|
222
|
+
if (finished) u.pill('Done', x + W / 2, y + 276, 'green', { align: 'center' });
|
|
223
|
+
else if (active > 0) {
|
|
224
|
+
u.spinner(x + W / 2 - 60, y + 276, 11);
|
|
225
|
+
u.text('Working', x + W / 2 - 38, y + 277, { size: 19, weight: 600, color: u.colors.accent });
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
if (s.t >= start) s.sfx('pop', start);
|
|
229
|
+
});
|
|
230
|
+
},
|
|
231
|
+
|
|
232
|
+
voice(s) {
|
|
233
|
+
const px = 410;
|
|
234
|
+
const py = 250;
|
|
235
|
+
const formal = s.time('#formal');
|
|
236
|
+
const rhythm = s.time('#rhythm');
|
|
237
|
+
const create = s.voice.end - 0.1;
|
|
238
|
+
const u = stage(s, 'In your voice', {
|
|
239
|
+
at: 0.1,
|
|
240
|
+
camera: [
|
|
241
|
+
{ at: formal - 0.7, x: 900, y: 520, zoom: 1.12, dur: 0.8 },
|
|
242
|
+
{ at: rhythm - 0.6, x: 960, y: 580, zoom: 1.12, dur: 0.7 },
|
|
243
|
+
{ at: s.voice.end - 0.9, x: 1080, y: 560, zoom: 1.08, dur: 0.8 },
|
|
244
|
+
],
|
|
245
|
+
});
|
|
246
|
+
// Lay the chips out with room for the check mark of the one that gets picked.
|
|
247
|
+
const row = (labels, y, pick) => {
|
|
248
|
+
let x = px + 56;
|
|
249
|
+
return labels.map((label, i) => {
|
|
250
|
+
const r = { label, x, y, w: u.chipWidth(label, { size: 21 }, i === pick) };
|
|
251
|
+
x += r.w + 14;
|
|
252
|
+
return r;
|
|
253
|
+
});
|
|
254
|
+
};
|
|
255
|
+
const f = row(['Casual', 'Conversational', 'Professional', 'Formal', 'Academic'], py + 262, 1);
|
|
256
|
+
const r = row(['Short and Punchy', 'Mixed', 'Measured', 'Long and Layered'], py + 420, 1);
|
|
257
|
+
u.panel(px, py, 1100, 610, { at: '#voice' }, () => {
|
|
258
|
+
u.eyebrow('Voice profile', px + 56, py + 62);
|
|
259
|
+
u.text('Friendly and clear', px + 56, py + 114, { size: 38, weight: 700 });
|
|
260
|
+
u.text('Formality', px + 56, py + 200, { size: 23, weight: 600 });
|
|
261
|
+
f.forEach((ch, i) => u.chip(ch.label, ch.x, ch.y, { size: 21, selected: i === 1 ? s.p(formal, 0.3) : 0 }));
|
|
262
|
+
u.text('Sentence rhythm', px + 56, py + 358, { size: 23, weight: 600 });
|
|
263
|
+
r.forEach((ch, i) => u.chip(ch.label, ch.x, ch.y, { size: 21, selected: i === 1 ? s.p(rhythm, 0.3) : 0 }));
|
|
264
|
+
u.button('Create voice', px + 824, py + 520, 220, 60, { press: u.press(create) });
|
|
265
|
+
});
|
|
266
|
+
u.cursor([
|
|
267
|
+
{ at: s.time('#voice') + 0.3, x: 1500, y: 900 },
|
|
268
|
+
{ at: formal - 0.65, x: f[1].x + f[1].w / 2, y: f[1].y + 4 },
|
|
269
|
+
{ at: formal, click: true },
|
|
270
|
+
{ at: rhythm - 0.6, x: r[1].x + r[1].w / 2, y: r[1].y + 4 },
|
|
271
|
+
{ at: rhythm, click: true },
|
|
272
|
+
{ at: create - 0.7, x: px + 934, y: py + 552 },
|
|
273
|
+
{ at: create, click: true },
|
|
274
|
+
]);
|
|
275
|
+
},
|
|
276
|
+
|
|
277
|
+
publish(s) {
|
|
278
|
+
const pub = s.time('#publish');
|
|
279
|
+
const live = s.time('#live');
|
|
280
|
+
const send = pub + 1.25;
|
|
281
|
+
const u = stage(s, 'You read it, Unspar publishes it', {
|
|
282
|
+
at: 0.1,
|
|
283
|
+
camera: [
|
|
284
|
+
{ at: 0, x: 900, y: 560, zoom: 1.02 },
|
|
285
|
+
{ at: live - 0.5, x: 1020, y: 560, zoom: 1.04, dur: 1 },
|
|
286
|
+
],
|
|
287
|
+
});
|
|
288
|
+
// The finished article.
|
|
289
|
+
const ax = 220;
|
|
290
|
+
const ay = 260;
|
|
291
|
+
u.panel(ax, ay, 860, 640, { at: 0.2 }, () => {
|
|
292
|
+
u.text('Preview', ax + 48, ay + 52, { size: 20, weight: 600, color: u.colors.accent });
|
|
293
|
+
s.ctx.fillStyle = u.colors.accent;
|
|
294
|
+
s.ctx.fillRect(ax + 48, ay + 72, 74, 3);
|
|
295
|
+
u.text('Markdown', ax + 146, ay + 52, { size: 20, weight: 500, color: u.colors.muted });
|
|
296
|
+
s.ctx.fillStyle = u.colors.line;
|
|
297
|
+
s.ctx.fillRect(ax + 32, ay + 75, 796, 1.5);
|
|
298
|
+
u.pill('Completed', ax + 600, ay + 50, 'green', { align: 'right', dot: true });
|
|
299
|
+
u.button('Publish', ax + 640, ay + 22, 180, 56, { press: u.press(pub), icon: 'send' });
|
|
300
|
+
u.text('Your first sourdough loaf,', ax + 48, ay + 140, { size: 40, weight: 700 });
|
|
301
|
+
u.text('step by step', ax + 48, ay + 190, { size: 40, weight: 700 });
|
|
302
|
+
u.lines(ax + 48, ay + 240, 760, 5, { gap: 26, h: 11 });
|
|
303
|
+
u.text('What you need', ax + 48, ay + 400, { size: 26, weight: 700 });
|
|
304
|
+
u.lines(ax + 48, ay + 436, 760, 5, { gap: 26, h: 11, seed: 3 });
|
|
305
|
+
});
|
|
306
|
+
// The publish dialog, closed again after "Publish now".
|
|
307
|
+
const mx = 330;
|
|
308
|
+
const my = 380;
|
|
309
|
+
u.modal(mx, my, 640, 350, { at: pub + 0.15, out: send + 0.2 }, () => {
|
|
310
|
+
u.text('Publish', mx + 40, my + 52, { size: 30, weight: 700 });
|
|
311
|
+
u.select(mx + 40, my + 130, 560, 60, { label: 'Outlet', value: 'Bakery blog · WordPress', size: 20 });
|
|
312
|
+
u.text('Publish timing', mx + 40, my + 226, { size: 19, weight: 600 });
|
|
313
|
+
u.chip('Now', mx + 40, my + 270, { size: 19, selected: 1 });
|
|
314
|
+
u.chip('Tomorrow morning, 08:00', mx + 160, my + 270, { size: 19 });
|
|
315
|
+
u.button('Publish now', mx + 420, my + 284, 180, 52, { press: u.press(send), size: 20 });
|
|
316
|
+
});
|
|
317
|
+
// The post on the site.
|
|
318
|
+
const bx = 1130;
|
|
319
|
+
const by = 300;
|
|
320
|
+
u.browser(bx, by, 620, 560, { at: send + 0.35, rise: 60, url: 'example.com/blog/first-sourdough-loaf' }, (x, y) => {
|
|
321
|
+
u.text('BAKERY BLOG', x + 40, y + 46, { size: 16, weight: 700, color: u.colors.faint, tracking: 2 });
|
|
322
|
+
const tp = s.p(send + 0.7, 0.6, 'out');
|
|
323
|
+
s.ctx.save();
|
|
324
|
+
s.ctx.globalAlpha *= tp;
|
|
325
|
+
s.ctx.translate(0, (1 - tp) * 16);
|
|
326
|
+
u.text('Your first sourdough', x + 40, y + 100, { size: 36, font: 'headline' });
|
|
327
|
+
u.text('loaf, step by step', x + 40, y + 144, { size: 36, font: 'headline' });
|
|
328
|
+
u.lines(x + 40, y + 190, 540, 8, { gap: 26, h: 10, seed: 5 });
|
|
329
|
+
s.ctx.restore();
|
|
330
|
+
});
|
|
331
|
+
if (s.t >= send + 0.7) s.sfx('sparkle', send + 0.7, { gain: 0.6 });
|
|
332
|
+
// WordPress and Ghost.
|
|
333
|
+
[['WordPress', 1290], ['Ghost', 1470]].forEach(([name, x], i) => {
|
|
334
|
+
const w = u.measure(name, 21, 600) + 40;
|
|
335
|
+
u.pop(live + 0.15 + i * 0.35, x + w / 2, 925, () => {
|
|
336
|
+
u.card(x, 900, w, 50, { r: 25, lift: 0.5 });
|
|
337
|
+
u.text(name, x + 20, 926, { size: 21, weight: 600 });
|
|
338
|
+
}, { sfx: 'pop' });
|
|
339
|
+
});
|
|
340
|
+
u.cursor([
|
|
341
|
+
{ at: 0.4, x: 1300, y: 860 },
|
|
342
|
+
{ at: pub - 0.7, x: ax + 740, y: ay + 50 },
|
|
343
|
+
{ at: pub, click: true },
|
|
344
|
+
{ at: pub + 0.4, x: mx + 578, y: my + 318, dur: 0.75 },
|
|
345
|
+
{ at: send, click: true },
|
|
346
|
+
], { out: send + 0.6 });
|
|
347
|
+
},
|
|
348
|
+
|
|
349
|
+
outro(s) {
|
|
350
|
+
const u = s.ui;
|
|
351
|
+
u.backdrop();
|
|
352
|
+
// Brand color fills the frame, with white cards drifting on it.
|
|
353
|
+
const p = u.wipe(0);
|
|
354
|
+
s.ctx.save();
|
|
355
|
+
s.ctx.globalAlpha = p;
|
|
356
|
+
u.floaters({ tint: 'white', alpha: 0.35 });
|
|
357
|
+
s.ctx.restore();
|
|
358
|
+
const x = 510;
|
|
359
|
+
const y = 250;
|
|
360
|
+
u.panel(x, y, 900, 560, { at: 0.45, r: 32, lift: 2, border: false, from: 0.9 }, () => {
|
|
361
|
+
u.logo(960, y + 120, 330);
|
|
362
|
+
u.headline("*Content that doesn't* read like AI.", 960, y + 285, { size: 72, at: '#brand' });
|
|
363
|
+
u.pop('#try', 960, y + 383, () => u.button('Try it for free', 810, y + 350, 300, 66, { size: 23 }), { from: 0.8 });
|
|
364
|
+
if (s.t >= s.time('#try')) u.text('unspar.com', 960, y + 470, { size: 24, weight: 500, color: u.colors.muted, align: 'center', alpha: s.p('#try', 0.4, 'out') });
|
|
365
|
+
});
|
|
366
|
+
},
|
|
367
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Unspar
|
|
2
|
+
|
|
3
|
+
## hook
|
|
4
|
+
[#logo] This is Unspar. [#writes] It writes articles for your website, like [#blog] blog posts and [#guides] guides.
|
|
5
|
+
|
|
6
|
+
## brief
|
|
7
|
+
First, [#tell] you tell it what to write about. Paste your [#site] website, [#pick] choose what you want to make and [#topic] add a topic. [#ideas] Unspar looks at your site and drafts a few ideas.
|
|
8
|
+
|
|
9
|
+
## ideas
|
|
10
|
+
A moment later, [#list] you have ideas to choose from. You [#choose] pick the one you like.
|
|
11
|
+
|
|
12
|
+
## price
|
|
13
|
+
[#price] Before anything runs, you see what it costs. [#queue] When you {queue|cue} it, the credits are set aside and the work starts.
|
|
14
|
+
|
|
15
|
+
## agents
|
|
16
|
+
Then [#agents] its AI agents get to work. They [#research] look up the topic, [#write] write the article in your voice and [#check] check the facts.
|
|
17
|
+
|
|
18
|
+
## voice
|
|
19
|
+
[#voice] You decide what that voice sounds like. Pick how [#formal] formal it is and [#rhythm] how the sentences flow.
|
|
20
|
+
|
|
21
|
+
## publish
|
|
22
|
+
When you're happy with it, [#publish] Unspar puts it on your site. [#live] It works with WordPress and Ghost.
|
|
23
|
+
|
|
24
|
+
## outro {hold=1}
|
|
25
|
+
[#brand] Unspar. Content that doesn't read like AI. [#try] Try it for free at {unspar.com|unspar dot com}.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Unspar",
|
|
3
|
+
"theme": "clean",
|
|
4
|
+
"size": "youtube",
|
|
5
|
+
"voice": "af_heart",
|
|
6
|
+
"music": true,
|
|
7
|
+
"captions": "auto",
|
|
8
|
+
"brand": {
|
|
9
|
+
"accent": "#245cff",
|
|
10
|
+
"background": "#f8f6f1",
|
|
11
|
+
"font": "Figtree",
|
|
12
|
+
"headline": "Instrument Serif",
|
|
13
|
+
"logo": "assets/unspar-logo.svg"
|
|
14
|
+
},
|
|
15
|
+
"fonts": [
|
|
16
|
+
{ "family": "Figtree", "src": "assets/fonts/Figtree-400.woff2", "weight": 400 },
|
|
17
|
+
{ "family": "Figtree", "src": "assets/fonts/Figtree-500.woff2", "weight": 500 },
|
|
18
|
+
{ "family": "Figtree", "src": "assets/fonts/Figtree-600.woff2", "weight": 600 },
|
|
19
|
+
{ "family": "Figtree", "src": "assets/fonts/Figtree-700.woff2", "weight": 700 }
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
// The same colors carry the same meaning throughout: blue scattering,
|
|
2
|
+
// gold sunlight, warm red/orange light after the longer sunset path.
|
|
3
|
+
const C = { blue: '#3c6fa8', red: '#a14332', orange: '#c46728', gold: '#d69b27', air: '#e4edf3', soft: '#645e54' };
|
|
4
|
+
const quiet = { sfx: false };
|
|
5
|
+
|
|
6
|
+
function heading(s, n, category, title, at, first = false) {
|
|
7
|
+
s.text(`${n} / ${category}`, { x: 180, y: 115, align: 'left', size: 36, color: C.soft, at: first ? -1 : at, enter: first ? 'none' : 'fade', ...quiet });
|
|
8
|
+
s.text(title, { x: 180, y: 220, align: 'left', size: 88, font: 'display', at: first ? -1 : at, enter: first ? 'none' : 'write', ...quiet });
|
|
9
|
+
s.line([[180, 286], [1740, 286]], { at: first ? -1 : at, color: C.blue, opacity: 0.3, width: 2, ...quiet });
|
|
10
|
+
}
|
|
11
|
+
function label(s, text, x, y, at, o = {}) {
|
|
12
|
+
return s.text(text, { x, y, size: 48, at, ...quiet, ...o });
|
|
13
|
+
}
|
|
14
|
+
function sun(s, x, y, at, size = 140, o = {}) {
|
|
15
|
+
s.circle({ x, y, r: size * 0.30, fill: '#f4d17a', color: C.gold, at, ...quiet, ...o });
|
|
16
|
+
s.icon('sun', { x, y, size, color: C.gold, at, ...quiet, ...o });
|
|
17
|
+
}
|
|
18
|
+
function molecule(s, x, y, at, o = {}) {
|
|
19
|
+
s.line([[x - 10, y], [x + 10, y]], { at, color: C.soft, width: 4, ...quiet, ...o });
|
|
20
|
+
s.circle({ x: x - 12, y, r: 13, at, color: C.soft, fill: '#f7f3ea', width: 2.5, ...quiet, ...o });
|
|
21
|
+
s.circle({ x: x + 12, y, r: 13, at, color: C.soft, fill: '#f7f3ea', width: 2.5, ...quiet, ...o });
|
|
22
|
+
}
|
|
23
|
+
function ray(s, from, to, at, color = C.blue, o = {}) {
|
|
24
|
+
s.arrow(from, to, { at, color, width: 7, headSize: 21, gap: 8, ...quiet, ...o });
|
|
25
|
+
}
|
|
26
|
+
function horizon(s, x, y, w, at, color = '#7a8d70') {
|
|
27
|
+
s.path(`M ${x} ${y} Q ${x+w/2} ${y-95} ${x+w} ${y}`, { at, color, width: 5, ...quiet });
|
|
28
|
+
}
|
|
29
|
+
function wave(s, x, y, w, wavelength, color, at) {
|
|
30
|
+
let d = `M ${x} ${y}`;
|
|
31
|
+
for (let i = 1; i <= 200; i++) {
|
|
32
|
+
const dx = w*i/200;
|
|
33
|
+
d += ` L ${x+dx} ${y-40*Math.sin(dx*2*Math.PI/wavelength)}`;
|
|
34
|
+
}
|
|
35
|
+
s.path(d, { at, color, width: 6, single: true, ...quiet });
|
|
36
|
+
}
|
|
37
|
+
// A pulse follows a ray, keeping a diagram alive between spoken cues.
|
|
38
|
+
// This uses local scene time, so rendering remains deterministic.
|
|
39
|
+
function pulse(s, from, to, at, color, offset = 0) {
|
|
40
|
+
s.draw({ at, ...quiet }, (ctx, life) => {
|
|
41
|
+
const p = ((life.local + offset) % 2.8) / 2.8;
|
|
42
|
+
ctx.globalAlpha *= Math.sin(Math.PI*p) * 0.8;
|
|
43
|
+
ctx.fillStyle = color;
|
|
44
|
+
ctx.beginPath();
|
|
45
|
+
ctx.arc(from[0]+(to[0]-from[0])*p, from[1]+(to[1]-from[1])*p, 7, 0, 2*Math.PI);
|
|
46
|
+
ctx.fill();
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default {
|
|
51
|
+
pregunta(s) {
|
|
52
|
+
heading(s, '01', 'UNA PREGUNTA COTIDIANA', '¿Por qué el cielo es azul?', '#pregunta', true);
|
|
53
|
+
s.path('M 520 750 C 490 240 1430 240 1400 750 Z', { at: '#pregunta', color: C.blue, fill: C.air, width: 3, ...quiet });
|
|
54
|
+
horizon(s, 460, 775, 1000, '#pregunta');
|
|
55
|
+
sun(s, 760, 470, 'día', 150);
|
|
56
|
+
label(s, 'Luz del Sol', 460, 530, '#respuesta');
|
|
57
|
+
ray(s, [585, 550], [715, 493], '#respuesta', C.gold);
|
|
58
|
+
label(s, 'Aire', 1420, 530, 'aire', { color: C.blue });
|
|
59
|
+
ray(s, [1325, 540], [1180, 540], 'aire');
|
|
60
|
+
s.annotate({ x: 1060, y: 500, w: 180, h: 120 }, { type: 'circle', at: 'aire', color: C.blue, ...quiet });
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
colores(s) {
|
|
64
|
+
heading(s, '02', 'LA LUZ DEL SOL', 'Una mezcla de colores', '#sol');
|
|
65
|
+
sun(s, 350, 575, '#sol', 185);
|
|
66
|
+
label(s, 'Sol', 350, 780, '#sol');
|
|
67
|
+
const colors = ['#b55743', '#d98835', '#ddb544', '#6d985c', '#3c6fa8', '#6563a6', '#895b9f'];
|
|
68
|
+
colors.forEach((color, i) => {
|
|
69
|
+
const y = 440+i*44;
|
|
70
|
+
s.path(`M 475 575 Q 770 ${y} 1100 ${y} Q 1300 ${y} 1450 575`, { at: 'colores', color, width: 10, ...quiet });
|
|
71
|
+
});
|
|
72
|
+
label(s, 'Colores visibles', 910, 355, 'colores');
|
|
73
|
+
s.circle({ x: 1500, y: 575, r: 83, color: '#9c9486', fill: '#fffdf8', width: 3, at: '#juntos', ...quiet });
|
|
74
|
+
label(s, 'Luz blanca', 1500, 780, 'blanca');
|
|
75
|
+
s.annotate({ x: 1498, y: 575, w: 192, h: 192 }, { type: 'circle', at: 'mezcla', color: C.gold, ...quiet });
|
|
76
|
+
pulse(s, [1170, 575], [1420, 575], '#juntos', C.gold);
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
moleculas(s) {
|
|
80
|
+
heading(s, '03', 'EL PAPEL DEL AIRE', 'La luz cambia de dirección', '#aire');
|
|
81
|
+
s.circle({ x: 960, y: 575, r: 185, color: C.blue, fill: C.air, width: 3, at: '#aire', ...quiet });
|
|
82
|
+
[[850,490],[1060,480],[960,575],[850,660],[1070,660]].forEach(([x,y],i) => molecule(s,x,y,i===2 ? 'moléculas' : 'partículas'));
|
|
83
|
+
label(s, 'Moléculas del aire', 960, 360, 'moléculas');
|
|
84
|
+
ray(s, [360,575], [920,575], 'luz', C.gold);
|
|
85
|
+
label(s, 'Luz solar', 485, 670, 'luz');
|
|
86
|
+
ray(s, [992,555], [1400,410], '#desvio');
|
|
87
|
+
ray(s, [995,595], [1370,730], 'direcciones');
|
|
88
|
+
pulse(s, [992,555], [1400,410], '#desvio', C.blue);
|
|
89
|
+
pulse(s, [995,595], [1370,730], 'direcciones', C.blue, 1.2);
|
|
90
|
+
label(s, 'Dispersión', 960, 788, '#nombre', { size: 58, color: C.blue, font: 'display' });
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
ondas(s) {
|
|
94
|
+
heading(s, '04', 'EL PAPEL DEL AIRE', 'El azul se dispersa más', '#ondas');
|
|
95
|
+
label(s, 'Azul', 275, 455, '#ondas', { color: C.blue, size: 56 });
|
|
96
|
+
label(s, 'Rojo', 275, 685, '#ondas', { color: C.red, size: 56 });
|
|
97
|
+
wave(s, 440,455,920,120,C.blue,'#ondas');
|
|
98
|
+
wave(s, 440,685,920,300,C.red,'#ondas');
|
|
99
|
+
s.arrow([470,359], [590,359], { at: 'distancia', head: 'both', color: C.blue, width: 3, headSize: 14, gap: 0, ...quiet });
|
|
100
|
+
s.line([[470,367],[470,405]], { at: 'crestas', color: C.blue, dashed: true, width: 2, ...quiet });
|
|
101
|
+
s.line([[590,367],[590,405]], { at: 'crestas', color: C.blue, dashed: true, width: 2, ...quiet });
|
|
102
|
+
label(s, 'Onda corta', 965, 355, '#azul', { color: C.blue });
|
|
103
|
+
label(s, 'Más\ndispersión', 1550, 455, 'dispersan', { color: C.blue, size: 44 });
|
|
104
|
+
label(s, 'Onda larga', 965, 790, '#rojo', { color: C.red });
|
|
105
|
+
label(s, 'Menos\ndispersión', 1550, 685, '#rojo', { color: C.red, size: 44 });
|
|
106
|
+
s.annotate({ x: 830, y: 455, w: 300, h: 110 }, { at: 'cortas', type: 'highlight', color: C.blue, ...quiet });
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
ojos(s) {
|
|
110
|
+
heading(s, '05', 'EL AZUL QUE VEMOS', 'Desde todo el cielo', '#cielo');
|
|
111
|
+
s.path('M 430 680 C 380 255 1540 255 1490 680', { at: '#cielo', color: C.blue, width: 4, ...quiet });
|
|
112
|
+
sun(s, 390, 435, '#cielo', 120);
|
|
113
|
+
s.icon('eye', { x: 960, y: 690, size: 145, at: 'ojos', color: 'ink', ...quiet });
|
|
114
|
+
label(s, 'Nuestros ojos', 960, 795, 'ojos');
|
|
115
|
+
const rays = [[[590,475],[895,665]], [[960,375],[960,627]], [[1330,475],[1025,665]]];
|
|
116
|
+
rays.forEach(([from,to],i) => {
|
|
117
|
+
const at = i===0 ? 'azul' : i===1 ? 'ojos' : 'direcciones';
|
|
118
|
+
s.circle({ x: from[0], y: from[1], r: 19, color: C.blue, fill: C.air, at, ...quiet });
|
|
119
|
+
ray(s,from,to,at);
|
|
120
|
+
pulse(s,from,to,at,C.blue,i*.7);
|
|
121
|
+
});
|
|
122
|
+
s.annotate({ x: 1330, y: 475, w: 110, h: 110 }, { at: '#mirada', type: 'circle', color: C.blue, ...quiet });
|
|
123
|
+
label(s, 'Lejos del Sol', 1470, 785, 'lejos', { size: 46, color: C.blue });
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
ocaso(s) {
|
|
127
|
+
heading(s, '06', 'AL ATARDECER', 'Un recorrido más largo', '#bajo');
|
|
128
|
+
s.path('M 450 770 C 510 295 1370 295 1480 770 Z', { at: '#bajo', color: C.blue, fill: C.air, width: 2.5, ...quiet });
|
|
129
|
+
horizon(s, 200, 790, 1510, '#bajo');
|
|
130
|
+
sun(s, 280, 650, 'bajo', 130);
|
|
131
|
+
[[630,600],[780,700],[930,590],[1080,705],[1230,600],[1370,700]].forEach(([x,y]) => molecule(s,x,y,'aire'));
|
|
132
|
+
s.icon('eye', { x: 1570, y: 650, size: 125, at: 'luz', color: 'ink', ...quiet });
|
|
133
|
+
ray(s,[365,650],[1495,650],'luz',C.gold);
|
|
134
|
+
label(s, 'Más aire', 960, 370, 'aire', { size: 52, color: C.blue });
|
|
135
|
+
ray(s,[715,638],[790,465],'#fuera');
|
|
136
|
+
ray(s,[970,638],[1090,465],'azul');
|
|
137
|
+
pulse(s,[715,638],[790,465],'#fuera',C.blue);
|
|
138
|
+
pulse(s,[970,638],[1090,465],'azul',C.blue,1);
|
|
139
|
+
label(s, 'Azul dispersado', 580, 405, 'dispersa', { size: 42, color: C.blue });
|
|
140
|
+
ray(s,[1130,650],[1495,650],'#calidos',C.orange,{width:11});
|
|
141
|
+
label(s, 'Rojos y naranjas', 1330, 798, 'rojos', { size: 46, color: C.red });
|
|
142
|
+
},
|
|
143
|
+
|
|
144
|
+
cierre(s) {
|
|
145
|
+
heading(s, '07', 'LA IDEA PRINCIPAL', 'El aire cambia lo que vemos', '#dia');
|
|
146
|
+
label(s, 'De día', 540, 360, '#dia', { size: 60, font: 'display', color: C.blue });
|
|
147
|
+
s.path('M 285 695 C 285 330 795 330 795 695', { at: '#dia', color: C.blue, fill: C.air, width: 3, ...quiet });
|
|
148
|
+
s.icon('eye', { x: 540, y: 700, size: 105, at: 'vemos', ...quiet });
|
|
149
|
+
[[390,540],[540,470],[690,540]].forEach((p,i)=>ray(s,p,[540+(i-1)*36,647], 'dispersado'));
|
|
150
|
+
label(s, 'Azul dispersado', 540, 795, 'aire', { color: C.blue });
|
|
151
|
+
label(s, 'Al atardecer', 1380, 360, '#tarde', { size: 60, font: 'display', color: C.red });
|
|
152
|
+
horizon(s, 1110, 715, 580, '#tarde');
|
|
153
|
+
sun(s, 1160, 620, '#tarde', 110);
|
|
154
|
+
s.icon('eye', { x: 1630, y: 620, size: 105, at: '#tarde', ...quiet });
|
|
155
|
+
ray(s,[1220,620],[1565,620], 'recorrido', C.orange, {width:9});
|
|
156
|
+
ray(s,[1350,605],[1395,470], 'largo');
|
|
157
|
+
label(s, 'Tonos cálidos', 1380, 795, 'tonos', { color: C.red });
|
|
158
|
+
s.line([[960,365],[960,830]], { at: '#tarde', color: C.blue, opacity:0.2, width:2, ...quiet });
|
|
159
|
+
},
|
|
160
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# ¿Por qué el cielo es azul?
|
|
2
|
+
|
|
3
|
+
## pregunta {chapter="La luz del Sol"}
|
|
4
|
+
[#pregunta] ¿Por qué vemos el cielo azul durante el día? [#respuesta] La respuesta está en la luz del Sol y en el aire.
|
|
5
|
+
|
|
6
|
+
## colores
|
|
7
|
+
[#sol] La luz del Sol contiene todos los colores que podemos ver. [#juntos] Cuando llegan juntos a nuestros ojos, esa mezcla nos parece blanca.
|
|
8
|
+
|
|
9
|
+
## moleculas {chapter="El papel del aire"}
|
|
10
|
+
[#aire] El aire está formado por moléculas, partículas diminutas que interactúan con la luz. [#desvio] Al hacerlo, desvían parte de esa luz hacia otras direcciones. [#nombre] Eso se llama dispersión.
|
|
11
|
+
|
|
12
|
+
## ondas
|
|
13
|
+
[#ondas] Cada color tiene una longitud de onda, la distancia entre dos crestas de la luz. [#azul] Las moléculas dispersan mucho más las ondas cortas, como el azul, [#rojo] que las largas, como el rojo.
|
|
14
|
+
|
|
15
|
+
## ojos
|
|
16
|
+
[#cielo] Esa luz azul dispersada llega a nuestros ojos desde todas las direcciones del cielo. [#mirada] Por eso vemos azul incluso cuando miramos lejos del Sol.
|
|
17
|
+
|
|
18
|
+
## ocaso {chapter="El cielo al atardecer"}
|
|
19
|
+
[#bajo] Al atardecer, el Sol está bajo y su luz atraviesa más aire. [#fuera] En ese recorrido, más azul se dispersa fuera del camino. [#calidos] La luz que llega conserva más rojos y naranjas.
|
|
20
|
+
|
|
21
|
+
## cierre {hold=1.5}
|
|
22
|
+
[#dia] De día vemos el azul dispersado por el aire. [#tarde] Al atardecer, el recorrido más largo favorece los tonos cálidos.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "¿Por qué el cielo es azul?",
|
|
3
|
+
"theme": "paper",
|
|
4
|
+
"size": "youtube",
|
|
5
|
+
"voice": "ef_dora",
|
|
6
|
+
"music": {
|
|
7
|
+
"style": "warm",
|
|
8
|
+
"volume": 0.1
|
|
9
|
+
},
|
|
10
|
+
"captions": true,
|
|
11
|
+
"language": "es",
|
|
12
|
+
"sfx": "minimal",
|
|
13
|
+
"transition": "fade",
|
|
14
|
+
"cover": "pregunta@end"
|
|
15
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|