agentcut 0.2.26 → 0.2.28
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 +177 -177
- package/dist/studio/agents/claude.js +3 -2
- package/dist/studio/agents/claude.js.map +1 -1
- package/dist/studio/chat.js +1 -1
- package/dist/studio/chat.js.map +1 -1
- package/dist/studio/cli.js +24 -24
- package/dist/studio/download.d.ts +24 -0
- package/dist/studio/download.js +234 -0
- package/dist/studio/download.js.map +1 -0
- package/dist/studio/host.js +8 -0
- package/dist/studio/host.js.map +1 -1
- package/dist/studio/housekeeping.d.ts +2 -2
- package/dist/studio/housekeeping.js +18 -17
- package/dist/studio/housekeeping.js.map +1 -1
- package/dist/studio/release-cursor.js +21 -21
- package/dist/studio/release-video.js +10 -10
- package/dist/studio/schema.d.ts +102 -0
- package/dist/studio/schema.js +5 -0
- package/dist/studio/schema.js.map +1 -1
- package/dist/studio/tools.js +7 -0
- package/dist/studio/tools.js.map +1 -1
- package/package.json +56 -56
- package/template/AGENTS.md +14 -14
- package/template/components/README.md +70 -70
- package/template/components/before-after/BeforeAfter.tsx +89 -89
- package/template/components/catalog.ts +107 -107
- package/template/components/cinematic/Device3D.tsx +324 -324
- package/template/components/cinematic/devices3d/display-model.ts +184 -184
- package/template/components/cinematic/devices3d/iphone-model.ts +643 -643
- package/template/components/cinematic/devices3d/macbook-model.ts +608 -608
- package/template/components/cinematic/devices3d/models.ts +657 -657
- package/template/components/cinematic/devices3d/runtime.ts +267 -267
- package/template/components/cinematic/math.ts +100 -100
- package/template/components/color/grade-effect.ts +650 -650
- package/template/components/color/grade.ts +512 -512
- package/template/components/color/looks.ts +154 -154
- package/template/components/countdown/Countdown.tsx +166 -166
- package/template/components/dot-trace-title/DotTraceTitle.tsx +181 -181
- package/template/components/dot-trace-title/meta.json +51 -51
- package/template/components/generate/GenerateReveal.tsx +381 -381
- package/template/components/hook-card/HookCard.tsx +554 -554
- package/template/components/index.ts +199 -199
- package/template/components/lib.ts +191 -191
- package/template/components/line-diagram/LineDiagram.tsx +205 -205
- package/template/components/line-diagram/meta.json +215 -215
- package/template/components/list-card/ListCard.tsx +104 -104
- package/template/components/live-clip.ts +75 -75
- package/template/components/looks.tsx +1447 -1447
- package/template/components/loops/LoopCanvas.tsx +132 -132
- package/template/components/loops/engine.ts +184 -184
- package/template/components/loops/library.ts +667 -667
- package/template/components/loops/library2.ts +777 -777
- package/template/components/motion-loop/MotionLoop.tsx +37 -37
- package/template/components/motion-loop/meta.json +311 -311
- package/template/components/props.ts +73 -73
- package/template/components/quote-card/QuoteCard.tsx +71 -71
- package/template/components/style-layer.tsx +233 -233
- package/template/components/styles.ts +113 -113
- package/template/components/types.ts +66 -66
- package/template/components/word-pop/WordPop.tsx +59 -59
- package/template/components/word-stack/WordStack.tsx +122 -122
- package/template/presets/charcoal-sketch/PROMPT.md +48 -48
- package/template/presets/charcoal-sketch/scripts/duck_music.py +34 -34
- package/template/presets/punk-cut-paper/scenes/Motif.tsx +376 -376
- package/template/presets/punk-cut-paper/scenes/Photo.tsx +73 -73
- package/template/presets/punk-cut-paper/scenes/Ransom.tsx +119 -119
- package/template/runtime/composition.tsx +1207 -1189
- package/template/runtime/helpers.tsx +230 -230
- package/template/runtime/index.tsx +26 -22
- package/template/runtime/types.ts +324 -315
- package/template/skill/SKILL.md +188 -187
- package/template/skill/references/broll.md +44 -44
- package/template/skill/references/browser-export.md +61 -61
- package/template/skill/references/cinematic.md +206 -206
- package/template/skill/references/color.md +79 -79
- package/template/skill/references/craft.md +97 -97
- package/template/skill/references/editing-styles.md +57 -57
- package/template/skill/references/feature-launch.md +34 -34
- package/template/skill/references/footage.md +72 -72
- package/template/skill/references/format.md +145 -142
- package/template/skill/references/how-to.md +146 -146
- package/template/skill/references/launch-direction.md +89 -89
- package/template/skill/references/loops.md +151 -151
- package/template/skill/references/mcp-external.md +19 -19
- package/template/skill/references/performance.md +93 -93
- package/template/skill/references/person-cutout.md +19 -19
- package/template/skill/references/presets.md +60 -60
- package/template/skill/references/product-launch.md +134 -134
- package/template/skill/references/release-capture.md +53 -53
- package/template/skill/references/sound.md +167 -166
- package/template/skill/references/style-spy.md +160 -160
- package/template/skill/references/website-howto.md +45 -45
- package/template/starter/.studio/chat.json +1 -1
- package/template/starter/layers.json +46 -46
- package/template/starter/notes.md +4 -4
- package/template/starter/project.json +13 -13
- package/template/starter/scenes/Title.tsx +38 -38
|
@@ -1,181 +1,181 @@
|
|
|
1
|
-
import { useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
2
|
-
import { AbsoluteFill, useCurrentFrame, useDelayRender } from "remotion";
|
|
3
|
-
import { alpha, exitOut, fill, FONTS, loadMotionFonts, ramp, unit } from "../lib";
|
|
4
|
-
import type { MotionBaseProps } from "../types";
|
|
5
|
-
|
|
6
|
-
type Props = MotionBaseProps & {
|
|
7
|
-
lines: string[];
|
|
8
|
-
font: string;
|
|
9
|
-
weight: string;
|
|
10
|
-
size: number;
|
|
11
|
-
color: string;
|
|
12
|
-
accent: string;
|
|
13
|
-
background: string;
|
|
14
|
-
dot: number;
|
|
15
|
-
build: number;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* "Generated by *multi word* agents" → plain and highlighted runs, spaces kept. A starred run may span
|
|
20
|
-
* words; every star is dropped, so the type and the traced dots spell the same text.
|
|
21
|
-
*/
|
|
22
|
-
function highlightRuns(line: string) {
|
|
23
|
-
return line
|
|
24
|
-
.split(/(\*[^*]+\*)/)
|
|
25
|
-
.filter(Boolean)
|
|
26
|
-
.map((part) => ({ text: part.replace(/\*/g, ""), highlighted: /^\*[^*]+\*$/.test(part) }))
|
|
27
|
-
.filter((run) => run.text);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/** Dots (x, y in grid cells, coverage 0–1) where the headline has ink. */
|
|
31
|
-
interface DotSet {
|
|
32
|
-
cols: number;
|
|
33
|
-
rows: number;
|
|
34
|
-
dots: Float32Array;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* A headline that an agent seems to generate: a scan line traces its letters in dots, the dots swell
|
|
39
|
-
* into the glyphs and the real type resolves out of a blur.
|
|
40
|
-
*/
|
|
41
|
-
export function DotTraceTitle(props: Props) {
|
|
42
|
-
const frame = useCurrentFrame();
|
|
43
|
-
const { width, height, fps, durationInFrames: d } = props;
|
|
44
|
-
const canvas = useRef<HTMLCanvasElement>(null);
|
|
45
|
-
const { delayRender, continueRender } = useDelayRender();
|
|
46
|
-
const u = unit(width, height);
|
|
47
|
-
const fontSize = Math.round((props.size / 100) * Math.min(width, height) * 0.9);
|
|
48
|
-
const family = FONTS[props.font] ?? FONTS.display;
|
|
49
|
-
const font = `${props.weight} ${fontSize}px ${family}`;
|
|
50
|
-
// Spaces collapsed like the DOM does, so the canvas traces exactly the type it resolves into.
|
|
51
|
-
const lines = props.lines
|
|
52
|
-
.map((line) => line.replace(/\s+/g, " ").trim())
|
|
53
|
-
.filter(Boolean)
|
|
54
|
-
.slice(0, 3);
|
|
55
|
-
const text = lines.map((line) => line.replace(/\*/g, ""));
|
|
56
|
-
const textKey = text.join("\n");
|
|
57
|
-
const lineHeight = fontSize * 1.02;
|
|
58
|
-
const top = height / 2 - (lines.length * lineHeight) / 2;
|
|
59
|
-
const pitch = Math.max(4, props.dot * u);
|
|
60
|
-
const buildFrames = Math.max(12, Math.round(props.build * fps));
|
|
61
|
-
const trace = ramp(frame, 0, buildFrames * 0.6);
|
|
62
|
-
const resolve = ramp(frame, buildFrames * 0.45, buildFrames * 0.55);
|
|
63
|
-
const out = exitOut(frame, d, 12);
|
|
64
|
-
|
|
65
|
-
// The dots are traced from the real font, never a fallback: hold the render until this exact face is
|
|
66
|
-
// in (from the first commit, in a layout effect), and release it once a frame is drawn with it, or
|
|
67
|
-
// in cleanup (unmount, StrictMode's second mount, a new font).
|
|
68
|
-
const [fontReady, setFontReady] = useState<string | null>(null);
|
|
69
|
-
const releaseFont = useRef<(() => void) | null>(null);
|
|
70
|
-
useLayoutEffect(() => {
|
|
71
|
-
let alive = true;
|
|
72
|
-
let released = false;
|
|
73
|
-
const handle = delayRender(`Loading ${font} for DotTraceTitle`);
|
|
74
|
-
const release = () => {
|
|
75
|
-
if (released) return;
|
|
76
|
-
released = true;
|
|
77
|
-
continueRender(handle);
|
|
78
|
-
};
|
|
79
|
-
releaseFont.current = release;
|
|
80
|
-
// loadMotionFonts resolves even when the network fails (the type falls back), so this always ends.
|
|
81
|
-
loadMotionFonts()
|
|
82
|
-
.then(() => document.fonts.load(font, textKey || "A"))
|
|
83
|
-
.catch(() => undefined)
|
|
84
|
-
.then(() => {
|
|
85
|
-
if (alive) setFontReady(font);
|
|
86
|
-
});
|
|
87
|
-
return () => {
|
|
88
|
-
alive = false;
|
|
89
|
-
if (releaseFont.current === release) releaseFont.current = null;
|
|
90
|
-
release();
|
|
91
|
-
};
|
|
92
|
-
}, [font, textKey, delayRender, continueRender]);
|
|
93
|
-
const ready = fontReady === font;
|
|
94
|
-
|
|
95
|
-
// Sample the headline's own pixels on a dot grid offscreen, once per text, font and grid.
|
|
96
|
-
const dotSet = useMemo<DotSet | null>(() => {
|
|
97
|
-
if (!ready || typeof document === "undefined") return null;
|
|
98
|
-
const off = document.createElement("canvas");
|
|
99
|
-
off.width = Math.ceil(width / pitch);
|
|
100
|
-
off.height = Math.ceil(height / pitch);
|
|
101
|
-
const o = off.getContext("2d");
|
|
102
|
-
if (!o) return null;
|
|
103
|
-
o.scale(1 / pitch, 1 / pitch);
|
|
104
|
-
o.fillStyle = "#fff";
|
|
105
|
-
o.textAlign = "center";
|
|
106
|
-
o.textBaseline = "middle";
|
|
107
|
-
o.font = font;
|
|
108
|
-
textKey.split("\n").forEach((line, i) => o.fillText(line, width / 2, top + lineHeight * (i + 0.5)));
|
|
109
|
-
const data = o.getImageData(0, 0, off.width, off.height).data;
|
|
110
|
-
const found: number[] = [];
|
|
111
|
-
for (let y = 0; y < off.height; y++) {
|
|
112
|
-
for (let x = 0; x < off.width; x++) {
|
|
113
|
-
const a = data[(y * off.width + x) * 4 + 3] / 255;
|
|
114
|
-
if (a >= 0.2) found.push(x, y, a);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
return { cols: off.width, rows: off.height, dots: Float32Array.from(found) };
|
|
118
|
-
}, [ready, font, textKey, width, height, pitch, top, lineHeight]);
|
|
119
|
-
|
|
120
|
-
// Draw the dots the scan has passed.
|
|
121
|
-
useLayoutEffect(() => {
|
|
122
|
-
const c = canvas.current;
|
|
123
|
-
const ctx = c?.getContext("2d");
|
|
124
|
-
if (c && ctx) {
|
|
125
|
-
ctx.clearRect(0, 0, width, height);
|
|
126
|
-
if (dotSet && resolve < 1) {
|
|
127
|
-
const scanX = trace * (dotSet.cols + 6);
|
|
128
|
-
const { dots } = dotSet;
|
|
129
|
-
for (let i = 0; i < dots.length; i += 3) {
|
|
130
|
-
const x = dots[i];
|
|
131
|
-
const y = dots[i + 1];
|
|
132
|
-
const a = dots[i + 2];
|
|
133
|
-
const behind = scanX - x - (y / dotSet.rows) * 4;
|
|
134
|
-
if (behind < 0) continue;
|
|
135
|
-
const grow = Math.min(1, behind / 6);
|
|
136
|
-
ctx.fillStyle = behind < 2 ? props.accent : alpha(props.color, 0.85);
|
|
137
|
-
ctx.globalAlpha = (1 - resolve) * a;
|
|
138
|
-
ctx.beginPath();
|
|
139
|
-
ctx.arc((x + 0.5) * pitch, (y + 0.5) * pitch, pitch * 0.42 * grow * (0.6 + 0.4 * a), 0, Math.PI * 2);
|
|
140
|
-
ctx.fill();
|
|
141
|
-
}
|
|
142
|
-
// The scan line itself.
|
|
143
|
-
if (trace < 1) {
|
|
144
|
-
ctx.globalAlpha = 0.7 * (1 - resolve);
|
|
145
|
-
ctx.fillStyle = props.accent;
|
|
146
|
-
ctx.fillRect(scanX * pitch, top - fontSize * 0.2, Math.max(2, u * 3), lines.length * lineHeight + fontSize * 0.4);
|
|
147
|
-
}
|
|
148
|
-
ctx.globalAlpha = 1;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
if (ready) releaseFont.current?.();
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
return (
|
|
155
|
-
<AbsoluteFill style={{ background: fill(props.background), opacity: out }}>
|
|
156
|
-
<AbsoluteFill
|
|
157
|
-
style={{
|
|
158
|
-
alignItems: "center",
|
|
159
|
-
justifyContent: "center",
|
|
160
|
-
flexDirection: "column",
|
|
161
|
-
opacity: resolve,
|
|
162
|
-
filter: resolve < 1 ? `blur(${((1 - resolve) * 14 * u).toFixed(2)}px)` : undefined,
|
|
163
|
-
}}
|
|
164
|
-
>
|
|
165
|
-
{lines.map((line, i) => (
|
|
166
|
-
<div
|
|
167
|
-
key={i}
|
|
168
|
-
style={{ font, lineHeight: `${lineHeight}px`, color: props.color, textAlign: "center", whiteSpace: "nowrap" }}
|
|
169
|
-
>
|
|
170
|
-
{highlightRuns(line).map((run, j) => (
|
|
171
|
-
<span key={j} style={{ color: run.highlighted ? props.accent : undefined }}>
|
|
172
|
-
{run.text}
|
|
173
|
-
</span>
|
|
174
|
-
))}
|
|
175
|
-
</div>
|
|
176
|
-
))}
|
|
177
|
-
</AbsoluteFill>
|
|
178
|
-
<canvas ref={canvas} width={width} height={height} style={{ position: "absolute", inset: 0, width: "100%", height: "100%" }} />
|
|
179
|
-
</AbsoluteFill>
|
|
180
|
-
);
|
|
181
|
-
}
|
|
1
|
+
import { useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
2
|
+
import { AbsoluteFill, useCurrentFrame, useDelayRender } from "remotion";
|
|
3
|
+
import { alpha, exitOut, fill, FONTS, loadMotionFonts, ramp, unit } from "../lib";
|
|
4
|
+
import type { MotionBaseProps } from "../types";
|
|
5
|
+
|
|
6
|
+
type Props = MotionBaseProps & {
|
|
7
|
+
lines: string[];
|
|
8
|
+
font: string;
|
|
9
|
+
weight: string;
|
|
10
|
+
size: number;
|
|
11
|
+
color: string;
|
|
12
|
+
accent: string;
|
|
13
|
+
background: string;
|
|
14
|
+
dot: number;
|
|
15
|
+
build: number;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* "Generated by *multi word* agents" → plain and highlighted runs, spaces kept. A starred run may span
|
|
20
|
+
* words; every star is dropped, so the type and the traced dots spell the same text.
|
|
21
|
+
*/
|
|
22
|
+
function highlightRuns(line: string) {
|
|
23
|
+
return line
|
|
24
|
+
.split(/(\*[^*]+\*)/)
|
|
25
|
+
.filter(Boolean)
|
|
26
|
+
.map((part) => ({ text: part.replace(/\*/g, ""), highlighted: /^\*[^*]+\*$/.test(part) }))
|
|
27
|
+
.filter((run) => run.text);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Dots (x, y in grid cells, coverage 0–1) where the headline has ink. */
|
|
31
|
+
interface DotSet {
|
|
32
|
+
cols: number;
|
|
33
|
+
rows: number;
|
|
34
|
+
dots: Float32Array;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* A headline that an agent seems to generate: a scan line traces its letters in dots, the dots swell
|
|
39
|
+
* into the glyphs and the real type resolves out of a blur.
|
|
40
|
+
*/
|
|
41
|
+
export function DotTraceTitle(props: Props) {
|
|
42
|
+
const frame = useCurrentFrame();
|
|
43
|
+
const { width, height, fps, durationInFrames: d } = props;
|
|
44
|
+
const canvas = useRef<HTMLCanvasElement>(null);
|
|
45
|
+
const { delayRender, continueRender } = useDelayRender();
|
|
46
|
+
const u = unit(width, height);
|
|
47
|
+
const fontSize = Math.round((props.size / 100) * Math.min(width, height) * 0.9);
|
|
48
|
+
const family = FONTS[props.font] ?? FONTS.display;
|
|
49
|
+
const font = `${props.weight} ${fontSize}px ${family}`;
|
|
50
|
+
// Spaces collapsed like the DOM does, so the canvas traces exactly the type it resolves into.
|
|
51
|
+
const lines = props.lines
|
|
52
|
+
.map((line) => line.replace(/\s+/g, " ").trim())
|
|
53
|
+
.filter(Boolean)
|
|
54
|
+
.slice(0, 3);
|
|
55
|
+
const text = lines.map((line) => line.replace(/\*/g, ""));
|
|
56
|
+
const textKey = text.join("\n");
|
|
57
|
+
const lineHeight = fontSize * 1.02;
|
|
58
|
+
const top = height / 2 - (lines.length * lineHeight) / 2;
|
|
59
|
+
const pitch = Math.max(4, props.dot * u);
|
|
60
|
+
const buildFrames = Math.max(12, Math.round(props.build * fps));
|
|
61
|
+
const trace = ramp(frame, 0, buildFrames * 0.6);
|
|
62
|
+
const resolve = ramp(frame, buildFrames * 0.45, buildFrames * 0.55);
|
|
63
|
+
const out = exitOut(frame, d, 12);
|
|
64
|
+
|
|
65
|
+
// The dots are traced from the real font, never a fallback: hold the render until this exact face is
|
|
66
|
+
// in (from the first commit, in a layout effect), and release it once a frame is drawn with it, or
|
|
67
|
+
// in cleanup (unmount, StrictMode's second mount, a new font).
|
|
68
|
+
const [fontReady, setFontReady] = useState<string | null>(null);
|
|
69
|
+
const releaseFont = useRef<(() => void) | null>(null);
|
|
70
|
+
useLayoutEffect(() => {
|
|
71
|
+
let alive = true;
|
|
72
|
+
let released = false;
|
|
73
|
+
const handle = delayRender(`Loading ${font} for DotTraceTitle`);
|
|
74
|
+
const release = () => {
|
|
75
|
+
if (released) return;
|
|
76
|
+
released = true;
|
|
77
|
+
continueRender(handle);
|
|
78
|
+
};
|
|
79
|
+
releaseFont.current = release;
|
|
80
|
+
// loadMotionFonts resolves even when the network fails (the type falls back), so this always ends.
|
|
81
|
+
loadMotionFonts()
|
|
82
|
+
.then(() => document.fonts.load(font, textKey || "A"))
|
|
83
|
+
.catch(() => undefined)
|
|
84
|
+
.then(() => {
|
|
85
|
+
if (alive) setFontReady(font);
|
|
86
|
+
});
|
|
87
|
+
return () => {
|
|
88
|
+
alive = false;
|
|
89
|
+
if (releaseFont.current === release) releaseFont.current = null;
|
|
90
|
+
release();
|
|
91
|
+
};
|
|
92
|
+
}, [font, textKey, delayRender, continueRender]);
|
|
93
|
+
const ready = fontReady === font;
|
|
94
|
+
|
|
95
|
+
// Sample the headline's own pixels on a dot grid offscreen, once per text, font and grid.
|
|
96
|
+
const dotSet = useMemo<DotSet | null>(() => {
|
|
97
|
+
if (!ready || typeof document === "undefined") return null;
|
|
98
|
+
const off = document.createElement("canvas");
|
|
99
|
+
off.width = Math.ceil(width / pitch);
|
|
100
|
+
off.height = Math.ceil(height / pitch);
|
|
101
|
+
const o = off.getContext("2d");
|
|
102
|
+
if (!o) return null;
|
|
103
|
+
o.scale(1 / pitch, 1 / pitch);
|
|
104
|
+
o.fillStyle = "#fff";
|
|
105
|
+
o.textAlign = "center";
|
|
106
|
+
o.textBaseline = "middle";
|
|
107
|
+
o.font = font;
|
|
108
|
+
textKey.split("\n").forEach((line, i) => o.fillText(line, width / 2, top + lineHeight * (i + 0.5)));
|
|
109
|
+
const data = o.getImageData(0, 0, off.width, off.height).data;
|
|
110
|
+
const found: number[] = [];
|
|
111
|
+
for (let y = 0; y < off.height; y++) {
|
|
112
|
+
for (let x = 0; x < off.width; x++) {
|
|
113
|
+
const a = data[(y * off.width + x) * 4 + 3] / 255;
|
|
114
|
+
if (a >= 0.2) found.push(x, y, a);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return { cols: off.width, rows: off.height, dots: Float32Array.from(found) };
|
|
118
|
+
}, [ready, font, textKey, width, height, pitch, top, lineHeight]);
|
|
119
|
+
|
|
120
|
+
// Draw the dots the scan has passed.
|
|
121
|
+
useLayoutEffect(() => {
|
|
122
|
+
const c = canvas.current;
|
|
123
|
+
const ctx = c?.getContext("2d");
|
|
124
|
+
if (c && ctx) {
|
|
125
|
+
ctx.clearRect(0, 0, width, height);
|
|
126
|
+
if (dotSet && resolve < 1) {
|
|
127
|
+
const scanX = trace * (dotSet.cols + 6);
|
|
128
|
+
const { dots } = dotSet;
|
|
129
|
+
for (let i = 0; i < dots.length; i += 3) {
|
|
130
|
+
const x = dots[i];
|
|
131
|
+
const y = dots[i + 1];
|
|
132
|
+
const a = dots[i + 2];
|
|
133
|
+
const behind = scanX - x - (y / dotSet.rows) * 4;
|
|
134
|
+
if (behind < 0) continue;
|
|
135
|
+
const grow = Math.min(1, behind / 6);
|
|
136
|
+
ctx.fillStyle = behind < 2 ? props.accent : alpha(props.color, 0.85);
|
|
137
|
+
ctx.globalAlpha = (1 - resolve) * a;
|
|
138
|
+
ctx.beginPath();
|
|
139
|
+
ctx.arc((x + 0.5) * pitch, (y + 0.5) * pitch, pitch * 0.42 * grow * (0.6 + 0.4 * a), 0, Math.PI * 2);
|
|
140
|
+
ctx.fill();
|
|
141
|
+
}
|
|
142
|
+
// The scan line itself.
|
|
143
|
+
if (trace < 1) {
|
|
144
|
+
ctx.globalAlpha = 0.7 * (1 - resolve);
|
|
145
|
+
ctx.fillStyle = props.accent;
|
|
146
|
+
ctx.fillRect(scanX * pitch, top - fontSize * 0.2, Math.max(2, u * 3), lines.length * lineHeight + fontSize * 0.4);
|
|
147
|
+
}
|
|
148
|
+
ctx.globalAlpha = 1;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
if (ready) releaseFont.current?.();
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
return (
|
|
155
|
+
<AbsoluteFill style={{ background: fill(props.background), opacity: out }}>
|
|
156
|
+
<AbsoluteFill
|
|
157
|
+
style={{
|
|
158
|
+
alignItems: "center",
|
|
159
|
+
justifyContent: "center",
|
|
160
|
+
flexDirection: "column",
|
|
161
|
+
opacity: resolve,
|
|
162
|
+
filter: resolve < 1 ? `blur(${((1 - resolve) * 14 * u).toFixed(2)}px)` : undefined,
|
|
163
|
+
}}
|
|
164
|
+
>
|
|
165
|
+
{lines.map((line, i) => (
|
|
166
|
+
<div
|
|
167
|
+
key={i}
|
|
168
|
+
style={{ font, lineHeight: `${lineHeight}px`, color: props.color, textAlign: "center", whiteSpace: "nowrap" }}
|
|
169
|
+
>
|
|
170
|
+
{highlightRuns(line).map((run, j) => (
|
|
171
|
+
<span key={j} style={{ color: run.highlighted ? props.accent : undefined }}>
|
|
172
|
+
{run.text}
|
|
173
|
+
</span>
|
|
174
|
+
))}
|
|
175
|
+
</div>
|
|
176
|
+
))}
|
|
177
|
+
</AbsoluteFill>
|
|
178
|
+
<canvas ref={canvas} width={width} height={height} style={{ position: "absolute", inset: 0, width: "100%", height: "100%" }} />
|
|
179
|
+
</AbsoluteFill>
|
|
180
|
+
);
|
|
181
|
+
}
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "dot-trace-title",
|
|
3
|
-
"name": "Dot Trace Title",
|
|
4
|
-
"category": "Text & Titles",
|
|
5
|
-
"description": "A headline that looks generated by an agent: a scan line traces the letters in dots, the dots swell into the glyphs, and the real type resolves out of a blur.",
|
|
6
|
-
"useWhen": "AI products, agents, 'built by AI', launches of generative features, the moment a product creates something; also a techy title card for dev tools. Two or three short words per line. Mark the accent word with *stars*.",
|
|
7
|
-
"durationInFrames": 90,
|
|
8
|
-
"layer": "overlay",
|
|
9
|
-
"stillAt": 0.75,
|
|
10
|
-
"tags": ["ai", "generate", "dots", "scan", "title", "agent", "tech", "halftone"],
|
|
11
|
-
"props": {
|
|
12
|
-
"lines": { "type": "lines", "label": "Headline", "default": ["Generated", "by *agents*"], "max": 3, "help": "One line per row. *Starred* words (or a *starred phrase*) use the accent." },
|
|
13
|
-
"font": {
|
|
14
|
-
"type": "select",
|
|
15
|
-
"style": "font",
|
|
16
|
-
"label": "Font",
|
|
17
|
-
"default": "display",
|
|
18
|
-
"options": [
|
|
19
|
-
{ "value": "display", "label": "Bricolage" },
|
|
20
|
-
{ "value": "sans", "label": "Inter" },
|
|
21
|
-
{ "value": "grotesk", "label": "Space Grotesk" },
|
|
22
|
-
{ "value": "wide", "label": "Unbounded" },
|
|
23
|
-
{ "value": "serif", "label": "Instrument Serif" },
|
|
24
|
-
{ "value": "mono", "label": "Geist Mono" },
|
|
25
|
-
{ "value": "condensed", "label": "Anton" }
|
|
26
|
-
]
|
|
27
|
-
},
|
|
28
|
-
"weight": {
|
|
29
|
-
"type": "select",
|
|
30
|
-
"style": "weight",
|
|
31
|
-
"label": "Weight",
|
|
32
|
-
"default": "800",
|
|
33
|
-
"options": [
|
|
34
|
-
{ "value": "500", "label": "Medium" },
|
|
35
|
-
{ "value": "700", "label": "Bold" },
|
|
36
|
-
{ "value": "800", "label": "Extra bold" }
|
|
37
|
-
]
|
|
38
|
-
},
|
|
39
|
-
"size": { "type": "number", "label": "Size", "default": 18, "min": 6, "max": 34, "step": 0.5, "unit": "% of frame", "help": "Type size: this share of the frame's short side, times 0.9 (18 is about 16% of the short side)." },
|
|
40
|
-
"color": { "type": "color", "style": "text", "label": "Text", "default": "#ffffff" },
|
|
41
|
-
"accent": { "type": "color", "style": "accent", "label": "Scan and accent", "default": "#7c5cff" },
|
|
42
|
-
"background": { "type": "color", "label": "Background", "default": "transparent" },
|
|
43
|
-
"dot": { "type": "number", "label": "Dot size", "default": 9, "min": 4, "max": 24, "step": 1, "unit": "px", "help": "Dot spacing in px at 1080p on the short side; it scales with the frame size." },
|
|
44
|
-
"build": { "type": "number", "label": "Build time", "default": 1.8, "min": 0.6, "max": 5, "step": 0.1, "unit": "s" }
|
|
45
|
-
},
|
|
46
|
-
"examples": [
|
|
47
|
-
{ "name": "Generated", "props": {} },
|
|
48
|
-
{ "name": "On paper", "props": { "lines": ["Your site,", "*built*"], "color": "#111111", "accent": "#f97316", "background": "#f5f3ee", "font": "grotesk" } },
|
|
49
|
-
{ "name": "Mono", "props": { "lines": ["npx agentcut"], "font": "mono", "weight": "700", "accent": "#22d3ee", "size": 12 } }
|
|
50
|
-
]
|
|
51
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"id": "dot-trace-title",
|
|
3
|
+
"name": "Dot Trace Title",
|
|
4
|
+
"category": "Text & Titles",
|
|
5
|
+
"description": "A headline that looks generated by an agent: a scan line traces the letters in dots, the dots swell into the glyphs, and the real type resolves out of a blur.",
|
|
6
|
+
"useWhen": "AI products, agents, 'built by AI', launches of generative features, the moment a product creates something; also a techy title card for dev tools. Two or three short words per line. Mark the accent word with *stars*.",
|
|
7
|
+
"durationInFrames": 90,
|
|
8
|
+
"layer": "overlay",
|
|
9
|
+
"stillAt": 0.75,
|
|
10
|
+
"tags": ["ai", "generate", "dots", "scan", "title", "agent", "tech", "halftone"],
|
|
11
|
+
"props": {
|
|
12
|
+
"lines": { "type": "lines", "label": "Headline", "default": ["Generated", "by *agents*"], "max": 3, "help": "One line per row. *Starred* words (or a *starred phrase*) use the accent." },
|
|
13
|
+
"font": {
|
|
14
|
+
"type": "select",
|
|
15
|
+
"style": "font",
|
|
16
|
+
"label": "Font",
|
|
17
|
+
"default": "display",
|
|
18
|
+
"options": [
|
|
19
|
+
{ "value": "display", "label": "Bricolage" },
|
|
20
|
+
{ "value": "sans", "label": "Inter" },
|
|
21
|
+
{ "value": "grotesk", "label": "Space Grotesk" },
|
|
22
|
+
{ "value": "wide", "label": "Unbounded" },
|
|
23
|
+
{ "value": "serif", "label": "Instrument Serif" },
|
|
24
|
+
{ "value": "mono", "label": "Geist Mono" },
|
|
25
|
+
{ "value": "condensed", "label": "Anton" }
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
"weight": {
|
|
29
|
+
"type": "select",
|
|
30
|
+
"style": "weight",
|
|
31
|
+
"label": "Weight",
|
|
32
|
+
"default": "800",
|
|
33
|
+
"options": [
|
|
34
|
+
{ "value": "500", "label": "Medium" },
|
|
35
|
+
{ "value": "700", "label": "Bold" },
|
|
36
|
+
{ "value": "800", "label": "Extra bold" }
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"size": { "type": "number", "label": "Size", "default": 18, "min": 6, "max": 34, "step": 0.5, "unit": "% of frame", "help": "Type size: this share of the frame's short side, times 0.9 (18 is about 16% of the short side)." },
|
|
40
|
+
"color": { "type": "color", "style": "text", "label": "Text", "default": "#ffffff" },
|
|
41
|
+
"accent": { "type": "color", "style": "accent", "label": "Scan and accent", "default": "#7c5cff" },
|
|
42
|
+
"background": { "type": "color", "label": "Background", "default": "transparent" },
|
|
43
|
+
"dot": { "type": "number", "label": "Dot size", "default": 9, "min": 4, "max": 24, "step": 1, "unit": "px", "help": "Dot spacing in px at 1080p on the short side; it scales with the frame size." },
|
|
44
|
+
"build": { "type": "number", "label": "Build time", "default": 1.8, "min": 0.6, "max": 5, "step": 0.1, "unit": "s" }
|
|
45
|
+
},
|
|
46
|
+
"examples": [
|
|
47
|
+
{ "name": "Generated", "props": {} },
|
|
48
|
+
{ "name": "On paper", "props": { "lines": ["Your site,", "*built*"], "color": "#111111", "accent": "#f97316", "background": "#f5f3ee", "font": "grotesk" } },
|
|
49
|
+
{ "name": "Mono", "props": { "lines": ["npx agentcut"], "font": "mono", "weight": "700", "accent": "#22d3ee", "size": 12 } }
|
|
50
|
+
]
|
|
51
|
+
}
|