@auscera/cleoedits 0.0.0-stage → 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 +62 -2
- package/cli.mjs +149 -0
- package/lib/dependencies.mjs +384 -0
- package/lib/run.mjs +114 -0
- package/lib/workspace.mjs +167 -0
- package/package.json +240 -3
- package/workspace/.agents/skills/cleoedits/SKILL.md +29 -0
- package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/audiogram.json +41 -0
- package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/facebook.json +48 -0
- package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/linkedin.json +48 -0
- package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/podcast.json +23 -0
- package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/reels.json +48 -0
- package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/shorts.json +48 -0
- package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/tiktok.json +48 -0
- package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/x.json +48 -0
- package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/youtube-shorts.json +48 -0
- package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/youtube.json +48 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/assets/LICENSE-SimpleIcons +30 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/assets/logos.json +1 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/Anton-Regular.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/ArchivoBlack-Regular.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/InstrumentSerif-Italic.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/Inter.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/LICENSE-PermanentMarker.txt +202 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/Montserrat.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-Anton.txt +93 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-ArchivoBlack.txt +93 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-InstrumentSerif.txt +93 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-Inter.txt +93 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-Montserrat.txt +93 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-PlayfairDisplay.txt +93 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-Poppins.txt +93 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-SpaceMono.txt +93 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/PermanentMarker-Regular.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/PlayfairDisplay-Italic.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/PlayfairDisplay.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/Poppins-Black.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/Poppins-Bold.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/Poppins-ExtraBold.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/SpaceMono-Bold.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/models/LICENSE-MediaPipe +218 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/models/LICENSE-YuNet +21 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/models/NOTICE.md +4 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/models/selfie_segmenter.tflite +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/models/yunet.onnx +0 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/LICENSE +21 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/audio-app-ui/STYLE.md +65 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/blueprint/STYLE.md +53 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/blueprint/index.html +328 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/blueprint/studio.js +57 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/data-story/STYLE.md +65 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/data-story/index.html +575 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/design-app-ui/STYLE.md +68 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/editor-ui/STYLE.md +73 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/editorial-paper/STYLE.md +54 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/editorial-paper/index.html +189 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/editorial-paper/studio.js +57 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/explainer-diagram/STYLE.md +64 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/explainer-diagram/index.html +620 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/graphite-ui/STYLE.md +55 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/graphite-ui/index.html +238 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/graphite-ui/studio.js +57 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/growing-city/STYLE.md +66 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/growing-city/index.html +602 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/ink-line/STYLE.md +66 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/ink-line/index.html +777 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/midnight-grid/STYLE.md +56 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/midnight-grid/index.html +186 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/midnight-grid/studio.js +57 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/motion-app-ui/STYLE.md +68 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/paper-cut/STYLE.md +56 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/paper-cut/index.html +244 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/paper-cut/studio.js +57 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/paper-world/STYLE.md +67 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/paper-world/index.html +663 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/particle-field/STYLE.md +59 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/particle-field/index.html +395 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/poster-pop/STYLE.md +52 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/poster-pop/index.html +194 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/poster-pop/studio.js +57 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/risograph/STYLE.md +58 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/risograph/index.html +242 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/risograph/studio.js +57 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/swiss-grid/STYLE.md +53 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/swiss-grid/index.html +138 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/swiss-grid/studio.js +57 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/swiss-kinetic/STYLE.md +63 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/swiss-kinetic/index.html +599 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/time-travel/STYLE.md +65 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/time-travel/index.html +1297 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/weather-widget/STYLE.md +69 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/weather-widget/index.html +674 -0
- package/workspace/.agents/skills/cleoedits/references/audio-clearervoice-elevenlabs.md +11 -0
- package/workspace/.agents/skills/cleoedits/references/ffmpeg-and-reels.md +15 -0
- package/workspace/.agents/skills/cleoedits/references/hyperframes-workflows.md +13 -0
- package/workspace/.agents/skills/cleoedits/references/kdenlive-cli-and-mcp.md +12 -0
- package/workspace/.agents/skills/cleoedits/references/motion-design-pipeline.md +7 -0
- package/workspace/.agents/skills/cleoedits/references/motion-taste-emil.md +5 -0
- package/workspace/.agents/skills/cleoedits/references/playwright-demo-capture.md +9 -0
- package/workspace/.agents/skills/cleoedits/references/remotion-workflows.md +13 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/LICENSE +21 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_ass_overlay.py +399 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/__init__.py +235 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/alpha.py +560 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/asr.py +1237 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/color.py +540 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/decision.py +2452 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/drawtext.py +290 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/emit.py +1309 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/emoji.py +518 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/fonts.py +875 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/pacing.py +263 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/pacing_edit.py +432 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/probe.py +1613 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/runner.py +3994 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/text.py +73 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/timeline.py +721 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/wrap.py +981 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_contract.py +2454 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_platforms.py +258 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_review.html +754 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_review.py +258 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_smartcut.py +450 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/audio.py +867 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/background.py +136 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/batch.py +1409 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/broll.py +282 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/caption.py +2207 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/check.py +815 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/color.py +695 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/crop.py +91 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/cropdetect.py +214 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/cut.py +2076 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/deinterlace.py +90 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/denoise.py +94 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/export.py +1033 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/fit.py +729 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/freeze.py +197 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/graphics.py +920 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/grid.py +235 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/insert.py +142 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/join.py +1083 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/look.py +475 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/loop.py +395 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/loudness.py +397 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/metadata.py +416 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/multicam.py +414 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/overlay.py +766 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/pad.py +121 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/probe.py +145 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/proxy.py +93 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/redact.py +162 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/render.py +2424 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/report.py +354 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/reverse.py +114 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/scenes.py +439 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/sequence.py +285 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/silence.py +945 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/speedramp.py +193 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/sphere.py +137 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/stabilize.py +141 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/straighten.py +120 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/sync.py +500 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/verify.py +411 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/waveform.py +502 -0
- package/workspace/.agents/skills/cleoedits/scripts/kdenlive_builder.py +284 -0
- package/workspace/.agents/skills/cleoedits/scripts/motion/LICENSE-claude-motion +21 -0
- package/workspace/.agents/skills/cleoedits/scripts/motion/LICENSE-motion-design +21 -0
- package/workspace/.agents/skills/cleoedits/scripts/motion/_media.py +43 -0
- package/workspace/.agents/skills/cleoedits/scripts/motion/pacing_check.py +90 -0
- package/workspace/.agents/skills/cleoedits/scripts/motion/storyboard.py +77 -0
- package/workspace/.agents/skills/cleoedits/scripts/reel_effects/LICENSE +26 -0
- package/workspace/.agents/skills/cleoedits/scripts/reel_effects/fx.py +2717 -0
- package/workspace/.agents/skills/cleoedits/scripts/reel_effects/logos.py +194 -0
- package/workspace/.agents/skills/cleoedits/scripts/reel_effects/sfx.py +105 -0
- package/workspace/.agents/skills/cleoedits/scripts/reel_effects/trim.py +99 -0
- package/workspace/.agents/skills/cleoedits/scripts/reel_effects/words.py +60 -0
- package/workspace/.claude/commands/blender-3d.md +12 -0
- package/workspace/.claude/commands/business-short-form-reels.md +12 -0
- package/workspace/.claude/commands/color-grade.md +12 -0
- package/workspace/.claude/commands/cutout-grid-reel.md +12 -0
- package/workspace/.claude/commands/depth-ui-reel.md +12 -0
- package/workspace/.claude/commands/explainer-panel-reel.md +12 -0
- package/workspace/.claude/commands/freeze-frame.md +12 -0
- package/workspace/.claude/commands/glass-graph.md +12 -0
- package/workspace/.claude/commands/over-the-shoulder.md +12 -0
- package/workspace/.claude/commands/personal-short-form-reels.md +12 -0
- package/workspace/.claude/commands/ranking-format.md +12 -0
- package/workspace/.claude/commands/relight.md +12 -0
- package/workspace/.claude/commands/reverse-engineer.md +12 -0
- package/workspace/.claude/commands/text-behind.md +12 -0
- package/workspace/.claude/commands/tier-list.md +12 -0
- package/workspace/.claude-plugin/plugin.json +8 -0
- package/workspace/.npmignore +15 -0
- package/workspace/AGENTS.md +30 -0
- package/workspace/README.md +63 -0
- package/workspace/assets/fonts/TikTokSans-OFL.txt +93 -0
- package/workspace/assets/fonts/TikTokSans-Variable.ttf +0 -0
- package/workspace/assets/luts/clean_warm.cube +4917 -0
- package/workspace/assets/luts/golden_hour.cube +4917 -0
- package/workspace/assets/luts/moody_dark.cube +4917 -0
- package/workspace/assets/luts/teal_orange.cube +4917 -0
- package/workspace/assets/sfx/NOTICE.txt +1 -0
- package/workspace/assets/sfx/click.wav +0 -0
- package/workspace/assets/sfx/pop.wav +0 -0
- package/workspace/assets/sfx/riser.wav +0 -0
- package/workspace/assets/sfx/whoosh.wav +0 -0
- package/workspace/generators/hyperframes/index.html +39 -0
- package/workspace/generators/hyperframes/package.json +15 -0
- package/workspace/generators/hyperframes/pnpm-lock.yaml +1181 -0
- package/workspace/generators/hyperframes/pnpm-workspace.yaml +10 -0
- package/workspace/generators/remotion/eslint.config.mjs +3 -0
- package/workspace/generators/remotion/package.json +36 -0
- package/workspace/generators/remotion/pnpm-lock.yaml +4179 -0
- package/workspace/generators/remotion/pnpm-workspace.yaml +10 -0
- package/workspace/generators/remotion/remotion.config.ts +13 -0
- package/workspace/generators/remotion/src/Root.tsx +52 -0
- package/workspace/generators/remotion/src/index.css +1 -0
- package/workspace/generators/remotion/src/index.ts +4 -0
- package/workspace/generators/remotion/tsconfig.json +15 -0
- package/workspace/pipeline/scripts/_codec.py +28 -0
- package/workspace/pipeline/scripts/ai_media_api.py +109 -0
- package/workspace/pipeline/scripts/blender_render.py +166 -0
- package/workspace/pipeline/scripts/composite.py +49 -0
- package/workspace/pipeline/scripts/melt.sh +68 -0
- package/workspace/pipeline/scripts/normalize_audio.py +39 -0
- package/workspace/pipeline/scripts/person_matte.py +216 -0
- package/workspace/pipeline/scripts/record_demo.py +69 -0
- package/workspace/pipeline/scripts/whisper_cut.py +98 -0
- package/workspace-manifest.json +908 -0
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=1920, height=1080" />
|
|
6
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500;700&display=swap" />
|
|
7
|
+
<script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
|
|
8
|
+
<script src="studio.js"></script>
|
|
9
|
+
<style>
|
|
10
|
+
/* style: blueprint. Every colour comes from these tokens. */
|
|
11
|
+
:root { --ground: #0E3A66; --line: #CFE3F7; --grid: #1C4D80; --text: #EAF3FC; --accent: #FFD23F; }
|
|
12
|
+
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
13
|
+
html, body { width: 1920px; height: 1080px; overflow: hidden; background: var(--ground); }
|
|
14
|
+
#root { position: relative; width: 1920px; height: 1080px; overflow: hidden; background: var(--ground);
|
|
15
|
+
font-family: 'IBM Plex Mono', monospace; color: var(--text); }
|
|
16
|
+
.abs { position: absolute; left: 0; top: 0; }
|
|
17
|
+
.grid { position: absolute; left: -240px; top: -210px; width: 2400px; height: 1500px; transform-origin: 1200px 750px; }
|
|
18
|
+
#fine { opacity: 0.5;
|
|
19
|
+
background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
|
|
20
|
+
background-size: 24px 24px; background-position: 0 18px; }
|
|
21
|
+
#heavy { background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
|
|
22
|
+
background-size: 120px 120px; background-position: 96px 66px; }
|
|
23
|
+
svg { position: absolute; left: 0; top: 0; overflow: visible; }
|
|
24
|
+
#drawsvg { clip-path: inset(49px); }
|
|
25
|
+
#cam { --k: 1; }
|
|
26
|
+
.ln { fill: none; stroke: var(--line); stroke-width: calc(2px * var(--k)); stroke-linejoin: miter; stroke-linecap: butt; stroke-dasharray: 1 1; }
|
|
27
|
+
.thin { fill: none; stroke: var(--line); stroke-width: calc(1.25px * var(--k)); stroke-linecap: butt; stroke-dasharray: 1 1; }
|
|
28
|
+
.con { fill: none; stroke: var(--line); stroke-width: calc(1px * var(--k)); stroke-dasharray: 1 1; }
|
|
29
|
+
.axis { fill: none; stroke: var(--line); stroke-width: calc(1px * var(--k)); opacity: 0.55; }
|
|
30
|
+
.hid { fill: none; stroke: var(--line); stroke-width: calc(1.5px * var(--k)); stroke-dasharray: 9 7; }
|
|
31
|
+
.px { fill: none; stroke: var(--ground); stroke-width: calc(2px * var(--k)); stroke-dasharray: 1 1; }
|
|
32
|
+
.dim { fill: none; stroke: var(--text); stroke-width: calc(1.5px * var(--k)); }
|
|
33
|
+
.ext { fill: none; stroke: var(--text); stroke-width: calc(1.25px * var(--k)); stroke-dasharray: 1 1; }
|
|
34
|
+
.head { fill: var(--text); }
|
|
35
|
+
.sheet { fill: none; stroke: var(--line); stroke-width: 1px; opacity: 0.45; }
|
|
36
|
+
.lead { fill: none; stroke-width: 1.5px; stroke-dasharray: 1 1; }
|
|
37
|
+
.mask { position: absolute; overflow: hidden; height: 40px; white-space: nowrap; }
|
|
38
|
+
.mask > div { font-size: 28px; font-weight: 500; letter-spacing: 0.06em; line-height: 40px; text-transform: uppercase; }
|
|
39
|
+
.num { position: absolute; overflow: hidden; height: 44px; white-space: nowrap; }
|
|
40
|
+
.num > div { font-size: 32px; font-weight: 700; letter-spacing: 0.02em; line-height: 44px; }
|
|
41
|
+
</style>
|
|
42
|
+
</head>
|
|
43
|
+
<body>
|
|
44
|
+
<div id="root" data-composition-id="main" data-start="0" data-duration="12" data-width="1920" data-height="1080">
|
|
45
|
+
<div id="fine" class="grid"></div>
|
|
46
|
+
<div id="heavy" class="grid"></div>
|
|
47
|
+
<svg id="sheetsvg" width="1920" height="1080"></svg>
|
|
48
|
+
<svg id="drawsvg" width="1920" height="1080"><defs id="defs"></defs><g id="cam"></g></svg>
|
|
49
|
+
<svg id="oversvg" width="1920" height="1080"></svg>
|
|
50
|
+
<div id="labels" class="abs"></div>
|
|
51
|
+
</div>
|
|
52
|
+
<script>
|
|
53
|
+
const S = STUDIO, NS = 'http://www.w3.org/2000/svg';
|
|
54
|
+
const css = getComputedStyle(document.documentElement);
|
|
55
|
+
const tok = n => css.getPropertyValue(n).trim();
|
|
56
|
+
const C = { line: tok('--line'), text: tok('--text'), accent: tok('--accent') };
|
|
57
|
+
const hex = h => [1, 3, 5].map(i => parseInt(h.slice(i, i + 2), 16));
|
|
58
|
+
const mixHex = (a, b, p) => { const A = hex(a), B = hex(b);
|
|
59
|
+
return 'rgb(' + A.map((v, i) => Math.round(v + (B[i] - v) * p)).join(',') + ')'; };
|
|
60
|
+
const el = (tag, parent, attrs) => { const e = document.createElementNS(NS, tag);
|
|
61
|
+
for (const k in attrs || {}) e.setAttribute(k, attrs[k]); parent.appendChild(e); return e; };
|
|
62
|
+
const seg = S.seg, mix = S.mix;
|
|
63
|
+
|
|
64
|
+
// ---------- the sheet: border, zone ticks, corner marks, title block, scale bar (static) ----------
|
|
65
|
+
const sheet = document.getElementById('sheetsvg');
|
|
66
|
+
el('rect', sheet, { x: 48, y: 48, width: 1824, height: 984, class: 'sheet' });
|
|
67
|
+
for (let x = 288; x < 1872; x += 240) { el('path', sheet, { d: `M${x},48 v12 M${x},1032 v-12`, class: 'sheet' }); }
|
|
68
|
+
for (let y = 288; y < 1032; y += 240) { el('path', sheet, { d: `M48,${y} h12 M1872,${y} h-12`, class: 'sheet' }); }
|
|
69
|
+
[[96, 96], [1824, 96], [96, 984], [1824, 984]].forEach(([x, y]) =>
|
|
70
|
+
el('path', sheet, { d: `M${x - 14},${y} h28 M${x},${y - 14} v28`, class: 'sheet' }));
|
|
71
|
+
el('path', sheet, { d: 'M1512,1032 V948 H1872 M1512,976 H1872 M1632,948 V1032 M1752,976 V1032', class: 'sheet' });
|
|
72
|
+
for (let i = 0; i < 10; i++) {
|
|
73
|
+
el('rect', sheet, { x: 96 + i * 24, y: 1006, width: 24, height: 8, fill: i % 2 ? 'none' : C.line,
|
|
74
|
+
stroke: C.line, 'stroke-width': 1, opacity: 0.45 });
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// ---------- the drawing ----------
|
|
78
|
+
const cam = document.getElementById('cam'), defs = document.getElementById('defs');
|
|
79
|
+
const strokes = []; // every line that draws itself
|
|
80
|
+
const stroke = (parent, d, cls, t0, dur, u0, udur, ease) => {
|
|
81
|
+
const e = el('path', parent, { d, class: cls, pathLength: 1 });
|
|
82
|
+
strokes.push({ e, t0, dur, u0, udur, ease: ease || 'power1.inOut' }); return e;
|
|
83
|
+
};
|
|
84
|
+
const G = (parent, id) => { const g = el('g', parent); if (id) g.id = id; return g; };
|
|
85
|
+
|
|
86
|
+
// optical axis: always there (centre line, long-short dash)
|
|
87
|
+
el('path', cam, { d: 'M-1400,0 H1400', class: 'axis', 'stroke-dasharray': '48 10 6 10' });
|
|
88
|
+
|
|
89
|
+
// construction lines: shoot across, then fade
|
|
90
|
+
const conG = G(cam);
|
|
91
|
+
const conH = [-268, -200, -146, 146, 200], conV = [-420, -300, 20, 60, 520];
|
|
92
|
+
conH.forEach((y, i) => stroke(conG, `M-1300,${y} H1300`, 'con', 0.15 + 0.05 * i, 0.5, null, null, 'expo.out'));
|
|
93
|
+
conV.forEach((x, i) => stroke(conG, `M${x},-800 V800`, 'con', 0.35 + 0.05 * i, 0.5, null, null, 'expo.out'));
|
|
94
|
+
|
|
95
|
+
// parts (local px, optical axis at y = 0, lens points left)
|
|
96
|
+
const hood = G(cam), lens = G(cam), mount = G(cam), sensor = G(cam), body = G(cam);
|
|
97
|
+
|
|
98
|
+
// hood
|
|
99
|
+
stroke(hood, 'M-300,-136 L-420,-172 V172 L-300,136 Z', 'ln', 1.4, 0.8, 10.9, 0.6);
|
|
100
|
+
stroke(hood, 'M-408,-166 V166', 'thin', 1.9, 0.5, 10.6, 0.4);
|
|
101
|
+
|
|
102
|
+
// lens: barrel, focus ring, ribs, bore, glass
|
|
103
|
+
stroke(lens, 'M20,-130 H-270 V-142 H-300 V142 H-270 V130 H20 Z', 'ln', 1.0, 0.9, 10.85, 0.6);
|
|
104
|
+
stroke(lens, 'M-240,-146 H-120 V146 H-240 Z', 'ln', 1.3, 0.7, 10.7, 0.5);
|
|
105
|
+
stroke(lens, 'M-300,-100 H20 M-300,100 H20', 'thin', 1.5, 0.6, 10.6, 0.4);
|
|
106
|
+
for (let i = 0; i < 9; i++) {
|
|
107
|
+
const x = -228 + i * 12;
|
|
108
|
+
stroke(lens, `M${x},-146 V-130 M${x},130 V146`, 'thin', 2.2 + 0.03 * i, 0.25, 10.45 + 0.02 * i, 0.25);
|
|
109
|
+
}
|
|
110
|
+
const glass = [[-275, 94, 22, 'bi'], [-170, 88, 18, 'men'], [-62, 80, 14, 'bi']].map(([x, h, b, k], i) => {
|
|
111
|
+
const g = G(lens);
|
|
112
|
+
const d = k === 'bi'
|
|
113
|
+
? `M${x - 6},${-h} Q${x - 6 - b},0 ${x - 6},${h} H${x + 6} Q${x + 6 + b},0 ${x + 6},${-h} Z`
|
|
114
|
+
: `M${x - 8},${-h} Q${x - 8 - b},0 ${x - 8},${h} H${x + 6} Q${x + 6 - b * 0.7},0 ${x + 6},${-h} Z`;
|
|
115
|
+
stroke(g, d, 'ln', 1.7 + 0.12 * i, 0.7, 10.6 + 0.08 * i, 0.5);
|
|
116
|
+
return g;
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
// mount: two section walls with hatching, bayonet tabs, thin bore lines
|
|
120
|
+
const hatch = el('pattern', defs, { id: 'hatch', patternUnits: 'userSpaceOnUse', width: 10, height: 10, patternTransform: 'rotate(45)' });
|
|
121
|
+
el('path', hatch, { d: 'M0,0 V10', stroke: C.line, 'stroke-width': 1.5, opacity: 0.8 });
|
|
122
|
+
const hClip = el('clipPath', defs, { id: 'hclip' });
|
|
123
|
+
const hRect = el('rect', hClip, { x: 20, y: -160, width: 0, height: 320 });
|
|
124
|
+
const hG = el('g', mount, { 'clip-path': 'url(#hclip)' });
|
|
125
|
+
el('rect', hG, { x: 20, y: -150, width: 40, height: 38, fill: 'url(#hatch)' });
|
|
126
|
+
el('rect', hG, { x: 20, y: 112, width: 40, height: 38, fill: 'url(#hatch)' });
|
|
127
|
+
stroke(mount, 'M20,-150 H60 V-112 H20 Z M20,112 H60 V150 H20 Z', 'ln', 1.2, 0.7, 10.8, 0.5);
|
|
128
|
+
stroke(mount, 'M20,-120 H4 V-108 H20 M20,120 H4 V108 H20', 'thin', 1.8, 0.4, 10.7, 0.4);
|
|
129
|
+
stroke(mount, 'M20,-112 V112 M60,-112 V112', 'thin', 1.6, 0.5, 10.75, 0.4);
|
|
130
|
+
|
|
131
|
+
// sensor: solid where it is out of the body, dashed (hidden line) where the body covers it
|
|
132
|
+
const sClipA = el('clipPath', defs, { id: 'sA' }), sRectA = el('rect', sClipA, { x: -2000, y: -400, width: 0, height: 800 });
|
|
133
|
+
const sClipB = el('clipPath', defs, { id: 'sB' }), sRectB = el('rect', sClipB, { x: 0, y: -400, width: 4000, height: 800 });
|
|
134
|
+
const fClip = el('clipPath', defs, { id: 'fc' }), fRect = el('rect', fClip, { x: 100, y: 125, width: 50, height: 0 });
|
|
135
|
+
const SD = 'M100,-125 H150 V125 H100 Z M108,125 V152 H142 V125';
|
|
136
|
+
const fill = el('rect', sensor, { x: 100, y: -125, width: 50, height: 250, fill: C.accent, 'clip-path': 'url(#fc)' });
|
|
137
|
+
const pxG = G(sensor);
|
|
138
|
+
const pxLines = [];
|
|
139
|
+
for (let i = 0; i < 9; i++) pxLines.push(stroke(pxG, `M100,${-100 + i * 25} H150`, 'px', 6.62 + 0.03 * i, 0.3, 8.22 + 0.02 * i, 0.25, 'expo.out'));
|
|
140
|
+
pxLines.push(stroke(pxG, 'M125,-125 V125', 'px', 6.7, 0.4, 8.25, 0.3, 'expo.out'));
|
|
141
|
+
const sSolid = el('g', sensor, { 'clip-path': 'url(#sA)' });
|
|
142
|
+
stroke(sSolid, SD, 'ln', 2.0, 0.7, 10.5, 0.5);
|
|
143
|
+
stroke(sSolid, 'M112,-116 V116', 'thin', 2.3, 0.4, 10.5, 0.4);
|
|
144
|
+
const sHid = el('path', sensor, { d: SD, class: 'hid', 'clip-path': 'url(#sB)' });
|
|
145
|
+
|
|
146
|
+
// body: one continuous outline (front, top, finder hump, shutter button, back, bottom)
|
|
147
|
+
stroke(body, 'M60,0 V-176 Q60,-200 84,-200 H200 L228,-268 H352 L380,-200 H412 V-216 H468 V-200 H496 Q520,-200 520,-176 V176 Q520,200 496,200 H84 Q60,200 60,176 Z',
|
|
148
|
+
'ln', 0.6, 1.0, 11.0, 0.6);
|
|
149
|
+
stroke(body, 'M60,-150 H520', 'thin', 1.45, 0.6, 10.5, 0.4);
|
|
150
|
+
stroke(body, 'M60,150 H520', 'thin', 1.53, 0.6, 10.55, 0.4);
|
|
151
|
+
stroke(body, 'M440,-90 A50,50 0 1 1 439.9,-90 M440,-90 V-66', 'thin', 1.7, 0.6, 10.6, 0.4);
|
|
152
|
+
stroke(body, 'M240,-238 H340', 'thin', 1.8, 0.4, 10.6, 0.3);
|
|
153
|
+
stroke(body, 'M96,96 A12,12 0 1 1 95.9,96', 'thin', 2.0, 0.4, 10.55, 0.3);
|
|
154
|
+
stroke(body, 'M520,-176 H534 V-140 H520', 'thin', 2.05, 0.35, 10.5, 0.3);
|
|
155
|
+
const bHid = el('path', body, { d: 'M170,-150 H300 V120 H170 Z M180,-130 L290,0', class: 'hid' });
|
|
156
|
+
stroke(body, 'M420,70 H480 Q490,70 490,80 V130 Q490,140 480,140 H420 Q410,140 410,130 V80 Q410,70 420,70 Z', 'thin', 1.9, 0.5, 10.65, 0.4);
|
|
157
|
+
|
|
158
|
+
// dimensions (local), grown from a gap around their number
|
|
159
|
+
const dimG = G(cam);
|
|
160
|
+
function makeDim(cls) {
|
|
161
|
+
return { a: el('path', dimG, { class: 'dim' }), b: el('path', dimG, { class: 'dim' }),
|
|
162
|
+
ha: el('path', dimG, { class: 'head' }), hb: el('path', dimG, { class: 'head' }) };
|
|
163
|
+
}
|
|
164
|
+
const dimAll = makeDim(), dimSen = makeDim();
|
|
165
|
+
const extAll = el('path', dimG, { class: 'ext', pathLength: 1 }), extSen = el('path', dimG, { class: 'ext', pathLength: 1 });
|
|
166
|
+
|
|
167
|
+
// ---------- labels (screen space) ----------
|
|
168
|
+
const over = document.getElementById('oversvg'), labels = document.getElementById('labels');
|
|
169
|
+
const mkMask = (cls, text) => { const m = document.createElement('div'); m.className = cls;
|
|
170
|
+
const i = document.createElement('div'); i.textContent = text; m.appendChild(i); labels.appendChild(m); return m; };
|
|
171
|
+
const PARTS = {
|
|
172
|
+
hood: { g: hood, X: -300, ei: 3, ai: 0 },
|
|
173
|
+
lens: { g: lens, X: -170, ei: 2, ai: 1 },
|
|
174
|
+
mount: { g: mount, X: -40, ei: 1, ai: 2 },
|
|
175
|
+
sensor: { g: sensor, X: 0, ei: 9, ai: 9 },
|
|
176
|
+
body: { g: body, X: 170, ei: 0, ai: 3 },
|
|
177
|
+
};
|
|
178
|
+
const LABS = [
|
|
179
|
+
{ text: 'Hood', part: 'hood', at: [-360, -154], L: 170, tin: 4.20, tout: 5.85 },
|
|
180
|
+
{ text: 'Lens', part: 'lens', at: [-180, -146], L: 230, tin: 4.32, tout: 5.90 },
|
|
181
|
+
{ text: 'Mount', part: 'mount', at: [40, -150], L: 270, tin: 4.44, tout: 5.95 },
|
|
182
|
+
{ text: 'Body', part: 'body', at: [290, -268], L: 130, tin: 4.56, tout: 6.00 },
|
|
183
|
+
{ text: 'Sensor', part: 'sensor', at: [125, -125], L: 140, tin: 4.68, tout: 8.00 },
|
|
184
|
+
].map(l => Object.assign(l, {
|
|
185
|
+
path: el('path', over, { class: 'lead', pathLength: 1 }),
|
|
186
|
+
dot: el('circle', over, { r: 4 }),
|
|
187
|
+
m: mkMask('mask', l.text),
|
|
188
|
+
}));
|
|
189
|
+
const numAll = mkMask('num', '1410'), numSen = mkMask('num', '250');
|
|
190
|
+
numSen.style.transformOrigin = '0 0';
|
|
191
|
+
|
|
192
|
+
// ---------- motion helpers ----------
|
|
193
|
+
const T_EX = 3.2, T_AS = 9.0;
|
|
194
|
+
function partX(p, t) {
|
|
195
|
+
const P = PARTS[p]; if (!P.X) return 0;
|
|
196
|
+
const t0 = T_EX + P.ei * 0.07, t1 = T_AS + P.ai * 0.07;
|
|
197
|
+
let x = P.X * (seg(t, t0, 1.0, 'power3.inOut') - seg(t, t1, 0.95, 'power3.inOut'));
|
|
198
|
+
const e0 = t - (t0 + 1.0), e1 = t - (t1 + 0.95);
|
|
199
|
+
if (e0 > 0) x += P.X * 0.025 * Math.exp(-7 * e0) * Math.sin(2 * Math.PI * 2.2 * e0);
|
|
200
|
+
if (e1 > 0) x -= P.X * 0.02 * Math.exp(-7 * e1) * Math.sin(2 * Math.PI * 2.4 * e1);
|
|
201
|
+
return x;
|
|
202
|
+
}
|
|
203
|
+
const A = { cx: 50, cy: -34, s: 1.30 }, H = { cx: 120, cy: -40, s: 1.50 }, E = { cx: -15, cy: -35, s: 1.12 }, F = { cx: 130, cy: -10, s: 1.66 };
|
|
204
|
+
const lerpCam = (a, b, p) => ({ cx: mix(a.cx, b.cx, p), cy: mix(a.cy, b.cy, p), s: mix(a.s, b.s, p) });
|
|
205
|
+
function camAt(t) {
|
|
206
|
+
let c = A;
|
|
207
|
+
c = lerpCam(c, H, seg(t, 1.7, 1.45, 'power2.inOut'));
|
|
208
|
+
c = lerpCam(c, E, seg(t, 3.15, 1.15, 'power2.inOut'));
|
|
209
|
+
c = lerpCam(c, F, seg(t, 6.05, 1.3, 'power2.inOut'));
|
|
210
|
+
c = lerpCam(c, E, seg(t, 8.0, 1.1, 'power2.inOut'));
|
|
211
|
+
c = lerpCam(c, A, seg(t, 9.0, 1.2, 'power2.inOut'));
|
|
212
|
+
return Object.assign({ dx: 5 * S.wave(t, 1), dy: 4 * S.wave(t, 1, 0.25) }, c);
|
|
213
|
+
}
|
|
214
|
+
function drawStroke(s, t) {
|
|
215
|
+
const p = seg(t, s.t0, s.dur, s.ease);
|
|
216
|
+
const q = s.u0 != null ? seg(t, s.u0, s.udur, 'power1.inOut') : 0;
|
|
217
|
+
s.e.style.strokeDashoffset = p < 1 ? 1 - p : -q;
|
|
218
|
+
s.e.style.visibility = (p <= 0.0005 || q >= 0.9995) ? 'hidden' : 'visible';
|
|
219
|
+
}
|
|
220
|
+
// a dimension: extension lines, then two halves that grow out of the number gap with arrowheads
|
|
221
|
+
function dimFrame(D, ext, a, b, gap, extD, tin, tout, t, k) {
|
|
222
|
+
const pin = seg(t, tin, 0.3, 'power2.out') - seg(t, tout + 0.2, 0.25, 'power2.in');
|
|
223
|
+
ext.setAttribute('d', extD);
|
|
224
|
+
ext.style.strokeDashoffset = 1 - Math.max(0, pin);
|
|
225
|
+
ext.style.visibility = pin > 0.001 ? 'visible' : 'hidden';
|
|
226
|
+
const g = seg(t, tin + 0.15, 0.5, 'expo.out') - seg(t, tout + 0.05, 0.3, 'power2.in');
|
|
227
|
+
const vis = g > 0.002;
|
|
228
|
+
[D.a, D.b, D.ha, D.hb].forEach(e => e.style.visibility = vis ? 'visible' : 'hidden');
|
|
229
|
+
if (!vis) return;
|
|
230
|
+
const mx = (a[0] + b[0]) / 2, my = (a[1] + b[1]) / 2, L = Math.hypot(b[0] - a[0], b[1] - a[1]);
|
|
231
|
+
const ux = (b[0] - a[0]) / L, uy = (b[1] - a[1]) / L, half = L / 2;
|
|
232
|
+
const r0 = gap / 2, r1 = r0 + (half - r0) * g;
|
|
233
|
+
const P = r => [mx + ux * r, my + uy * r], N = r => [mx - ux * r, my - uy * r];
|
|
234
|
+
const AH = 16 * k, AW = 5.5 * k;
|
|
235
|
+
const tri = (tip, dx, dy) => `M${tip[0]},${tip[1]} L${tip[0] - dx * AH - dy * AW},${tip[1] - dy * AH + dx * AW} L${tip[0] - dx * AH + dy * AW},${tip[1] - dy * AH - dx * AW} Z`;
|
|
236
|
+
const p0 = P(r0), p1 = P(r1), n0 = N(r0), n1 = N(r1);
|
|
237
|
+
D.a.setAttribute('d', `M${p0[0]},${p0[1]} L${p1[0]},${p1[1]}`);
|
|
238
|
+
D.b.setAttribute('d', `M${n0[0]},${n0[1]} L${n1[0]},${n1[1]}`);
|
|
239
|
+
const ho = Math.min(1, g * 3);
|
|
240
|
+
D.ha.setAttribute('d', tri(p1, ux, uy)); D.hb.setAttribute('d', tri(n1, -ux, -uy));
|
|
241
|
+
D.ha.style.opacity = D.hb.style.opacity = ho;
|
|
242
|
+
}
|
|
243
|
+
function maskFrame(m, x, y, pin, rot) {
|
|
244
|
+
const inner = m.firstChild;
|
|
245
|
+
m.style.visibility = pin > 0.001 ? 'visible' : 'hidden';
|
|
246
|
+
m.style.transform = `translate(${x}px, ${y}px)` + (rot ? ' rotate(-90deg)' : '');
|
|
247
|
+
inner.style.transform = `translateY(${(1 - pin) * 105}%)`;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
window.__timelines["main"] = S.play(function render(t) {
|
|
251
|
+
const c = camAt(t), k = 1 / c.s;
|
|
252
|
+
const tx = 960 - c.s * c.cx + c.dx, ty = 540 - c.s * c.cy + c.dy;
|
|
253
|
+
cam.setAttribute('transform', `translate(${tx},${ty}) scale(${c.s})`);
|
|
254
|
+
cam.style.setProperty('--k', k);
|
|
255
|
+
const scr = (x, y) => [tx + c.s * x, ty + c.s * y];
|
|
256
|
+
|
|
257
|
+
// grid parallax: the far layer moves at 30% of the camera
|
|
258
|
+
const gs = 1 + 0.3 * (c.s / A.s - 1);
|
|
259
|
+
const gx = 0.3 * (c.s * (A.cx - c.cx)) + 0.3 * c.dx, gy = 0.3 * (c.s * (A.cy - c.cy)) + 0.3 * c.dy;
|
|
260
|
+
['fine', 'heavy'].forEach(id => document.getElementById(id).style.transform = `translate(${gx}px, ${gy}px) scale(${gs})`);
|
|
261
|
+
|
|
262
|
+
// parts
|
|
263
|
+
const X = {}; for (const p in PARTS) { X[p] = partX(p, t); PARTS[p].g.setAttribute('transform', `translate(${X[p]},0)`); }
|
|
264
|
+
// glass elements trail the barrel and spread a little when it is out
|
|
265
|
+
const spread = [-14, 0, 18];
|
|
266
|
+
const lensRaw = tt => PARTS.lens.X * (seg(tt, T_EX + 0.14, 1.0, 'power3.inOut') - seg(tt, T_AS + 0.07, 0.95, 'power3.inOut'));
|
|
267
|
+
const open = seg(t, T_EX + 0.3, 1.0, 'power3.inOut') - seg(t, T_AS, 0.8, 'power3.inOut');
|
|
268
|
+
glass.forEach((g, i) => {
|
|
269
|
+
const lag = 0.06 + 0.05 * i;
|
|
270
|
+
g.setAttribute('transform', `translate(${lensRaw(t - lag) - lensRaw(t) + spread[i] * open},0)`);
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
strokes.forEach(s => drawStroke(s, t));
|
|
274
|
+
conG.style.opacity = 1 - seg(t, 2.6, 0.5, 'power2.in');
|
|
275
|
+
|
|
276
|
+
// hatching wipe, sensor hidden line, sensor fill
|
|
277
|
+
const hw = seg(t, 2.3, 0.5, 'power2.inOut') - seg(t, 10.5, 0.3, 'power2.in');
|
|
278
|
+
hRect.setAttribute('x', 20 + 40 * seg(t, 10.5, 0.3, 'power2.in')); hRect.setAttribute('width', Math.max(0, 40 * hw));
|
|
279
|
+
const front = 60 + X.body;
|
|
280
|
+
sRectA.setAttribute('width', 2000 + front); sRectB.setAttribute('x', front);
|
|
281
|
+
sHid.style.opacity = 0.75 * (seg(t, 2.1, 0.5, 'power2.out') - seg(t, 10.45, 0.4, 'power2.in'));
|
|
282
|
+
bHid.style.opacity = 0.5 * (seg(t, 2.25, 0.5, 'power2.out') - seg(t, 10.45, 0.4, 'power2.in'));
|
|
283
|
+
const fIn = seg(t, 6.1, 0.45, 'power3.inOut'), fOut = seg(t, 8.4, 0.4, 'power2.in');
|
|
284
|
+
const fTop = mix(125, -125, fIn);
|
|
285
|
+
const top = fOut > 0 ? mix(-125, 125, fOut) : fTop;
|
|
286
|
+
fRect.setAttribute('y', top); fRect.setAttribute('height', Math.max(0, 125 - top));
|
|
287
|
+
fill.style.visibility = 125 - top > 0.01 ? 'visible' : 'hidden';
|
|
288
|
+
|
|
289
|
+
// dimensions
|
|
290
|
+
const bodyR = 520 + X.body;
|
|
291
|
+
const hl = -420 + X.hood;
|
|
292
|
+
dimFrame(dimAll, extAll, [hl, 290], [bodyR, 290], 128 * k, `M${hl},182 V306 M${bodyR},210 V306`, 4.9, 5.85, t, k);
|
|
293
|
+
dimFrame(dimSen, extSen, [192, -125], [192, 125], 104 * k, `M158,-125 H204 M158,125 H204`, 7.0, 7.95, t, k);
|
|
294
|
+
|
|
295
|
+
// labels
|
|
296
|
+
LABS.forEach(l => {
|
|
297
|
+
const [ax, ay] = scr(l.at[0] + X[l.part], l.at[1]);
|
|
298
|
+
const sy = ay - l.L;
|
|
299
|
+
const w = l.m.firstChild.offsetWidth;
|
|
300
|
+
const pl = seg(t, l.tin, 0.4, 'power2.out') - seg(t, l.tout + 0.1, 0.3, 'power2.in');
|
|
301
|
+
const pt = seg(t, l.tin + 0.22, 0.5, 'expo.out') - seg(t, l.tout, 0.25, 'power2.in');
|
|
302
|
+
const hot = l.part === 'sensor' ? seg(t, 6.1, 0.35, 'power2.inOut') - seg(t, 7.8, 0.3, 'power2.inOut') : 0;
|
|
303
|
+
const col = hot > 0 ? mixHex(C.text, C.accent, hot) : C.text;
|
|
304
|
+
l.path.setAttribute('d', `M${ax},${ay} V${sy} H${ax + 12 + w + 8}`);
|
|
305
|
+
l.path.style.stroke = col;
|
|
306
|
+
l.path.style.strokeDashoffset = 1 - Math.max(0, pl);
|
|
307
|
+
l.path.style.visibility = pl > 0.001 ? 'visible' : 'hidden';
|
|
308
|
+
l.dot.setAttribute('cx', ax); l.dot.setAttribute('cy', ay);
|
|
309
|
+
l.dot.setAttribute('r', 4 * Math.min(1, Math.max(0, pl) * 4));
|
|
310
|
+
l.dot.style.fill = col; l.dot.style.visibility = pl > 0.001 ? 'visible' : 'hidden';
|
|
311
|
+
l.m.firstChild.style.color = col;
|
|
312
|
+
maskFrame(l.m, ax + 12, sy - 44, Math.max(0, pt));
|
|
313
|
+
});
|
|
314
|
+
// dimension numbers
|
|
315
|
+
{
|
|
316
|
+
const [nx, ny] = scr((hl + bodyR) / 2, 290);
|
|
317
|
+
const w = numAll.firstChild.offsetWidth;
|
|
318
|
+
const p = seg(t, 5.2, 0.5, 'expo.out') - seg(t, 5.85, 0.25, 'power2.in');
|
|
319
|
+
maskFrame(numAll, nx - w / 2, ny - 22, Math.max(0, p));
|
|
320
|
+
const [sx, sy] = scr(192, 0);
|
|
321
|
+
const ws = numSen.firstChild.offsetWidth;
|
|
322
|
+
const q = seg(t, 7.35, 0.5, 'expo.out') - seg(t, 7.95, 0.25, 'power2.in');
|
|
323
|
+
maskFrame(numSen, sx - 22, sy + ws / 2, Math.max(0, q), true);
|
|
324
|
+
}
|
|
325
|
+
}, { loop: true });
|
|
326
|
+
</script>
|
|
327
|
+
</body>
|
|
328
|
+
</html>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// studio.js: one clock for the whole piece (hack 4).
|
|
2
|
+
// Load it after GSAP and before your scene script.
|
|
3
|
+
// Your scene calls STUDIO.play(render). render(t) must draw the WHOLE frame from t alone.
|
|
4
|
+
// Same t in, same picture out. That makes renders exact, seekable, and loopable.
|
|
5
|
+
(function () {
|
|
6
|
+
// works from <head> or <body>: the root is looked up the first time it is needed
|
|
7
|
+
const R = () => document.querySelector('[data-composition-id]');
|
|
8
|
+
const num = (k) => +R().dataset[k];
|
|
9
|
+
const cache = {};
|
|
10
|
+
const S = {
|
|
11
|
+
get root() { return R(); },
|
|
12
|
+
get D() { return num('duration'); },
|
|
13
|
+
get W() { return num('width'); },
|
|
14
|
+
get H() { return num('height'); },
|
|
15
|
+
get V() { return S.H > S.W; }, // true for 9:16
|
|
16
|
+
get u() { return Math.min(S.W, S.H) / 1080; }, // 1 unit = 1 px at a 1080 short side
|
|
17
|
+
ease(name) { return cache[name] || (cache[name] = name === 'none' ? (p) => p : gsap.parseEase(name)); },
|
|
18
|
+
// eased 0..1 progress of a move that starts at `start` and lasts `dur`
|
|
19
|
+
seg(t, start, dur, ease) {
|
|
20
|
+
const p = Math.min(1, Math.max(0, (t - start) / dur));
|
|
21
|
+
return S.ease(ease || 'power3.out')(p);
|
|
22
|
+
},
|
|
23
|
+
mix(a, b, p) { return a + (b - a) * p; },
|
|
24
|
+
// a wave that always loops: use whole-number cycles
|
|
25
|
+
wave(t, cycles, offset) { return Math.sin(2 * Math.PI * ((cycles || 1) * t / S.D + (offset || 0))); },
|
|
26
|
+
// seeded random numbers (never use Math.random in a render)
|
|
27
|
+
rng(seed) {
|
|
28
|
+
let a = seed >>> 0;
|
|
29
|
+
return function () {
|
|
30
|
+
a = (a + 0x6d2b79f5) | 0;
|
|
31
|
+
let t = Math.imul(a ^ (a >>> 15), 1 | a);
|
|
32
|
+
t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;
|
|
33
|
+
return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
// one clock drives everything; loop:true wraps t so t = D draws the same frame as t = 0
|
|
37
|
+
play(render, opts) {
|
|
38
|
+
const loop = !opts || opts.loop !== false;
|
|
39
|
+
const D = S.D, root = S.root;
|
|
40
|
+
const clock = { t: 0 };
|
|
41
|
+
const tl = gsap.timeline({ paused: true });
|
|
42
|
+
// loop_check.py sets STUDIO_NO_WRAP so it can prove render(end) really equals render(0)
|
|
43
|
+
const wrap = loop && !window.STUDIO_NO_WRAP;
|
|
44
|
+
const draw = () => render(wrap ? clock.t % D : clock.t);
|
|
45
|
+
tl.to(clock, { t: D, duration: D, ease: 'none', onUpdate: draw }, 0);
|
|
46
|
+
draw();
|
|
47
|
+
// fonts can arrive after the first draw; draw again so text measured from them is right,
|
|
48
|
+
// even on frame 0 (seeking to the time you are already at does not redraw)
|
|
49
|
+
if (document.fonts && document.fonts.ready) document.fonts.ready.then(draw);
|
|
50
|
+
window.addEventListener('load', draw);
|
|
51
|
+
window.__timelines = window.__timelines || {};
|
|
52
|
+
window.__timelines[root.dataset.compositionId] = tl;
|
|
53
|
+
return tl;
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
window.STUDIO = S;
|
|
57
|
+
})();
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Where viewers leave
|
|
2
|
+
|
|
3
|
+
id: data-story
|
|
4
|
+
Best for: retention charts, growth stats, before and after results, explainer data beats, report highlights
|
|
5
|
+
Mood: a printed newspaper chart that comes alive, calm and exact, with one blue truth.
|
|
6
|
+
Reference piece: styles/data-story/index.html (12 s, does not loop)
|
|
7
|
+
Gallery video: gallery/videos/data-story.mp4
|
|
8
|
+
|
|
9
|
+
## Palette (hex)
|
|
10
|
+
- ground: #FFF1E5 (salmon news paper, with grain and fibres)
|
|
11
|
+
- ink: #1A1A1A (lines, title, dots)
|
|
12
|
+
- labels: #1A1A1A at 62 to 78% opacity
|
|
13
|
+
- gridlines: #E6D9CE
|
|
14
|
+
- shadow: warm brown, rgba(60,35,15,0.28), soft and low
|
|
15
|
+
- accent: #0F5499 deep blue (the ONE accent: the better line, its fill, the payoff number)
|
|
16
|
+
|
|
17
|
+
## Type
|
|
18
|
+
- Display: Bodoni Moda 400, tracking 0, line height 1. Title 88 px. Hero number 316 px with a 150 px "%" raised beside it
|
|
19
|
+
- Labels: Inter 400 for ticks (26 px), Inter 500 for series names (40 px), Inter 700 for the callout number (60 px)
|
|
20
|
+
- Font links (paste into <head>; all fonts are free):
|
|
21
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bodoni+Moda:opsz,wght@6..96,400&family=Inter:wght@400;500;700&display=swap">
|
|
22
|
+
|
|
23
|
+
## Easing (numbers)
|
|
24
|
+
- land: power3.out, 0.45 to 0.6 s (title words, labels, callouts)
|
|
25
|
+
- leave: power2.in, 0.3 to 0.4 s
|
|
26
|
+
- move: power3.inOut, 1.0 s (camera dive in and pull back out)
|
|
27
|
+
- draw: sine.inOut, 2.5 s (the ink line); expo.out, 0.7 s (gridlines and baseline)
|
|
28
|
+
- pop: back.out(2.2), 0.3 s (playhead dots); ring pulse power2.out, 0.7 s
|
|
29
|
+
- count: expo.out, 1.0 s (payoff number)
|
|
30
|
+
- stagger: 0.09 s between title words, 0.07 s between gridlines
|
|
31
|
+
|
|
32
|
+
## Motion rules
|
|
33
|
+
- The whole frame is one canvas drawn from time. Nothing is a video or an image.
|
|
34
|
+
- The camera moves by changing the axis range, not by scaling pixels. Ticks reflow (10 min steps become 10 s steps) and labels stay sharp.
|
|
35
|
+
- A playhead dot rides the line and pulses a ring on every key hit. That ring is the beat.
|
|
36
|
+
- Numbers count. Every readout ticks up or down with the dot.
|
|
37
|
+
- A tiny physical push (1 to 4%) and a slow warm light keep the page alive during holds.
|
|
38
|
+
- Labels follow the camera a few frames late, so they feel attached, not pasted.
|
|
39
|
+
- All numbers on screen agree with each other. They come from the same data.
|
|
40
|
+
|
|
41
|
+
## Signature moves
|
|
42
|
+
- The cliff: the ink line plunges at the left while a giant serif counter falls with it.
|
|
43
|
+
- The dive: the camera zooms into the first minute and the tick labels reflow.
|
|
44
|
+
- The unzip: a blue line peels up out of the ink line and the gap fills with blue plus a fine hatch.
|
|
45
|
+
- The payoff: a big blue "+N%" lands in the open sky of the chart, then a light sweep passes over the gain.
|
|
46
|
+
|
|
47
|
+
## Composition
|
|
48
|
+
- Plot box left 216, right 1720, top 280, bottom 920 on a 1920 x 1080 frame.
|
|
49
|
+
- Title top left at 120 px with a short ink bar above it.
|
|
50
|
+
- The hero number sits right aligned at x 1700, in the empty sky above the curve.
|
|
51
|
+
- Max 6 words on screen at once. No source line, no legend box. Labels sit on the lines.
|
|
52
|
+
|
|
53
|
+
## With media
|
|
54
|
+
- Put the clip in a framed player beside the chart (2 px ink keyline, soft neutral shadow). Show the full 16:9 frame. Never crop it.
|
|
55
|
+
- The player's progress bar knob IS the chart playhead. They move together.
|
|
56
|
+
- On the insight beat, freeze the clip on a held frame (pick one with eyes open) and lift the player with a heavier keyline.
|
|
57
|
+
- A dotted leader joins the dot on the curve to the same time on the progress bar.
|
|
58
|
+
- Do not grade or filter the footage. Never draw over a face.
|
|
59
|
+
|
|
60
|
+
## Ban list
|
|
61
|
+
- a second accent colour (no red, no green for "good")
|
|
62
|
+
- chart junk: 3D bars, legend boxes, heavy borders, drop shadows on text
|
|
63
|
+
- scaling the chart as a bitmap (blurry ticks)
|
|
64
|
+
- numbers that do not match each other
|
|
65
|
+
- pure white paper or pure black ink
|