videowright 0.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/README.md +91 -0
- package/dist/cli/argv.d.ts +28 -0
- package/dist/cli/argv.d.ts.map +1 -0
- package/dist/cli/argv.js +115 -0
- package/dist/cli/argv.js.map +1 -0
- package/dist/cli/bin.d.ts +7 -0
- package/dist/cli/bin.d.ts.map +1 -0
- package/dist/cli/bin.js +10 -0
- package/dist/cli/bin.js.map +1 -0
- package/dist/cli/dev.d.ts +19 -0
- package/dist/cli/dev.d.ts.map +1 -0
- package/dist/cli/dev.js +104 -0
- package/dist/cli/dev.js.map +1 -0
- package/dist/cli/discover.d.ts +29 -0
- package/dist/cli/discover.d.ts.map +1 -0
- package/dist/cli/discover.js +104 -0
- package/dist/cli/discover.js.map +1 -0
- package/dist/cli/discover_project.d.ts +29 -0
- package/dist/cli/discover_project.d.ts.map +1 -0
- package/dist/cli/discover_project.js +108 -0
- package/dist/cli/discover_project.js.map +1 -0
- package/dist/cli/errors.d.ts +10 -0
- package/dist/cli/errors.d.ts.map +1 -0
- package/dist/cli/errors.js +13 -0
- package/dist/cli/errors.js.map +1 -0
- package/dist/cli/ffmpeg.d.ts +57 -0
- package/dist/cli/ffmpeg.d.ts.map +1 -0
- package/dist/cli/ffmpeg.js +122 -0
- package/dist/cli/ffmpeg.js.map +1 -0
- package/dist/cli/index.d.ts +7 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +152 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/playwright_check.d.ts +44 -0
- package/dist/cli/playwright_check.d.ts.map +1 -0
- package/dist/cli/playwright_check.js +20 -0
- package/dist/cli/playwright_check.js.map +1 -0
- package/dist/cli/prompt.d.ts +13 -0
- package/dist/cli/prompt.d.ts.map +1 -0
- package/dist/cli/prompt.js +47 -0
- package/dist/cli/prompt.js.map +1 -0
- package/dist/cli/render.d.ts +60 -0
- package/dist/cli/render.d.ts.map +1 -0
- package/dist/cli/render.js +471 -0
- package/dist/cli/render.js.map +1 -0
- package/dist/cli/script_cmd.d.ts +26 -0
- package/dist/cli/script_cmd.d.ts.map +1 -0
- package/dist/cli/script_cmd.js +88 -0
- package/dist/cli/script_cmd.js.map +1 -0
- package/dist/cli/time_shim.d.ts +44 -0
- package/dist/cli/time_shim.d.ts.map +1 -0
- package/dist/cli/time_shim.js +390 -0
- package/dist/cli/time_shim.js.map +1 -0
- package/dist/cli/ts_loader.d.ts +28 -0
- package/dist/cli/ts_loader.d.ts.map +1 -0
- package/dist/cli/ts_loader.js +95 -0
- package/dist/cli/ts_loader.js.map +1 -0
- package/dist/cli/vite_helpers.d.ts +62 -0
- package/dist/cli/vite_helpers.d.ts.map +1 -0
- package/dist/cli/vite_helpers.js +273 -0
- package/dist/cli/vite_helpers.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/player/hash_router.d.ts +23 -0
- package/dist/player/hash_router.d.ts.map +1 -0
- package/dist/player/hash_router.js +49 -0
- package/dist/player/hash_router.js.map +1 -0
- package/dist/player/hud.d.ts +33 -0
- package/dist/player/hud.d.ts.map +1 -0
- package/dist/player/hud.js +357 -0
- package/dist/player/hud.js.map +1 -0
- package/dist/player/index.d.ts +123 -0
- package/dist/player/index.d.ts.map +1 -0
- package/dist/player/index.js +848 -0
- package/dist/player/index.js.map +1 -0
- package/dist/player/input.d.ts +14 -0
- package/dist/player/input.d.ts.map +1 -0
- package/dist/player/input.js +90 -0
- package/dist/player/input.js.map +1 -0
- package/dist/player/slot.d.ts +22 -0
- package/dist/player/slot.d.ts.map +1 -0
- package/dist/player/slot.js +43 -0
- package/dist/player/slot.js.map +1 -0
- package/dist/player/transitions/cut.d.ts +7 -0
- package/dist/player/transitions/cut.d.ts.map +1 -0
- package/dist/player/transitions/cut.js +9 -0
- package/dist/player/transitions/cut.js.map +1 -0
- package/dist/player/transitions/fade.d.ts +7 -0
- package/dist/player/transitions/fade.d.ts.map +1 -0
- package/dist/player/transitions/fade.js +18 -0
- package/dist/player/transitions/fade.js.map +1 -0
- package/dist/player/transitions/index.d.ts +4 -0
- package/dist/player/transitions/index.d.ts.map +1 -0
- package/dist/player/transitions/index.js +4 -0
- package/dist/player/transitions/index.js.map +1 -0
- package/dist/player/transitions/slide.d.ts +6 -0
- package/dist/player/transitions/slide.d.ts.map +1 -0
- package/dist/player/transitions/slide.js +35 -0
- package/dist/player/transitions/slide.js.map +1 -0
- package/dist/script/index.d.ts +2 -0
- package/dist/script/index.d.ts.map +1 -0
- package/dist/script/index.js +2 -0
- package/dist/script/index.js.map +1 -0
- package/dist/script/script.d.ts +10 -0
- package/dist/script/script.d.ts.map +1 -0
- package/dist/script/script.js +41 -0
- package/dist/script/script.js.map +1 -0
- package/dist/segment/SegmentRunner.d.ts +52 -0
- package/dist/segment/SegmentRunner.d.ts.map +1 -0
- package/dist/segment/SegmentRunner.js +187 -0
- package/dist/segment/SegmentRunner.js.map +1 -0
- package/dist/segment/defineConfig.d.ts +6 -0
- package/dist/segment/defineConfig.d.ts.map +1 -0
- package/dist/segment/defineConfig.js +7 -0
- package/dist/segment/defineConfig.js.map +1 -0
- package/dist/segment/defineSegment.d.ts +7 -0
- package/dist/segment/defineSegment.d.ts.map +1 -0
- package/dist/segment/defineSegment.js +25 -0
- package/dist/segment/defineSegment.js.map +1 -0
- package/dist/segment/index.d.ts +5 -0
- package/dist/segment/index.d.ts.map +1 -0
- package/dist/segment/index.js +4 -0
- package/dist/segment/index.js.map +1 -0
- package/dist/timeline/index.d.ts +73 -0
- package/dist/timeline/index.d.ts.map +1 -0
- package/dist/timeline/index.js +142 -0
- package/dist/timeline/index.js.map +1 -0
- package/dist/timeline/loadAudioTrack.d.ts +18 -0
- package/dist/timeline/loadAudioTrack.d.ts.map +1 -0
- package/dist/timeline/loadAudioTrack.js +44 -0
- package/dist/timeline/loadAudioTrack.js.map +1 -0
- package/dist/timeline/loadVoiceover.d.ts +18 -0
- package/dist/timeline/loadVoiceover.d.ts.map +1 -0
- package/dist/timeline/loadVoiceover.js +38 -0
- package/dist/timeline/loadVoiceover.js.map +1 -0
- package/dist/timeline/resolveTiming.d.ts +28 -0
- package/dist/timeline/resolveTiming.d.ts.map +1 -0
- package/dist/timeline/resolveTiming.js +63 -0
- package/dist/timeline/resolveTiming.js.map +1 -0
- package/dist/timeline/validateTiming.d.ts +29 -0
- package/dist/timeline/validateTiming.d.ts.map +1 -0
- package/dist/timeline/validateTiming.js +62 -0
- package/dist/timeline/validateTiming.js.map +1 -0
- package/dist/types.d.ts +216 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +6 -0
- package/dist/types.js.map +1 -0
- package/package.json +47 -0
- package/skill/SKILL.md +64 -0
- package/skill/assets/hello_world/PLAN.md +31 -0
- package/skill/assets/hello_world/README.md +27 -0
- package/skill/assets/hello_world/audio/audio_plan.md +14 -0
- package/skill/assets/hello_world/segments/hello_intro.ts +69 -0
- package/skill/assets/hello_world/segments/hello_outro.ts +71 -0
- package/skill/assets/hello_world/timeline.ts +15 -0
- package/skill/assets/hello_world/voiceover_script/script.md +10 -0
- package/skill/assets/install/package.json +10 -0
- package/skill/assets/install/tsconfig.json +23 -0
- package/skill/assets/styles/editorial-mono/STYLE.md +124 -0
- package/skill/assets/styles/editorial-mono/brand.md +85 -0
- package/skill/assets/styles/editorial-mono/reference/animations.jsx +752 -0
- package/skill/assets/styles/editorial-mono/reference/scenes.html +563 -0
- package/skill/assets/styles/editorial-mono/sample/bullet.ts +101 -0
- package/skill/assets/styles/editorial-mono/sample/content.ts +104 -0
- package/skill/assets/styles/editorial-mono/sample/cta.ts +113 -0
- package/skill/assets/styles/editorial-mono/sample/feature.ts +111 -0
- package/skill/assets/styles/editorial-mono/sample/grid.ts +97 -0
- package/skill/assets/styles/editorial-mono/sample/kinetic.ts +96 -0
- package/skill/assets/styles/editorial-mono/sample/section.ts +101 -0
- package/skill/assets/styles/editorial-mono/sample/stat.ts +128 -0
- package/skill/assets/styles/editorial-mono/sample/title.ts +97 -0
- package/skill/assets/styles/editorial-mono/sample/ui-showcase.ts +159 -0
- package/skill/assets/styles/editorial-mono/tokens.css +44 -0
- package/skill/assets/styles/iso-diagram/STYLE.md +109 -0
- package/skill/assets/styles/iso-diagram/brand.md +32 -0
- package/skill/assets/styles/iso-diagram/reference/animations.jsx +673 -0
- package/skill/assets/styles/iso-diagram/reference/scenes.html +427 -0
- package/skill/assets/styles/iso-diagram/sample/bullet.ts +144 -0
- package/skill/assets/styles/iso-diagram/sample/content.ts +192 -0
- package/skill/assets/styles/iso-diagram/sample/cta.ts +162 -0
- package/skill/assets/styles/iso-diagram/sample/feature.ts +205 -0
- package/skill/assets/styles/iso-diagram/sample/grid.ts +181 -0
- package/skill/assets/styles/iso-diagram/sample/kinetic.ts +102 -0
- package/skill/assets/styles/iso-diagram/sample/section.ts +149 -0
- package/skill/assets/styles/iso-diagram/sample/stat.ts +164 -0
- package/skill/assets/styles/iso-diagram/sample/title.ts +173 -0
- package/skill/assets/styles/iso-diagram/sample/ui-showcase.ts +162 -0
- package/skill/assets/styles/iso-diagram/tokens.css +40 -0
- package/skill/assets/styles/motion-engineering/STYLE.md +106 -0
- package/skill/assets/styles/motion-engineering/brand.md +29 -0
- package/skill/assets/styles/motion-engineering/reference/animations.jsx +673 -0
- package/skill/assets/styles/motion-engineering/reference/scenes.html +513 -0
- package/skill/assets/styles/motion-engineering/sample/bullet.ts +176 -0
- package/skill/assets/styles/motion-engineering/sample/content.ts +228 -0
- package/skill/assets/styles/motion-engineering/sample/cta.ts +209 -0
- package/skill/assets/styles/motion-engineering/sample/feature.ts +299 -0
- package/skill/assets/styles/motion-engineering/sample/grid.ts +190 -0
- package/skill/assets/styles/motion-engineering/sample/kinetic.ts +159 -0
- package/skill/assets/styles/motion-engineering/sample/section.ts +196 -0
- package/skill/assets/styles/motion-engineering/sample/stat.ts +230 -0
- package/skill/assets/styles/motion-engineering/sample/title.ts +219 -0
- package/skill/assets/styles/motion-engineering/sample/ui-showcase.ts +267 -0
- package/skill/assets/styles/motion-engineering/tokens.css +40 -0
- package/skill/assets/styles/neon-terminal/STYLE.md +105 -0
- package/skill/assets/styles/neon-terminal/brand.md +27 -0
- package/skill/assets/styles/neon-terminal/reference/animations.jsx +673 -0
- package/skill/assets/styles/neon-terminal/reference/scenes.html +387 -0
- package/skill/assets/styles/neon-terminal/sample/bullet.ts +113 -0
- package/skill/assets/styles/neon-terminal/sample/content.ts +117 -0
- package/skill/assets/styles/neon-terminal/sample/cta.ts +131 -0
- package/skill/assets/styles/neon-terminal/sample/feature.ts +112 -0
- package/skill/assets/styles/neon-terminal/sample/grid.ts +128 -0
- package/skill/assets/styles/neon-terminal/sample/kinetic.ts +105 -0
- package/skill/assets/styles/neon-terminal/sample/section.ts +96 -0
- package/skill/assets/styles/neon-terminal/sample/stat.ts +123 -0
- package/skill/assets/styles/neon-terminal/sample/title.ts +122 -0
- package/skill/assets/styles/neon-terminal/sample/ui-showcase.ts +127 -0
- package/skill/assets/styles/neon-terminal/tokens.css +39 -0
- package/skill/assets/styles/risograph/STYLE.md +110 -0
- package/skill/assets/styles/risograph/brand.md +26 -0
- package/skill/assets/styles/risograph/reference/animations.jsx +673 -0
- package/skill/assets/styles/risograph/reference/scenes.html +403 -0
- package/skill/assets/styles/risograph/sample/bullet.ts +124 -0
- package/skill/assets/styles/risograph/sample/content.ts +135 -0
- package/skill/assets/styles/risograph/sample/cta.ts +149 -0
- package/skill/assets/styles/risograph/sample/feature.ts +152 -0
- package/skill/assets/styles/risograph/sample/grid.ts +123 -0
- package/skill/assets/styles/risograph/sample/kinetic.ts +125 -0
- package/skill/assets/styles/risograph/sample/section.ts +130 -0
- package/skill/assets/styles/risograph/sample/stat.ts +145 -0
- package/skill/assets/styles/risograph/sample/title.ts +132 -0
- package/skill/assets/styles/risograph/sample/ui-showcase.ts +147 -0
- package/skill/assets/styles/risograph/tokens.css +39 -0
- package/skill/assets/styles/swiss-console/STYLE.md +107 -0
- package/skill/assets/styles/swiss-console/brand.md +37 -0
- package/skill/assets/styles/swiss-console/reference/animations.jsx +673 -0
- package/skill/assets/styles/swiss-console/reference/scenes.html +420 -0
- package/skill/assets/styles/swiss-console/sample/bullet.ts +122 -0
- package/skill/assets/styles/swiss-console/sample/content.ts +137 -0
- package/skill/assets/styles/swiss-console/sample/cta.ts +109 -0
- package/skill/assets/styles/swiss-console/sample/feature.ts +163 -0
- package/skill/assets/styles/swiss-console/sample/grid.ts +145 -0
- package/skill/assets/styles/swiss-console/sample/kinetic.ts +117 -0
- package/skill/assets/styles/swiss-console/sample/section.ts +127 -0
- package/skill/assets/styles/swiss-console/sample/stat.ts +148 -0
- package/skill/assets/styles/swiss-console/sample/title.ts +148 -0
- package/skill/assets/styles/swiss-console/sample/ui-showcase.ts +198 -0
- package/skill/assets/styles/swiss-console/tokens.css +39 -0
- package/skill/install/INSTALL.md +400 -0
- package/skill/references/audio/audio_plan.md +199 -0
- package/skill/references/audio/build.md +208 -0
- package/skill/references/audio/cue_template.md +219 -0
- package/skill/references/audio/ffmpeg_cookbook.md +267 -0
- package/skill/references/audio/music/music.md +171 -0
- package/skill/references/audio/music/providers/elevenlabs.md +170 -0
- package/skill/references/audio/music/providers/manual.md +140 -0
- package/skill/references/audio/music/providers/openverse.md +265 -0
- package/skill/references/audio/sfx/providers/elevenlabs.md +152 -0
- package/skill/references/audio/sfx/providers/manual.md +117 -0
- package/skill/references/audio/sfx/providers/openverse.md +243 -0
- package/skill/references/audio/sfx/sfx.md +149 -0
- package/skill/references/audio/styles.md +102 -0
- package/skill/references/audio/sync.md +237 -0
- package/skill/references/audio/voiceover/animation_sync.md +142 -0
- package/skill/references/audio/voiceover/provider_script.md +153 -0
- package/skill/references/audio/voiceover/providers/elevenlabs.md +288 -0
- package/skill/references/audio/voiceover/providers/manual.md +100 -0
- package/skill/references/audio/voiceover/script_writing.md +100 -0
- package/skill/references/audio/voiceover/style_intake.md +56 -0
- package/skill/references/audio/voiceover/sync_algorithm.md +167 -0
- package/skill/references/audio/voiceover.md +296 -0
- package/skill/references/audio.md +135 -0
- package/skill/references/authoring_segment.md +446 -0
- package/skill/references/create_or_edit_video.md +232 -0
- package/skill/references/dev_server.md +157 -0
- package/skill/references/export.md +145 -0
- package/skill/references/new_video.md +117 -0
- package/skill/references/project_structure.md +144 -0
- package/skill/references/setup.md +109 -0
- package/skill/references/setup_new_style.md +158 -0
- package/skill/references/styles.md +154 -0
- package/skill/references/testing.md +115 -0
- package/skill/references/types.md +240 -0
- package/src/cli/entry/components/copy_button.ts +42 -0
- package/src/cli/entry/components/download_modal.ts +204 -0
- package/src/cli/entry/components/empty_state.ts +55 -0
- package/src/cli/entry/components/hide_hud_tab.ts +37 -0
- package/src/cli/entry/components/icons.ts +31 -0
- package/src/cli/entry/components/top_bar.ts +69 -0
- package/src/cli/entry/components/video_card.ts +57 -0
- package/src/cli/entry/dev_frame.ts +189 -0
- package/src/cli/entry/entry_index.ts +16 -0
- package/src/cli/entry/entry_video.ts +24 -0
- package/src/cli/entry/index.html +12 -0
- package/src/cli/entry/parse_slug.ts +14 -0
- package/src/cli/entry/render.html +17 -0
- package/src/cli/entry/render_entry.ts +121 -0
- package/src/cli/entry/styles/base.css +45 -0
- package/src/cli/entry/styles/components.css +605 -0
- package/src/cli/entry/styles/tokens.css +44 -0
- package/src/cli/entry/video.html +22 -0
- package/src/cli/entry/views/homepage.ts +66 -0
- package/src/cli/entry/views/video_view.ts +286 -0
- package/src/cli/entry/virtual.d.ts +8 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { defineSegment } from "videowright";
|
|
2
|
+
|
|
3
|
+
let host: HTMLElement | null = null;
|
|
4
|
+
|
|
5
|
+
export default defineSegment({
|
|
6
|
+
id: "iso-diagram-sample-grid",
|
|
7
|
+
advances: [2.5, 5.0],
|
|
8
|
+
voiceover:
|
|
9
|
+
"Card grids in Iso Diagram. Three isometric mini-diagrams in a row, each framed with a hand-drawn box and a labeled cube inside.",
|
|
10
|
+
|
|
11
|
+
mount(el) {
|
|
12
|
+
host = el;
|
|
13
|
+
|
|
14
|
+
const cards = [
|
|
15
|
+
{ name: "Memory", fill: "var(--fill-blue)", desc: "~ remembers ~" },
|
|
16
|
+
{ name: "Reasoning", fill: "var(--fill-yellow)", desc: "~ revises ~" },
|
|
17
|
+
{ name: "Recovery", fill: "var(--fill-green)", desc: "~ rewinds ~" },
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
const cardHtml = cards
|
|
21
|
+
.map(
|
|
22
|
+
(c, i) => `
|
|
23
|
+
<div data-ref="card${i}" style="
|
|
24
|
+
position: relative;
|
|
25
|
+
height: 540px;
|
|
26
|
+
opacity: 0;
|
|
27
|
+
">
|
|
28
|
+
<svg style="position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible;">
|
|
29
|
+
<path data-ref="frame${i}" d="M 8 8 L 528 12 L 524 528 L 12 524 Z" stroke="var(--color-fg)" stroke-width="2.4" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="2100" stroke-dashoffset="2100" />
|
|
30
|
+
</svg>
|
|
31
|
+
<svg width="100%" height="280" style="overflow: visible;">
|
|
32
|
+
<g transform="translate(170,80)">
|
|
33
|
+
<polygon data-ref="cubeTop${i}" points="0,45 90,0 180,45 90,90" fill="${c.fill}" opacity="0" />
|
|
34
|
+
<polygon data-ref="cubeLeft${i}" points="0,45 90,90 90,135 0,90" fill="${c.fill}" opacity="0" />
|
|
35
|
+
<polygon data-ref="cubeRight${i}" points="90,90 180,45 180,90 90,135" fill="${c.fill}" opacity="0" />
|
|
36
|
+
<path data-ref="cubeOutlineA${i}" d="M0,45 L90,0 L180,45 L90,90 Z" stroke="var(--color-fg)" stroke-width="2.4" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="400" stroke-dashoffset="400" />
|
|
37
|
+
<path data-ref="cubeOutlineB${i}" d="M0,45 L90,90 L90,135 L0,90 Z" stroke="var(--color-fg)" stroke-width="2.4" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="400" stroke-dashoffset="400" />
|
|
38
|
+
<path data-ref="cubeOutlineC${i}" d="M90,90 L180,45 L180,90 L90,135 Z" stroke="var(--color-fg)" stroke-width="2.4" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="400" stroke-dashoffset="400" />
|
|
39
|
+
</g>
|
|
40
|
+
</svg>
|
|
41
|
+
<div style="font-family: var(--font-display); font-size: 80px; text-align: center; margin-top: 24px;">${c.name}</div>
|
|
42
|
+
<div style="font-family: var(--font-display); font-size: 40px; text-align: center; margin-top: -4px; color: var(--color-muted);">${c.desc}</div>
|
|
43
|
+
</div>`,
|
|
44
|
+
)
|
|
45
|
+
.join("");
|
|
46
|
+
|
|
47
|
+
el.innerHTML = `
|
|
48
|
+
<div style="
|
|
49
|
+
position: relative;
|
|
50
|
+
height: 100%;
|
|
51
|
+
background: var(--color-bg);
|
|
52
|
+
color: var(--color-fg);
|
|
53
|
+
font-family: var(--font-body);
|
|
54
|
+
overflow: hidden;
|
|
55
|
+
">
|
|
56
|
+
<div style="
|
|
57
|
+
position: absolute; inset: 0; pointer-events: none;
|
|
58
|
+
background-image: radial-gradient(circle, rgba(42,38,32,0.10) 1px, transparent 1.6px);
|
|
59
|
+
background-size: 32px 32px;
|
|
60
|
+
"></div>
|
|
61
|
+
|
|
62
|
+
<div data-ref="heading" style="
|
|
63
|
+
position: absolute;
|
|
64
|
+
left: 140px;
|
|
65
|
+
top: 120px;
|
|
66
|
+
opacity: 0;
|
|
67
|
+
">
|
|
68
|
+
<div style="font-family: var(--font-display); font-size: 130px;">Three primitives.</div>
|
|
69
|
+
<svg style="margin-top: 8px;" width="520" height="14">
|
|
70
|
+
<path data-ref="headingUnderline" d="M 0 6 q 86 -8 172 0 t 172 0 t 172 0" stroke="var(--color-accent)" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-dasharray="600" stroke-dashoffset="600" />
|
|
71
|
+
</svg>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
<div style="
|
|
75
|
+
position: absolute; left: 140px; right: 140px; top: 400px;
|
|
76
|
+
display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 56px;
|
|
77
|
+
">
|
|
78
|
+
${cardHtml}
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
<div data-ref="counter" style="
|
|
82
|
+
position: absolute;
|
|
83
|
+
right: var(--safe-x);
|
|
84
|
+
top: 36px;
|
|
85
|
+
font-family: var(--font-display);
|
|
86
|
+
font-size: 28px;
|
|
87
|
+
color: var(--color-muted);
|
|
88
|
+
transform: rotate(-2deg);
|
|
89
|
+
opacity: 0;
|
|
90
|
+
">~ scene 7 of 10 ~</div>
|
|
91
|
+
</div>
|
|
92
|
+
`;
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
async play(ctx) {
|
|
96
|
+
const heading = host?.querySelector('[data-ref="heading"]') as HTMLElement;
|
|
97
|
+
const headingUnderline = host?.querySelector('[data-ref="headingUnderline"]') as SVGPathElement;
|
|
98
|
+
const counter = host?.querySelector('[data-ref="counter"]') as HTMLElement;
|
|
99
|
+
|
|
100
|
+
const ease = "cubic-bezier(0.34, 1.2, 0.64, 1)";
|
|
101
|
+
const opts = { fill: "forwards" as const, easing: ease };
|
|
102
|
+
|
|
103
|
+
counter.animate([{ opacity: 0 }, { opacity: 1 }], { ...opts, duration: 300 });
|
|
104
|
+
|
|
105
|
+
heading.animate(
|
|
106
|
+
[
|
|
107
|
+
{ opacity: 0, transform: "translateY(12px)" },
|
|
108
|
+
{ opacity: 1, transform: "translateY(0)" },
|
|
109
|
+
],
|
|
110
|
+
{ ...opts, duration: 350, delay: 300 },
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
headingUnderline.animate([{ strokeDashoffset: "600" }, { strokeDashoffset: "0" }], {
|
|
114
|
+
...opts,
|
|
115
|
+
duration: 500,
|
|
116
|
+
delay: 700,
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
for (let i = 0; i < 3; i++) {
|
|
120
|
+
const card = host?.querySelector(`[data-ref="card${i}"]`) as HTMLElement;
|
|
121
|
+
const frame = host?.querySelector(`[data-ref="frame${i}"]`) as SVGPathElement;
|
|
122
|
+
const outA = host?.querySelector(`[data-ref="cubeOutlineA${i}"]`) as SVGPathElement;
|
|
123
|
+
const outB = host?.querySelector(`[data-ref="cubeOutlineB${i}"]`) as SVGPathElement;
|
|
124
|
+
const outC = host?.querySelector(`[data-ref="cubeOutlineC${i}"]`) as SVGPathElement;
|
|
125
|
+
const top = host?.querySelector(`[data-ref="cubeTop${i}"]`) as SVGPolygonElement;
|
|
126
|
+
const left = host?.querySelector(`[data-ref="cubeLeft${i}"]`) as SVGPolygonElement;
|
|
127
|
+
const right = host?.querySelector(`[data-ref="cubeRight${i}"]`) as SVGPolygonElement;
|
|
128
|
+
|
|
129
|
+
const base = 900 + i * 200;
|
|
130
|
+
|
|
131
|
+
card.animate([{ opacity: 0 }, { opacity: 1 }], { ...opts, duration: 250, delay: base });
|
|
132
|
+
|
|
133
|
+
// Frame draws on
|
|
134
|
+
frame.animate([{ strokeDashoffset: "2100" }, { strokeDashoffset: "0" }], {
|
|
135
|
+
...opts,
|
|
136
|
+
duration: 600,
|
|
137
|
+
delay: base,
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
// Cube outlines draw on
|
|
141
|
+
outA.animate([{ strokeDashoffset: "400" }, { strokeDashoffset: "0" }], {
|
|
142
|
+
...opts,
|
|
143
|
+
duration: 400,
|
|
144
|
+
delay: base + 200,
|
|
145
|
+
});
|
|
146
|
+
outB.animate([{ strokeDashoffset: "400" }, { strokeDashoffset: "0" }], {
|
|
147
|
+
...opts,
|
|
148
|
+
duration: 400,
|
|
149
|
+
delay: base + 350,
|
|
150
|
+
});
|
|
151
|
+
outC.animate([{ strokeDashoffset: "400" }, { strokeDashoffset: "0" }], {
|
|
152
|
+
...opts,
|
|
153
|
+
duration: 400,
|
|
154
|
+
delay: base + 350,
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
// Fills flood in
|
|
158
|
+
top.animate([{ opacity: 0 }, { opacity: 0.9 }], {
|
|
159
|
+
...opts,
|
|
160
|
+
duration: 400,
|
|
161
|
+
delay: base + 550,
|
|
162
|
+
});
|
|
163
|
+
left.animate([{ opacity: 0 }, { opacity: 0.65 }], {
|
|
164
|
+
...opts,
|
|
165
|
+
duration: 400,
|
|
166
|
+
delay: base + 600,
|
|
167
|
+
});
|
|
168
|
+
right.animate([{ opacity: 0 }, { opacity: 0.5 }], {
|
|
169
|
+
...opts,
|
|
170
|
+
duration: 400,
|
|
171
|
+
delay: base + 600,
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
await ctx.waitForNext();
|
|
176
|
+
},
|
|
177
|
+
|
|
178
|
+
unmount() {
|
|
179
|
+
host = null;
|
|
180
|
+
},
|
|
181
|
+
});
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { defineSegment } from "videowright";
|
|
2
|
+
|
|
3
|
+
let host: HTMLElement | null = null;
|
|
4
|
+
|
|
5
|
+
export default defineSegment({
|
|
6
|
+
id: "iso-diagram-sample-kinetic",
|
|
7
|
+
advances: [2.5, 5.0],
|
|
8
|
+
voiceover:
|
|
9
|
+
"Kinetic statements in Iso Diagram. Words appear one at a time in handwriting, the last circled with a hand-drawn ellipse.",
|
|
10
|
+
|
|
11
|
+
mount(el) {
|
|
12
|
+
host = el;
|
|
13
|
+
el.innerHTML = `
|
|
14
|
+
<div style="
|
|
15
|
+
position: relative;
|
|
16
|
+
height: 100%;
|
|
17
|
+
background: var(--color-bg);
|
|
18
|
+
color: var(--color-fg);
|
|
19
|
+
font-family: var(--font-body);
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
">
|
|
22
|
+
<div style="
|
|
23
|
+
position: absolute; inset: 0; pointer-events: none;
|
|
24
|
+
background-image: radial-gradient(circle, rgba(42,38,32,0.10) 1px, transparent 1.6px);
|
|
25
|
+
background-size: 32px 32px;
|
|
26
|
+
"></div>
|
|
27
|
+
|
|
28
|
+
<div style="
|
|
29
|
+
position: absolute;
|
|
30
|
+
left: 140px;
|
|
31
|
+
top: 280px;
|
|
32
|
+
width: 1640px;
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-wrap: wrap;
|
|
35
|
+
column-gap: 32px;
|
|
36
|
+
row-gap: 12px;
|
|
37
|
+
font-family: var(--font-display);
|
|
38
|
+
font-size: 200px;
|
|
39
|
+
line-height: 1.05;
|
|
40
|
+
">
|
|
41
|
+
<span data-ref="w0" style="opacity: 0; display: inline-block;">Most</span>
|
|
42
|
+
<span data-ref="w1" style="opacity: 0; display: inline-block;">agents</span>
|
|
43
|
+
<span data-ref="w2" style="opacity: 0; display: inline-block;">fail</span>
|
|
44
|
+
<span data-ref="w3" style="opacity: 0; display: inline-block;">because</span>
|
|
45
|
+
<span data-ref="w4" style="opacity: 0; display: inline-block;">they</span>
|
|
46
|
+
<span data-ref="w5" style="opacity: 0; display: inline-block; position: relative; color: var(--color-accent);">forget.
|
|
47
|
+
<svg data-ref="ellipse" style="position: absolute; inset: -28px; width: calc(100% + 56px); height: calc(100% + 56px); overflow: visible;">
|
|
48
|
+
<path data-ref="ellipsePath" d="M 20 100 q 0 -95 150 -95 t 150 95 t -150 95 t -150 -95 Z" stroke="var(--color-accent)" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-dasharray="1000" stroke-dashoffset="1000" />
|
|
49
|
+
</svg>
|
|
50
|
+
</span>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<div data-ref="counter" style="
|
|
54
|
+
position: absolute;
|
|
55
|
+
right: var(--safe-x);
|
|
56
|
+
top: 36px;
|
|
57
|
+
font-family: var(--font-display);
|
|
58
|
+
font-size: 28px;
|
|
59
|
+
color: var(--color-muted);
|
|
60
|
+
transform: rotate(-2deg);
|
|
61
|
+
opacity: 0;
|
|
62
|
+
">~ scene 3 of 10 ~</div>
|
|
63
|
+
</div>
|
|
64
|
+
`;
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
async play(ctx) {
|
|
68
|
+
const counter = host?.querySelector('[data-ref="counter"]') as HTMLElement;
|
|
69
|
+
const ellipsePath = host?.querySelector('[data-ref="ellipsePath"]') as SVGPathElement;
|
|
70
|
+
|
|
71
|
+
const ease = "cubic-bezier(0.34, 1.2, 0.64, 1)";
|
|
72
|
+
const opts = { fill: "forwards" as const, easing: ease };
|
|
73
|
+
|
|
74
|
+
counter.animate([{ opacity: 0 }, { opacity: 1 }], { ...opts, duration: 300 });
|
|
75
|
+
|
|
76
|
+
// Words swing in one at a time with slight alternating rotation
|
|
77
|
+
for (let i = 0; i < 6; i++) {
|
|
78
|
+
const word = host?.querySelector(`[data-ref="w${i}"]`) as HTMLElement;
|
|
79
|
+
const rot = i % 2 === 0 ? -1.5 : 1.5;
|
|
80
|
+
word.animate(
|
|
81
|
+
[
|
|
82
|
+
{ opacity: 0, transform: `rotate(${rot}deg) translateY(12px)` },
|
|
83
|
+
{ opacity: 1, transform: "rotate(0deg) translateY(0)" },
|
|
84
|
+
],
|
|
85
|
+
{ ...opts, duration: 300, delay: 400 + i * 220 },
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Ellipse draws on around the last word
|
|
90
|
+
ellipsePath.animate([{ strokeDashoffset: "1000" }, { strokeDashoffset: "0" }], {
|
|
91
|
+
...opts,
|
|
92
|
+
duration: 700,
|
|
93
|
+
delay: 1800,
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
await ctx.waitForNext();
|
|
97
|
+
},
|
|
98
|
+
|
|
99
|
+
unmount() {
|
|
100
|
+
host = null;
|
|
101
|
+
},
|
|
102
|
+
});
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { defineSegment } from "videowright";
|
|
2
|
+
|
|
3
|
+
let host: HTMLElement | null = null;
|
|
4
|
+
|
|
5
|
+
export default defineSegment({
|
|
6
|
+
id: "iso-diagram-sample-section",
|
|
7
|
+
advances: [2.5, 5.0],
|
|
8
|
+
voiceover:
|
|
9
|
+
"Section headers in Iso Diagram. A big handwritten chapter number with the section title below and a curly underline that draws itself on.",
|
|
10
|
+
|
|
11
|
+
mount(el) {
|
|
12
|
+
host = el;
|
|
13
|
+
el.innerHTML = `
|
|
14
|
+
<div style="
|
|
15
|
+
position: relative;
|
|
16
|
+
height: 100%;
|
|
17
|
+
background: var(--color-bg);
|
|
18
|
+
color: var(--color-fg);
|
|
19
|
+
font-family: var(--font-body);
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
">
|
|
22
|
+
<div style="
|
|
23
|
+
position: absolute; inset: 0; pointer-events: none;
|
|
24
|
+
background-image: radial-gradient(circle, rgba(42,38,32,0.10) 1px, transparent 1.6px);
|
|
25
|
+
background-size: 32px 32px;
|
|
26
|
+
"></div>
|
|
27
|
+
|
|
28
|
+
<div data-ref="chapter" style="
|
|
29
|
+
position: absolute;
|
|
30
|
+
left: var(--safe-x);
|
|
31
|
+
top: 180px;
|
|
32
|
+
font-family: var(--font-display);
|
|
33
|
+
font-size: 80px;
|
|
34
|
+
color: var(--color-muted);
|
|
35
|
+
opacity: 0;
|
|
36
|
+
transform: rotate(-3deg);
|
|
37
|
+
">Chapter</div>
|
|
38
|
+
|
|
39
|
+
<div data-ref="number" style="
|
|
40
|
+
position: absolute;
|
|
41
|
+
left: var(--safe-x);
|
|
42
|
+
top: 260px;
|
|
43
|
+
font-family: var(--font-display);
|
|
44
|
+
font-size: 420px;
|
|
45
|
+
line-height: 0.9;
|
|
46
|
+
color: var(--color-accent);
|
|
47
|
+
opacity: 0;
|
|
48
|
+
">02</div>
|
|
49
|
+
|
|
50
|
+
<div data-ref="title" style="
|
|
51
|
+
position: absolute;
|
|
52
|
+
left: calc(var(--safe-x) + 400px);
|
|
53
|
+
top: 380px;
|
|
54
|
+
font-family: var(--font-display);
|
|
55
|
+
font-size: 160px;
|
|
56
|
+
opacity: 0;
|
|
57
|
+
">The architecture.</div>
|
|
58
|
+
|
|
59
|
+
<svg data-ref="underlineSvg" style="position: absolute; left: calc(var(--safe-x) + 400px); top: 580px;" width="720" height="14">
|
|
60
|
+
<path data-ref="underline" d="M 0 6 q 120 -8 240 0 t 240 0 t 240 0" stroke="var(--color-fg)" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-dasharray="900" stroke-dashoffset="900" />
|
|
61
|
+
</svg>
|
|
62
|
+
|
|
63
|
+
<div data-ref="caption" style="
|
|
64
|
+
position: absolute;
|
|
65
|
+
left: calc(var(--safe-x) + 400px);
|
|
66
|
+
top: 640px;
|
|
67
|
+
font-family: var(--font-body);
|
|
68
|
+
font-size: 32px;
|
|
69
|
+
color: var(--color-muted);
|
|
70
|
+
opacity: 0;
|
|
71
|
+
">three primitives: memory, reasoning, recovery</div>
|
|
72
|
+
|
|
73
|
+
<div data-ref="counter" style="
|
|
74
|
+
position: absolute;
|
|
75
|
+
right: var(--safe-x);
|
|
76
|
+
top: 36px;
|
|
77
|
+
font-family: var(--font-display);
|
|
78
|
+
font-size: 28px;
|
|
79
|
+
color: var(--color-muted);
|
|
80
|
+
transform: rotate(-2deg);
|
|
81
|
+
opacity: 0;
|
|
82
|
+
">~ scene 2 of 10 ~</div>
|
|
83
|
+
</div>
|
|
84
|
+
`;
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
async play(ctx) {
|
|
88
|
+
const chapter = host?.querySelector('[data-ref="chapter"]') as HTMLElement;
|
|
89
|
+
const number = host?.querySelector('[data-ref="number"]') as HTMLElement;
|
|
90
|
+
const title = host?.querySelector('[data-ref="title"]') as HTMLElement;
|
|
91
|
+
const underline = host?.querySelector('[data-ref="underline"]') as SVGPathElement;
|
|
92
|
+
const caption = host?.querySelector('[data-ref="caption"]') as HTMLElement;
|
|
93
|
+
const counter = host?.querySelector('[data-ref="counter"]') as HTMLElement;
|
|
94
|
+
|
|
95
|
+
const ease = "cubic-bezier(0.34, 1.2, 0.64, 1)";
|
|
96
|
+
const opts = { fill: "forwards" as const, easing: ease };
|
|
97
|
+
|
|
98
|
+
counter.animate([{ opacity: 0 }, { opacity: 1 }], { ...opts, duration: 300 });
|
|
99
|
+
|
|
100
|
+
// Chapter label swings in
|
|
101
|
+
chapter.animate(
|
|
102
|
+
[
|
|
103
|
+
{ opacity: 0, transform: "rotate(-5deg) translateY(12px)" },
|
|
104
|
+
{ opacity: 1, transform: "rotate(-3deg) translateY(0)" },
|
|
105
|
+
],
|
|
106
|
+
{ ...opts, duration: 300, delay: 300 },
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
// Big number
|
|
110
|
+
number.animate(
|
|
111
|
+
[
|
|
112
|
+
{ opacity: 0, transform: "translateY(16px)" },
|
|
113
|
+
{ opacity: 1, transform: "translateY(0)" },
|
|
114
|
+
],
|
|
115
|
+
{ ...opts, duration: 400, delay: 700 },
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
// Section title swings in
|
|
119
|
+
title.animate(
|
|
120
|
+
[
|
|
121
|
+
{ opacity: 0, transform: "rotate(-1deg) translateY(12px)" },
|
|
122
|
+
{ opacity: 1, transform: "rotate(0deg) translateY(0)" },
|
|
123
|
+
],
|
|
124
|
+
{ ...opts, duration: 350, delay: 1300 },
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
// Underline draws on
|
|
128
|
+
underline.animate([{ strokeDashoffset: "900" }, { strokeDashoffset: "0" }], {
|
|
129
|
+
...opts,
|
|
130
|
+
duration: 500,
|
|
131
|
+
delay: 1800,
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
// Caption
|
|
135
|
+
caption.animate(
|
|
136
|
+
[
|
|
137
|
+
{ opacity: 0, transform: "rotate(-1deg) translateY(8px)" },
|
|
138
|
+
{ opacity: 1, transform: "rotate(0deg) translateY(0)" },
|
|
139
|
+
],
|
|
140
|
+
{ ...opts, duration: 300, delay: 2000 },
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
await ctx.waitForNext();
|
|
144
|
+
},
|
|
145
|
+
|
|
146
|
+
unmount() {
|
|
147
|
+
host = null;
|
|
148
|
+
},
|
|
149
|
+
});
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { defineSegment } from "videowright";
|
|
2
|
+
|
|
3
|
+
let host: HTMLElement | null = null;
|
|
4
|
+
|
|
5
|
+
export default defineSegment({
|
|
6
|
+
id: "iso-diagram-sample-stat",
|
|
7
|
+
advances: [2.5, 5.0],
|
|
8
|
+
voiceover:
|
|
9
|
+
"Stat cards in Iso Diagram. A big handwritten number with concentric hand-drawn circles and an arrow leader to a caption.",
|
|
10
|
+
|
|
11
|
+
mount(el) {
|
|
12
|
+
host = el;
|
|
13
|
+
el.innerHTML = `
|
|
14
|
+
<div style="
|
|
15
|
+
position: relative;
|
|
16
|
+
height: 100%;
|
|
17
|
+
background: var(--color-bg);
|
|
18
|
+
color: var(--color-fg);
|
|
19
|
+
font-family: var(--font-body);
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
">
|
|
22
|
+
<div style="
|
|
23
|
+
position: absolute; inset: 0; pointer-events: none;
|
|
24
|
+
background-image: radial-gradient(circle, rgba(42,38,32,0.10) 1px, transparent 1.6px);
|
|
25
|
+
background-size: 32px 32px;
|
|
26
|
+
"></div>
|
|
27
|
+
|
|
28
|
+
<div data-ref="label" style="
|
|
29
|
+
position: absolute;
|
|
30
|
+
left: 140px;
|
|
31
|
+
top: 160px;
|
|
32
|
+
font-family: var(--font-body);
|
|
33
|
+
font-size: 28px;
|
|
34
|
+
letter-spacing: 0.05em;
|
|
35
|
+
color: var(--color-muted);
|
|
36
|
+
opacity: 0;
|
|
37
|
+
">BEACON · failure data, Q1 2026</div>
|
|
38
|
+
|
|
39
|
+
<div style="position: absolute; left: 0; right: 0; top: 280px; text-align: center;">
|
|
40
|
+
<svg style="position: absolute; left: 50%; top: 0; transform: translateX(-50%); overflow: visible;" width="700" height="700">
|
|
41
|
+
<path data-ref="outerCircle" d="M 350 50 a 300 300 0 1 0 0.1 0 Z" stroke="var(--color-accent)" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-dasharray="1900" stroke-dashoffset="1900" />
|
|
42
|
+
<path data-ref="innerCircle" d="M 350 110 a 240 240 0 1 0 0.1 0 Z" stroke="var(--color-muted)" stroke-width="1.8" fill="none" stroke-linecap="round" stroke-dasharray="1520" stroke-dashoffset="1520" />
|
|
43
|
+
</svg>
|
|
44
|
+
|
|
45
|
+
<div data-ref="stat" style="
|
|
46
|
+
position: relative;
|
|
47
|
+
z-index: 1;
|
|
48
|
+
padding-top: 180px;
|
|
49
|
+
font-family: var(--font-display);
|
|
50
|
+
font-size: 340px;
|
|
51
|
+
line-height: 0.9;
|
|
52
|
+
color: var(--color-accent);
|
|
53
|
+
"><span data-ref="digits">0</span>%</div>
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
<svg style="position: absolute; left: 50%; bottom: 260px; transform: translateX(-50%); overflow: visible;" width="200" height="120">
|
|
57
|
+
<path data-ref="leaderArrow" d="M 100 0 Q 130 50 100 100" stroke="var(--color-accent)" stroke-width="2.4" fill="none" stroke-linecap="round" stroke-dasharray="140" stroke-dashoffset="140" />
|
|
58
|
+
<polygon data-ref="arrowHead" points="100,100 93,86 107,86" fill="var(--color-accent)" opacity="0" />
|
|
59
|
+
</svg>
|
|
60
|
+
|
|
61
|
+
<div data-ref="caption" style="
|
|
62
|
+
position: absolute;
|
|
63
|
+
left: 0;
|
|
64
|
+
right: 0;
|
|
65
|
+
bottom: 180px;
|
|
66
|
+
text-align: center;
|
|
67
|
+
opacity: 0;
|
|
68
|
+
">
|
|
69
|
+
<div style="font-family: var(--font-body); font-size: 36px; font-weight: 600; max-width: 1200px; margin: 0 auto;">
|
|
70
|
+
of agent failures happen <span style="color: var(--color-accent);">after</span> the 4th tool call.
|
|
71
|
+
</div>
|
|
72
|
+
<div style="font-family: var(--font-mono); font-size: 18px; color: var(--color-muted); margin-top: 14px;">n=12,840 sessions</div>
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
<div data-ref="counter" style="
|
|
76
|
+
position: absolute;
|
|
77
|
+
right: var(--safe-x);
|
|
78
|
+
top: 36px;
|
|
79
|
+
font-family: var(--font-display);
|
|
80
|
+
font-size: 28px;
|
|
81
|
+
color: var(--color-muted);
|
|
82
|
+
transform: rotate(-2deg);
|
|
83
|
+
opacity: 0;
|
|
84
|
+
">~ scene 5 of 10 ~</div>
|
|
85
|
+
</div>
|
|
86
|
+
`;
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
async play(ctx) {
|
|
90
|
+
const label = host?.querySelector('[data-ref="label"]') as HTMLElement;
|
|
91
|
+
const outerCircle = host?.querySelector('[data-ref="outerCircle"]') as SVGPathElement;
|
|
92
|
+
const innerCircle = host?.querySelector('[data-ref="innerCircle"]') as SVGPathElement;
|
|
93
|
+
const digits = host?.querySelector('[data-ref="digits"]') as HTMLElement;
|
|
94
|
+
const leaderArrow = host?.querySelector('[data-ref="leaderArrow"]') as SVGPathElement;
|
|
95
|
+
const arrowHead = host?.querySelector('[data-ref="arrowHead"]') as SVGPolygonElement;
|
|
96
|
+
const caption = host?.querySelector('[data-ref="caption"]') as HTMLElement;
|
|
97
|
+
const counter = host?.querySelector('[data-ref="counter"]') as HTMLElement;
|
|
98
|
+
|
|
99
|
+
const ease = "cubic-bezier(0.34, 1.2, 0.64, 1)";
|
|
100
|
+
const opts = { fill: "forwards" as const, easing: ease };
|
|
101
|
+
|
|
102
|
+
counter.animate([{ opacity: 0 }, { opacity: 1 }], { ...opts, duration: 300 });
|
|
103
|
+
|
|
104
|
+
label.animate(
|
|
105
|
+
[
|
|
106
|
+
{ opacity: 0, transform: "translateY(8px)" },
|
|
107
|
+
{ opacity: 1, transform: "translateY(0)" },
|
|
108
|
+
],
|
|
109
|
+
{ ...opts, duration: 300, delay: 300 },
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
// Concentric circles draw on
|
|
113
|
+
outerCircle.animate([{ strokeDashoffset: "1900" }, { strokeDashoffset: "0" }], {
|
|
114
|
+
...opts,
|
|
115
|
+
duration: 1000,
|
|
116
|
+
delay: 500,
|
|
117
|
+
});
|
|
118
|
+
innerCircle.animate([{ strokeDashoffset: "1520" }, { strokeDashoffset: "0" }], {
|
|
119
|
+
...opts,
|
|
120
|
+
duration: 1000,
|
|
121
|
+
delay: 800,
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
// Count up from 0 to 84 using ctx.hold (justified ticker exception)
|
|
125
|
+
const target = 84;
|
|
126
|
+
const steps = 30;
|
|
127
|
+
const stepDuration = 900 / steps;
|
|
128
|
+
await ctx.hold(900);
|
|
129
|
+
for (let i = 1; i <= steps; i++) {
|
|
130
|
+
const progress = i / steps;
|
|
131
|
+
const eased = 1 - (1 - progress) ** 3;
|
|
132
|
+
digits.textContent = String(Math.round(eased * target));
|
|
133
|
+
await ctx.hold(stepDuration);
|
|
134
|
+
}
|
|
135
|
+
digits.textContent = String(target);
|
|
136
|
+
|
|
137
|
+
// Leader arrow draws on from circles to caption
|
|
138
|
+
leaderArrow.animate([{ strokeDashoffset: "140" }, { strokeDashoffset: "0" }], {
|
|
139
|
+
...opts,
|
|
140
|
+
duration: 400,
|
|
141
|
+
delay: 0,
|
|
142
|
+
});
|
|
143
|
+
arrowHead.animate([{ opacity: 0 }, { opacity: 1 }], {
|
|
144
|
+
...opts,
|
|
145
|
+
duration: 200,
|
|
146
|
+
delay: 300,
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
// Caption swings in
|
|
150
|
+
caption.animate(
|
|
151
|
+
[
|
|
152
|
+
{ opacity: 0, transform: "rotate(-1deg) translateY(12px)" },
|
|
153
|
+
{ opacity: 1, transform: "rotate(0deg) translateY(0)" },
|
|
154
|
+
],
|
|
155
|
+
{ ...opts, duration: 350, delay: 0 },
|
|
156
|
+
);
|
|
157
|
+
|
|
158
|
+
await ctx.waitForNext();
|
|
159
|
+
},
|
|
160
|
+
|
|
161
|
+
unmount() {
|
|
162
|
+
host = null;
|
|
163
|
+
},
|
|
164
|
+
});
|