agentcut 0.2.26 → 0.2.27

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.
Files changed (94) hide show
  1. package/README.md +177 -177
  2. package/dist/studio/agents/claude.js +3 -2
  3. package/dist/studio/agents/claude.js.map +1 -1
  4. package/dist/studio/chat.js +1 -1
  5. package/dist/studio/chat.js.map +1 -1
  6. package/dist/studio/cli.js +24 -24
  7. package/dist/studio/download.d.ts +24 -0
  8. package/dist/studio/download.js +234 -0
  9. package/dist/studio/download.js.map +1 -0
  10. package/dist/studio/host.js +8 -0
  11. package/dist/studio/host.js.map +1 -1
  12. package/dist/studio/housekeeping.d.ts +2 -2
  13. package/dist/studio/housekeeping.js +18 -17
  14. package/dist/studio/housekeeping.js.map +1 -1
  15. package/dist/studio/release-cursor.js +21 -21
  16. package/dist/studio/release-video.js +10 -10
  17. package/dist/studio/tools.js +7 -0
  18. package/dist/studio/tools.js.map +1 -1
  19. package/package.json +56 -56
  20. package/template/AGENTS.md +14 -14
  21. package/template/components/README.md +70 -70
  22. package/template/components/before-after/BeforeAfter.tsx +89 -89
  23. package/template/components/catalog.ts +107 -107
  24. package/template/components/cinematic/Device3D.tsx +324 -324
  25. package/template/components/cinematic/devices3d/display-model.ts +184 -184
  26. package/template/components/cinematic/devices3d/iphone-model.ts +643 -643
  27. package/template/components/cinematic/devices3d/macbook-model.ts +608 -608
  28. package/template/components/cinematic/devices3d/models.ts +657 -657
  29. package/template/components/cinematic/devices3d/runtime.ts +267 -267
  30. package/template/components/cinematic/math.ts +100 -100
  31. package/template/components/color/grade-effect.ts +650 -650
  32. package/template/components/color/grade.ts +512 -512
  33. package/template/components/color/looks.ts +154 -154
  34. package/template/components/countdown/Countdown.tsx +166 -166
  35. package/template/components/dot-trace-title/DotTraceTitle.tsx +181 -181
  36. package/template/components/dot-trace-title/meta.json +51 -51
  37. package/template/components/generate/GenerateReveal.tsx +381 -381
  38. package/template/components/hook-card/HookCard.tsx +554 -554
  39. package/template/components/index.ts +199 -199
  40. package/template/components/lib.ts +191 -191
  41. package/template/components/line-diagram/LineDiagram.tsx +205 -205
  42. package/template/components/line-diagram/meta.json +215 -215
  43. package/template/components/list-card/ListCard.tsx +104 -104
  44. package/template/components/live-clip.ts +75 -75
  45. package/template/components/looks.tsx +1447 -1447
  46. package/template/components/loops/LoopCanvas.tsx +132 -132
  47. package/template/components/loops/engine.ts +184 -184
  48. package/template/components/loops/library.ts +667 -667
  49. package/template/components/loops/library2.ts +777 -777
  50. package/template/components/motion-loop/MotionLoop.tsx +37 -37
  51. package/template/components/motion-loop/meta.json +311 -311
  52. package/template/components/props.ts +73 -73
  53. package/template/components/quote-card/QuoteCard.tsx +71 -71
  54. package/template/components/style-layer.tsx +233 -233
  55. package/template/components/styles.ts +113 -113
  56. package/template/components/types.ts +66 -66
  57. package/template/components/word-pop/WordPop.tsx +59 -59
  58. package/template/components/word-stack/WordStack.tsx +122 -122
  59. package/template/presets/charcoal-sketch/PROMPT.md +48 -48
  60. package/template/presets/charcoal-sketch/scripts/duck_music.py +34 -34
  61. package/template/presets/punk-cut-paper/scenes/Motif.tsx +376 -376
  62. package/template/presets/punk-cut-paper/scenes/Photo.tsx +73 -73
  63. package/template/presets/punk-cut-paper/scenes/Ransom.tsx +119 -119
  64. package/template/runtime/composition.tsx +1189 -1189
  65. package/template/runtime/helpers.tsx +230 -230
  66. package/template/runtime/index.tsx +22 -22
  67. package/template/runtime/types.ts +315 -315
  68. package/template/skill/SKILL.md +186 -187
  69. package/template/skill/references/broll.md +44 -44
  70. package/template/skill/references/browser-export.md +61 -61
  71. package/template/skill/references/cinematic.md +206 -206
  72. package/template/skill/references/color.md +79 -79
  73. package/template/skill/references/craft.md +97 -97
  74. package/template/skill/references/editing-styles.md +57 -57
  75. package/template/skill/references/feature-launch.md +34 -34
  76. package/template/skill/references/footage.md +72 -72
  77. package/template/skill/references/format.md +142 -142
  78. package/template/skill/references/how-to.md +146 -146
  79. package/template/skill/references/launch-direction.md +89 -89
  80. package/template/skill/references/loops.md +151 -151
  81. package/template/skill/references/mcp-external.md +19 -19
  82. package/template/skill/references/performance.md +93 -93
  83. package/template/skill/references/person-cutout.md +19 -19
  84. package/template/skill/references/presets.md +60 -60
  85. package/template/skill/references/product-launch.md +134 -134
  86. package/template/skill/references/release-capture.md +53 -53
  87. package/template/skill/references/sound.md +167 -166
  88. package/template/skill/references/style-spy.md +160 -160
  89. package/template/skill/references/website-howto.md +45 -45
  90. package/template/starter/.studio/chat.json +1 -1
  91. package/template/starter/layers.json +46 -46
  92. package/template/starter/notes.md +4 -4
  93. package/template/starter/project.json +13 -13
  94. package/template/starter/scenes/Title.tsx +38 -38
@@ -1,154 +1,154 @@
1
- // Built-in looks, written as grades so they scale with a strength slider and need no LUT files.
2
- import type { GradeFields } from "./grade";
3
-
4
- export interface GradeLook {
5
- id: string;
6
- name: string;
7
- group: "Film" | "Cinematic" | "Clean" | "Mono" | "Stylized";
8
- description: string;
9
- fields: GradeFields;
10
- }
11
-
12
- const S_CURVE: GradeFields["curves"] = { master: [[0, 0], [0.25, 0.2], [0.75, 0.82], [1, 1]] };
13
- const SOFT_S: GradeFields["curves"] = { master: [[0, 0], [0.25, 0.225], [0.75, 0.785], [1, 1]] };
14
- const FADED: GradeFields["curves"] = { master: [[0, 0.07], [0.25, 0.25], [0.75, 0.76], [1, 0.95]] };
15
-
16
- export const GRADE_LOOKS: GradeLook[] = [
17
- {
18
- id: "golden-stock", name: "Golden Stock", group: "Film",
19
- description: "Warm print film: rich skin, soft amber highlights, gentle halation",
20
- fields: {
21
- temperature: 0.14, vibrance: 0.1, skinProtect: 0.2, curves: SOFT_S, halation: 0.25, grain: 0.14,
22
- wheels: { shadows: { x: 0.08, y: -0.12 }, highlights: { x: 0.2, y: 0.08 } },
23
- hsl: { orange: { saturation: 0.08 }, green: { hue: -0.08, saturation: -0.18 }, blue: { saturation: -0.12 } },
24
- },
25
- },
26
- {
27
- id: "faded-print", name: "Faded Print", group: "Film",
28
- description: "Lifted blacks and quiet colour, like an old print in the sun",
29
- fields: {
30
- saturation: 0.86, temperature: 0.06, curves: FADED, grain: 0.2, halation: 0.12,
31
- wheels: { shadows: { x: -0.18, y: -0.12 }, highlights: { x: 0.12, y: 0.06 } },
32
- },
33
- },
34
- {
35
- id: "seventies-stock", name: "70s Stock", group: "Film",
36
- description: "Brown shadows, creamy yellows and heavy grain",
37
- fields: {
38
- temperature: 0.18, tint: 0.04, saturation: 0.9, curves: FADED, grain: 0.34, grainSize: 1.5, halation: 0.34, vignette: 0.16,
39
- wheels: { shadows: { x: 0.2, y: 0.06 }, midtones: { x: 0.06, y: 0.06 } },
40
- hsl: { blue: { hue: -0.1, saturation: -0.28 }, green: { hue: -0.18, saturation: -0.25 } },
41
- },
42
- },
43
- {
44
- id: "teal-amber", name: "Teal & Amber", group: "Cinematic",
45
- description: "The blockbuster split: teal shadows with warm, protected skin",
46
- fields: {
47
- vibrance: 0.14, skinProtect: 0.65, curves: S_CURVE,
48
- wheels: { shadows: { x: -0.38, y: -0.1 }, midtones: { x: -0.02 }, highlights: { x: 0.24, y: 0.08 } },
49
- hsl: { blue: { hue: -0.14, saturation: 0.14 }, aqua: { hue: 0.08, saturation: 0.1 }, orange: { saturation: 0.08 }, green: { hue: 0.2, saturation: -0.22 } },
50
- },
51
- },
52
- {
53
- id: "cold-thriller", name: "Cold Thriller", group: "Cinematic",
54
- description: "Green-blue cold light, dense shadows and muted skin",
55
- fields: {
56
- temperature: -0.2, tint: -0.08, saturation: 0.82, skinProtect: 0.25, curves: S_CURVE, vignette: 0.24,
57
- wheels: { shadows: { x: -0.24, y: 0.08 }, highlights: { x: -0.08, y: 0.06 } },
58
- },
59
- },
60
- {
61
- id: "desert-sun", name: "Desert Sun", group: "Cinematic",
62
- description: "Bleached orange heat with muted blues",
63
- fields: {
64
- temperature: 0.26, exposure: 0.08, saturation: 0.96, curves: SOFT_S, bloom: 0.14, halation: 0.18,
65
- wheels: { shadows: { x: 0.12, y: -0.1 }, highlights: { x: 0.26, y: 0.14 } },
66
- hsl: { blue: { hue: -0.2, saturation: -0.38 }, aqua: { saturation: -0.4 }, green: { hue: -0.25, saturation: -0.42 } },
67
- },
68
- },
69
- {
70
- id: "moody-forest", name: "Moody Forest", group: "Cinematic",
71
- description: "Deep, shifted greens and quiet highlights",
72
- fields: {
73
- exposure: -0.12, highlights: -0.18, skinProtect: 0.4, curves: SOFT_S, vignette: 0.22,
74
- wheels: { shadows: { x: -0.16, y: 0.14 } },
75
- hsl: { green: { hue: 0.22, saturation: -0.14, luminance: -0.22 }, yellow: { hue: 0.2, saturation: -0.16 }, blue: { saturation: -0.2 } },
76
- },
77
- },
78
- {
79
- id: "day-for-night", name: "Day for Night", group: "Cinematic",
80
- description: "Turns daylight into moonlight: dark, blue and low-key",
81
- fields: {
82
- exposure: -1.25, temperature: -0.42, saturation: 0.58, highlights: -0.3, curves: S_CURVE, vignette: 0.38,
83
- wheels: { shadows: { x: -0.26, y: -0.2 }, highlights: { x: -0.2, y: -0.1 } },
84
- },
85
- },
86
- {
87
- id: "clean-commercial", name: "Clean Commercial", group: "Clean",
88
- description: "Bright, true colour with a touch of snap for products and talking heads",
89
- fields: { exposure: 0.08, contrast: 1.05, vibrance: 0.18, skinProtect: 0.6, shadows: 0.08, highlights: -0.08 },
90
- },
91
- {
92
- id: "warm-documentary", name: "Warm Documentary", group: "Clean",
93
- description: "Natural and gently warm, with honest skin",
94
- fields: { temperature: 0.1, vibrance: 0.06, skinProtect: 0.5, curves: SOFT_S, shadows: 0.06, grain: 0.06 },
95
- },
96
- {
97
- id: "soft-pastel", name: "Soft Pastel", group: "Clean",
98
- description: "Airy, low contrast and light, for lifestyle footage",
99
- fields: {
100
- exposure: 0.22, shadows: 0.22, highlights: -0.12, saturation: 0.86, vibrance: 0.1, curves: FADED, bloom: 0.12,
101
- wheels: { shadows: { x: 0.06, y: -0.1 } },
102
- },
103
- },
104
- {
105
- id: "silver-mono", name: "Silver Mono", group: "Mono",
106
- description: "Neutral black and white with real contrast",
107
- fields: { saturation: 0, curves: S_CURVE, grain: 0.2, vignette: 0.12 },
108
- },
109
- {
110
- id: "warm-mono", name: "Warm Mono", group: "Mono",
111
- description: "Black and white, toned like a darkroom print",
112
- fields: { saturation: 0, curves: SOFT_S, grain: 0.18, wheels: { shadows: { x: 0.12, y: -0.04 }, highlights: { x: 0.14, y: 0.08 } } },
113
- },
114
- {
115
- id: "noir", name: "Noir", group: "Mono",
116
- description: "Hard black and white with crushed shadows and heavy corners",
117
- fields: { saturation: 0, contrast: 1.2, blacks: -0.18, curves: S_CURVE, grain: 0.3, vignette: 0.48 },
118
- },
119
- {
120
- id: "bleach-bypass", name: "Bleach Bypass", group: "Stylized",
121
- description: "Silver retained in the print: hard contrast, little colour",
122
- fields: { saturation: 0.45, contrast: 1.22, whites: 0.08, blacks: -0.08, skinProtect: 0.1, grain: 0.14 },
123
- },
124
- {
125
- id: "cross-process", name: "Cross Process", group: "Stylized",
126
- description: "Wrong-chemistry colour: cyan shadows and yellow highlights",
127
- fields: {
128
- vibrance: 0.3, contrast: 1.1, bloom: 0.08,
129
- curves: { r: [[0, 0.04], [0.5, 0.56], [1, 1]], g: [[0, 0], [0.5, 0.52], [1, 1]], b: [[0, 0.14], [0.5, 0.42], [1, 0.82]] },
130
- },
131
- },
132
- {
133
- id: "neon-night", name: "Neon Night", group: "Stylized",
134
- description: "Magenta and cyan city light with glowing highlights",
135
- fields: {
136
- contrast: 1.12, vibrance: 0.32, bloom: 0.32, halation: 0.2, vignette: 0.2,
137
- wheels: { shadows: { x: -0.2, y: -0.3 }, highlights: { x: 0.22, y: -0.18 } },
138
- hsl: { blue: { hue: 0.14, saturation: 0.25 }, magenta: { saturation: 0.25 }, red: { hue: 0.14, saturation: 0.1 } },
139
- },
140
- },
141
- {
142
- id: "vhs-memory", name: "VHS Memory", group: "Stylized",
143
- description: "Washed tape colour with a warm tint and heavy noise",
144
- fields: {
145
- saturation: 1.12, temperature: 0.12, tint: 0.1, curves: FADED, grain: 0.48, grainSize: 2.2, bloom: 0.18, vignette: 0.14,
146
- },
147
- },
148
- ];
149
-
150
- const LOOK_BY_ID = new Map(GRADE_LOOKS.map((look) => [look.id, look]));
151
-
152
- export function gradeLook(id: string): GradeFields | null {
153
- return LOOK_BY_ID.get(id)?.fields ?? null;
154
- }
1
+ // Built-in looks, written as grades so they scale with a strength slider and need no LUT files.
2
+ import type { GradeFields } from "./grade";
3
+
4
+ export interface GradeLook {
5
+ id: string;
6
+ name: string;
7
+ group: "Film" | "Cinematic" | "Clean" | "Mono" | "Stylized";
8
+ description: string;
9
+ fields: GradeFields;
10
+ }
11
+
12
+ const S_CURVE: GradeFields["curves"] = { master: [[0, 0], [0.25, 0.2], [0.75, 0.82], [1, 1]] };
13
+ const SOFT_S: GradeFields["curves"] = { master: [[0, 0], [0.25, 0.225], [0.75, 0.785], [1, 1]] };
14
+ const FADED: GradeFields["curves"] = { master: [[0, 0.07], [0.25, 0.25], [0.75, 0.76], [1, 0.95]] };
15
+
16
+ export const GRADE_LOOKS: GradeLook[] = [
17
+ {
18
+ id: "golden-stock", name: "Golden Stock", group: "Film",
19
+ description: "Warm print film: rich skin, soft amber highlights, gentle halation",
20
+ fields: {
21
+ temperature: 0.14, vibrance: 0.1, skinProtect: 0.2, curves: SOFT_S, halation: 0.25, grain: 0.14,
22
+ wheels: { shadows: { x: 0.08, y: -0.12 }, highlights: { x: 0.2, y: 0.08 } },
23
+ hsl: { orange: { saturation: 0.08 }, green: { hue: -0.08, saturation: -0.18 }, blue: { saturation: -0.12 } },
24
+ },
25
+ },
26
+ {
27
+ id: "faded-print", name: "Faded Print", group: "Film",
28
+ description: "Lifted blacks and quiet colour, like an old print in the sun",
29
+ fields: {
30
+ saturation: 0.86, temperature: 0.06, curves: FADED, grain: 0.2, halation: 0.12,
31
+ wheels: { shadows: { x: -0.18, y: -0.12 }, highlights: { x: 0.12, y: 0.06 } },
32
+ },
33
+ },
34
+ {
35
+ id: "seventies-stock", name: "70s Stock", group: "Film",
36
+ description: "Brown shadows, creamy yellows and heavy grain",
37
+ fields: {
38
+ temperature: 0.18, tint: 0.04, saturation: 0.9, curves: FADED, grain: 0.34, grainSize: 1.5, halation: 0.34, vignette: 0.16,
39
+ wheels: { shadows: { x: 0.2, y: 0.06 }, midtones: { x: 0.06, y: 0.06 } },
40
+ hsl: { blue: { hue: -0.1, saturation: -0.28 }, green: { hue: -0.18, saturation: -0.25 } },
41
+ },
42
+ },
43
+ {
44
+ id: "teal-amber", name: "Teal & Amber", group: "Cinematic",
45
+ description: "The blockbuster split: teal shadows with warm, protected skin",
46
+ fields: {
47
+ vibrance: 0.14, skinProtect: 0.65, curves: S_CURVE,
48
+ wheels: { shadows: { x: -0.38, y: -0.1 }, midtones: { x: -0.02 }, highlights: { x: 0.24, y: 0.08 } },
49
+ hsl: { blue: { hue: -0.14, saturation: 0.14 }, aqua: { hue: 0.08, saturation: 0.1 }, orange: { saturation: 0.08 }, green: { hue: 0.2, saturation: -0.22 } },
50
+ },
51
+ },
52
+ {
53
+ id: "cold-thriller", name: "Cold Thriller", group: "Cinematic",
54
+ description: "Green-blue cold light, dense shadows and muted skin",
55
+ fields: {
56
+ temperature: -0.2, tint: -0.08, saturation: 0.82, skinProtect: 0.25, curves: S_CURVE, vignette: 0.24,
57
+ wheels: { shadows: { x: -0.24, y: 0.08 }, highlights: { x: -0.08, y: 0.06 } },
58
+ },
59
+ },
60
+ {
61
+ id: "desert-sun", name: "Desert Sun", group: "Cinematic",
62
+ description: "Bleached orange heat with muted blues",
63
+ fields: {
64
+ temperature: 0.26, exposure: 0.08, saturation: 0.96, curves: SOFT_S, bloom: 0.14, halation: 0.18,
65
+ wheels: { shadows: { x: 0.12, y: -0.1 }, highlights: { x: 0.26, y: 0.14 } },
66
+ hsl: { blue: { hue: -0.2, saturation: -0.38 }, aqua: { saturation: -0.4 }, green: { hue: -0.25, saturation: -0.42 } },
67
+ },
68
+ },
69
+ {
70
+ id: "moody-forest", name: "Moody Forest", group: "Cinematic",
71
+ description: "Deep, shifted greens and quiet highlights",
72
+ fields: {
73
+ exposure: -0.12, highlights: -0.18, skinProtect: 0.4, curves: SOFT_S, vignette: 0.22,
74
+ wheels: { shadows: { x: -0.16, y: 0.14 } },
75
+ hsl: { green: { hue: 0.22, saturation: -0.14, luminance: -0.22 }, yellow: { hue: 0.2, saturation: -0.16 }, blue: { saturation: -0.2 } },
76
+ },
77
+ },
78
+ {
79
+ id: "day-for-night", name: "Day for Night", group: "Cinematic",
80
+ description: "Turns daylight into moonlight: dark, blue and low-key",
81
+ fields: {
82
+ exposure: -1.25, temperature: -0.42, saturation: 0.58, highlights: -0.3, curves: S_CURVE, vignette: 0.38,
83
+ wheels: { shadows: { x: -0.26, y: -0.2 }, highlights: { x: -0.2, y: -0.1 } },
84
+ },
85
+ },
86
+ {
87
+ id: "clean-commercial", name: "Clean Commercial", group: "Clean",
88
+ description: "Bright, true colour with a touch of snap for products and talking heads",
89
+ fields: { exposure: 0.08, contrast: 1.05, vibrance: 0.18, skinProtect: 0.6, shadows: 0.08, highlights: -0.08 },
90
+ },
91
+ {
92
+ id: "warm-documentary", name: "Warm Documentary", group: "Clean",
93
+ description: "Natural and gently warm, with honest skin",
94
+ fields: { temperature: 0.1, vibrance: 0.06, skinProtect: 0.5, curves: SOFT_S, shadows: 0.06, grain: 0.06 },
95
+ },
96
+ {
97
+ id: "soft-pastel", name: "Soft Pastel", group: "Clean",
98
+ description: "Airy, low contrast and light, for lifestyle footage",
99
+ fields: {
100
+ exposure: 0.22, shadows: 0.22, highlights: -0.12, saturation: 0.86, vibrance: 0.1, curves: FADED, bloom: 0.12,
101
+ wheels: { shadows: { x: 0.06, y: -0.1 } },
102
+ },
103
+ },
104
+ {
105
+ id: "silver-mono", name: "Silver Mono", group: "Mono",
106
+ description: "Neutral black and white with real contrast",
107
+ fields: { saturation: 0, curves: S_CURVE, grain: 0.2, vignette: 0.12 },
108
+ },
109
+ {
110
+ id: "warm-mono", name: "Warm Mono", group: "Mono",
111
+ description: "Black and white, toned like a darkroom print",
112
+ fields: { saturation: 0, curves: SOFT_S, grain: 0.18, wheels: { shadows: { x: 0.12, y: -0.04 }, highlights: { x: 0.14, y: 0.08 } } },
113
+ },
114
+ {
115
+ id: "noir", name: "Noir", group: "Mono",
116
+ description: "Hard black and white with crushed shadows and heavy corners",
117
+ fields: { saturation: 0, contrast: 1.2, blacks: -0.18, curves: S_CURVE, grain: 0.3, vignette: 0.48 },
118
+ },
119
+ {
120
+ id: "bleach-bypass", name: "Bleach Bypass", group: "Stylized",
121
+ description: "Silver retained in the print: hard contrast, little colour",
122
+ fields: { saturation: 0.45, contrast: 1.22, whites: 0.08, blacks: -0.08, skinProtect: 0.1, grain: 0.14 },
123
+ },
124
+ {
125
+ id: "cross-process", name: "Cross Process", group: "Stylized",
126
+ description: "Wrong-chemistry colour: cyan shadows and yellow highlights",
127
+ fields: {
128
+ vibrance: 0.3, contrast: 1.1, bloom: 0.08,
129
+ curves: { r: [[0, 0.04], [0.5, 0.56], [1, 1]], g: [[0, 0], [0.5, 0.52], [1, 1]], b: [[0, 0.14], [0.5, 0.42], [1, 0.82]] },
130
+ },
131
+ },
132
+ {
133
+ id: "neon-night", name: "Neon Night", group: "Stylized",
134
+ description: "Magenta and cyan city light with glowing highlights",
135
+ fields: {
136
+ contrast: 1.12, vibrance: 0.32, bloom: 0.32, halation: 0.2, vignette: 0.2,
137
+ wheels: { shadows: { x: -0.2, y: -0.3 }, highlights: { x: 0.22, y: -0.18 } },
138
+ hsl: { blue: { hue: 0.14, saturation: 0.25 }, magenta: { saturation: 0.25 }, red: { hue: 0.14, saturation: 0.1 } },
139
+ },
140
+ },
141
+ {
142
+ id: "vhs-memory", name: "VHS Memory", group: "Stylized",
143
+ description: "Washed tape colour with a warm tint and heavy noise",
144
+ fields: {
145
+ saturation: 1.12, temperature: 0.12, tint: 0.1, curves: FADED, grain: 0.48, grainSize: 2.2, bloom: 0.18, vignette: 0.14,
146
+ },
147
+ },
148
+ ];
149
+
150
+ const LOOK_BY_ID = new Map(GRADE_LOOKS.map((look) => [look.id, look]));
151
+
152
+ export function gradeLook(id: string): GradeFields | null {
153
+ return LOOK_BY_ID.get(id)?.fields ?? null;
154
+ }
@@ -1,166 +1,166 @@
1
- import { AbsoluteFill, useCurrentFrame } from "remotion";
2
- import { FONTS, exitOut, fill, glowStyle, mix, onColor, pop, ramp, unit } from "../lib";
3
- import type { MotionBaseProps } from "../types";
4
-
5
- type Props = MotionBaseProps & {
6
- from: number;
7
- final: string;
8
- style: string;
9
- color: string;
10
- accent: string;
11
- track: string;
12
- background: string;
13
- size: number;
14
- font: string;
15
- glow: boolean;
16
- };
17
-
18
- /**
19
- * A countdown: big numbers count down from `from`, each punching in on its own beat with an arc
20
- * draining around it, then the final word lands. The clip is split evenly among the beats.
21
- */
22
- export function Countdown(props: Props) {
23
- const frame = useCurrentFrame();
24
- const { width, height, fps, durationInFrames: d } = props;
25
- const u = unit(width, height);
26
- const vertical = height > width;
27
- const out = exitOut(frame, d, 10);
28
- const from = Math.max(1, Math.round(props.from));
29
- const hasFinal = props.final.trim().length > 0;
30
- const beats = from + (hasFinal ? 1 : 0);
31
- const beat = d / beats;
32
- const index = Math.min(beats - 1, Math.floor(frame / beat));
33
- const local = frame - index * beat;
34
- const progress = Math.min(1, local / beat);
35
- const isFinal = hasFinal && index === from;
36
- const isLast = index === beats - 1;
37
- const label = isFinal ? props.final : String(from - index);
38
-
39
- const base = (props.size / 100) * Math.min(width, height) * (vertical ? 1.1 : 1);
40
- const hit = pop(local, fps, 0, 320);
41
- // Each number leaves fast in the last frames of its beat (the last one stays for the clip's exit).
42
- const leave = isLast ? 0 : ramp(local, beat - 4, 4);
43
- const ringSize = base * 2.3;
44
- const stroke = Math.max(3, base * (props.style === "minimal" ? 0.025 : 0.07));
45
- const radius = (ringSize - stroke) / 2;
46
- const circumference = 2 * Math.PI * radius;
47
- const finalLength = Math.max(1, Array.from(label).length);
48
- // Long final words shrink to fit the frame.
49
- const fontSize = isFinal
50
- ? Math.min(base * 1.05, (width * (vertical ? 0.86 : 0.8)) / (finalLength * 0.62))
51
- : base * (props.style === "bold" ? 1.35 : 1);
52
-
53
- const scale =
54
- props.style === "bold" ? mix(1.9, 1, hit) * mix(1, 0.7, leave) : mix(0.55, 1, hit) * mix(1, 1.25, leave);
55
- const shake = props.style === "bold" && local < 6 ? Math.sin(local * 2.6) * (1 - local / 6) * 14 * u : 0;
56
- const color = isFinal ? props.accent : props.color;
57
- const font = FONTS[props.font] ?? FONTS.condensed;
58
-
59
- return (
60
- <AbsoluteFill
61
- style={{ background: fill(props.background), alignItems: "center", justifyContent: "center", opacity: out }}
62
- >
63
- {props.glow ? (
64
- <div
65
- style={glowStyle(width / 2, height / 2, ringSize * 1.8, ringSize * 1.8, props.accent, (isFinal ? 0.55 : 0.3) * hit)}
66
- />
67
- ) : null}
68
-
69
- {props.style === "bold" && !isFinal ? (
70
- // A solid disc punches behind every number, alternating accent and track.
71
- <div
72
- style={{
73
- position: "absolute",
74
- width: ringSize,
75
- height: ringSize,
76
- borderRadius: "50%",
77
- background: index % 2 === 0 ? props.accent : props.track,
78
- transform: `scale(${mix(0.2, 1, hit) * mix(1, 1.6, leave)})`,
79
- opacity: 1 - leave,
80
- }}
81
- />
82
- ) : null}
83
-
84
- {props.style === "ring" || (props.style === "bold" && isFinal) ? (
85
- <svg
86
- width={ringSize}
87
- height={ringSize}
88
- style={{ position: "absolute", transform: `rotate(-90deg) scale(${isFinal ? mix(0.8, 1.15, ramp(local, 0, 20)) : 1})` }}
89
- >
90
- <circle cx={ringSize / 2} cy={ringSize / 2} r={radius} fill="none" stroke={props.track} strokeWidth={stroke} />
91
- {!isFinal ? (
92
- <circle
93
- cx={ringSize / 2}
94
- cy={ringSize / 2}
95
- r={radius}
96
- fill="none"
97
- stroke={props.accent}
98
- strokeWidth={stroke}
99
- strokeLinecap="round"
100
- strokeDasharray={circumference}
101
- strokeDashoffset={circumference * progress}
102
- />
103
- ) : null}
104
- </svg>
105
- ) : null}
106
-
107
- {isFinal
108
- ? // Two rings ripple out as the final word lands.
109
- [0, 6].map((delay) => {
110
- const t = ramp(local, delay, 22);
111
- if (t <= 0 || t >= 1) return null;
112
- return (
113
- <div
114
- key={delay}
115
- style={{
116
- position: "absolute",
117
- width: ringSize,
118
- height: ringSize,
119
- borderRadius: "50%",
120
- border: `${Math.max(2, stroke * 0.6)}px solid ${props.accent}`,
121
- transform: `scale(${mix(0.6, 1.9, t)})`,
122
- opacity: 1 - t,
123
- }}
124
- />
125
- );
126
- })
127
- : null}
128
-
129
- <div
130
- style={{
131
- position: "relative",
132
- fontFamily: font,
133
- fontWeight: props.font === "condensed" ? 400 : props.style === "minimal" ? 300 : 800,
134
- fontSize,
135
- lineHeight: 1,
136
- letterSpacing: "-0.02em",
137
- fontVariantNumeric: "tabular-nums",
138
- whiteSpace: "nowrap",
139
- color: props.style === "bold" && !isFinal && index % 2 === 0 ? onColor(props.accent) : color,
140
- opacity: Math.min(1, hit * 1.5) * (1 - leave),
141
- transform: `translateX(${shake}px) scale(${scale})`,
142
- }}
143
- >
144
- {label}
145
- </div>
146
-
147
- {props.style === "minimal" && !isFinal ? (
148
- // A thin progress line under the number.
149
- <div
150
- style={{
151
- position: "absolute",
152
- top: height / 2 + base * 0.78,
153
- width: base * 1.4,
154
- height: Math.max(2, 3 * u),
155
- background: props.track,
156
- borderRadius: 99,
157
- overflow: "hidden",
158
- }}
159
- >
160
- <div style={{ width: `${(1 - progress) * 100}%`, height: "100%", background: props.accent }} />
161
- </div>
162
- ) : null}
163
- </AbsoluteFill>
164
- );
165
- }
166
-
1
+ import { AbsoluteFill, useCurrentFrame } from "remotion";
2
+ import { FONTS, exitOut, fill, glowStyle, mix, onColor, pop, ramp, unit } from "../lib";
3
+ import type { MotionBaseProps } from "../types";
4
+
5
+ type Props = MotionBaseProps & {
6
+ from: number;
7
+ final: string;
8
+ style: string;
9
+ color: string;
10
+ accent: string;
11
+ track: string;
12
+ background: string;
13
+ size: number;
14
+ font: string;
15
+ glow: boolean;
16
+ };
17
+
18
+ /**
19
+ * A countdown: big numbers count down from `from`, each punching in on its own beat with an arc
20
+ * draining around it, then the final word lands. The clip is split evenly among the beats.
21
+ */
22
+ export function Countdown(props: Props) {
23
+ const frame = useCurrentFrame();
24
+ const { width, height, fps, durationInFrames: d } = props;
25
+ const u = unit(width, height);
26
+ const vertical = height > width;
27
+ const out = exitOut(frame, d, 10);
28
+ const from = Math.max(1, Math.round(props.from));
29
+ const hasFinal = props.final.trim().length > 0;
30
+ const beats = from + (hasFinal ? 1 : 0);
31
+ const beat = d / beats;
32
+ const index = Math.min(beats - 1, Math.floor(frame / beat));
33
+ const local = frame - index * beat;
34
+ const progress = Math.min(1, local / beat);
35
+ const isFinal = hasFinal && index === from;
36
+ const isLast = index === beats - 1;
37
+ const label = isFinal ? props.final : String(from - index);
38
+
39
+ const base = (props.size / 100) * Math.min(width, height) * (vertical ? 1.1 : 1);
40
+ const hit = pop(local, fps, 0, 320);
41
+ // Each number leaves fast in the last frames of its beat (the last one stays for the clip's exit).
42
+ const leave = isLast ? 0 : ramp(local, beat - 4, 4);
43
+ const ringSize = base * 2.3;
44
+ const stroke = Math.max(3, base * (props.style === "minimal" ? 0.025 : 0.07));
45
+ const radius = (ringSize - stroke) / 2;
46
+ const circumference = 2 * Math.PI * radius;
47
+ const finalLength = Math.max(1, Array.from(label).length);
48
+ // Long final words shrink to fit the frame.
49
+ const fontSize = isFinal
50
+ ? Math.min(base * 1.05, (width * (vertical ? 0.86 : 0.8)) / (finalLength * 0.62))
51
+ : base * (props.style === "bold" ? 1.35 : 1);
52
+
53
+ const scale =
54
+ props.style === "bold" ? mix(1.9, 1, hit) * mix(1, 0.7, leave) : mix(0.55, 1, hit) * mix(1, 1.25, leave);
55
+ const shake = props.style === "bold" && local < 6 ? Math.sin(local * 2.6) * (1 - local / 6) * 14 * u : 0;
56
+ const color = isFinal ? props.accent : props.color;
57
+ const font = FONTS[props.font] ?? FONTS.condensed;
58
+
59
+ return (
60
+ <AbsoluteFill
61
+ style={{ background: fill(props.background), alignItems: "center", justifyContent: "center", opacity: out }}
62
+ >
63
+ {props.glow ? (
64
+ <div
65
+ style={glowStyle(width / 2, height / 2, ringSize * 1.8, ringSize * 1.8, props.accent, (isFinal ? 0.55 : 0.3) * hit)}
66
+ />
67
+ ) : null}
68
+
69
+ {props.style === "bold" && !isFinal ? (
70
+ // A solid disc punches behind every number, alternating accent and track.
71
+ <div
72
+ style={{
73
+ position: "absolute",
74
+ width: ringSize,
75
+ height: ringSize,
76
+ borderRadius: "50%",
77
+ background: index % 2 === 0 ? props.accent : props.track,
78
+ transform: `scale(${mix(0.2, 1, hit) * mix(1, 1.6, leave)})`,
79
+ opacity: 1 - leave,
80
+ }}
81
+ />
82
+ ) : null}
83
+
84
+ {props.style === "ring" || (props.style === "bold" && isFinal) ? (
85
+ <svg
86
+ width={ringSize}
87
+ height={ringSize}
88
+ style={{ position: "absolute", transform: `rotate(-90deg) scale(${isFinal ? mix(0.8, 1.15, ramp(local, 0, 20)) : 1})` }}
89
+ >
90
+ <circle cx={ringSize / 2} cy={ringSize / 2} r={radius} fill="none" stroke={props.track} strokeWidth={stroke} />
91
+ {!isFinal ? (
92
+ <circle
93
+ cx={ringSize / 2}
94
+ cy={ringSize / 2}
95
+ r={radius}
96
+ fill="none"
97
+ stroke={props.accent}
98
+ strokeWidth={stroke}
99
+ strokeLinecap="round"
100
+ strokeDasharray={circumference}
101
+ strokeDashoffset={circumference * progress}
102
+ />
103
+ ) : null}
104
+ </svg>
105
+ ) : null}
106
+
107
+ {isFinal
108
+ ? // Two rings ripple out as the final word lands.
109
+ [0, 6].map((delay) => {
110
+ const t = ramp(local, delay, 22);
111
+ if (t <= 0 || t >= 1) return null;
112
+ return (
113
+ <div
114
+ key={delay}
115
+ style={{
116
+ position: "absolute",
117
+ width: ringSize,
118
+ height: ringSize,
119
+ borderRadius: "50%",
120
+ border: `${Math.max(2, stroke * 0.6)}px solid ${props.accent}`,
121
+ transform: `scale(${mix(0.6, 1.9, t)})`,
122
+ opacity: 1 - t,
123
+ }}
124
+ />
125
+ );
126
+ })
127
+ : null}
128
+
129
+ <div
130
+ style={{
131
+ position: "relative",
132
+ fontFamily: font,
133
+ fontWeight: props.font === "condensed" ? 400 : props.style === "minimal" ? 300 : 800,
134
+ fontSize,
135
+ lineHeight: 1,
136
+ letterSpacing: "-0.02em",
137
+ fontVariantNumeric: "tabular-nums",
138
+ whiteSpace: "nowrap",
139
+ color: props.style === "bold" && !isFinal && index % 2 === 0 ? onColor(props.accent) : color,
140
+ opacity: Math.min(1, hit * 1.5) * (1 - leave),
141
+ transform: `translateX(${shake}px) scale(${scale})`,
142
+ }}
143
+ >
144
+ {label}
145
+ </div>
146
+
147
+ {props.style === "minimal" && !isFinal ? (
148
+ // A thin progress line under the number.
149
+ <div
150
+ style={{
151
+ position: "absolute",
152
+ top: height / 2 + base * 0.78,
153
+ width: base * 1.4,
154
+ height: Math.max(2, 3 * u),
155
+ background: props.track,
156
+ borderRadius: 99,
157
+ overflow: "hidden",
158
+ }}
159
+ >
160
+ <div style={{ width: `${(1 - progress) * 100}%`, height: "100%", background: props.accent }} />
161
+ </div>
162
+ ) : null}
163
+ </AbsoluteFill>
164
+ );
165
+ }
166
+