agentcut 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/LICENSE +21 -0
- package/README.md +11 -2
- package/dist/bridge.d.ts +45 -0
- package/dist/bridge.js +691 -0
- package/dist/bridge.js.map +1 -0
- package/dist/config.d.ts +13 -0
- package/dist/config.js +50 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -0
- package/dist/log.d.ts +1 -0
- package/dist/log.js +14 -0
- package/dist/log.js.map +1 -0
- package/dist/studio/agents/claude.d.ts +7 -0
- package/dist/studio/agents/claude.js +155 -0
- package/dist/studio/agents/claude.js.map +1 -0
- package/dist/studio/agents/codex.d.ts +4 -0
- package/dist/studio/agents/codex.js +169 -0
- package/dist/studio/agents/codex.js.map +1 -0
- package/dist/studio/agents/index.d.ts +8 -0
- package/dist/studio/agents/index.js +50 -0
- package/dist/studio/agents/index.js.map +1 -0
- package/dist/studio/agents/types.d.ts +131 -0
- package/dist/studio/agents/types.js +11 -0
- package/dist/studio/agents/types.js.map +1 -0
- package/dist/studio/bundler.d.ts +29 -0
- package/dist/studio/bundler.js +136 -0
- package/dist/studio/bundler.js.map +1 -0
- package/dist/studio/chat.d.ts +147 -0
- package/dist/studio/chat.js +681 -0
- package/dist/studio/chat.js.map +1 -0
- package/dist/studio/cli.d.ts +2 -0
- package/dist/studio/cli.js +194 -0
- package/dist/studio/cli.js.map +1 -0
- package/dist/studio/components.d.ts +4 -0
- package/dist/studio/components.js +36 -0
- package/dist/studio/components.js.map +1 -0
- package/dist/studio/host.d.ts +105 -0
- package/dist/studio/host.js +634 -0
- package/dist/studio/host.js.map +1 -0
- package/dist/studio/http.d.ts +21 -0
- package/dist/studio/http.js +240 -0
- package/dist/studio/http.js.map +1 -0
- package/dist/studio/music.d.ts +35 -0
- package/dist/studio/music.js +130 -0
- package/dist/studio/music.js.map +1 -0
- package/dist/studio/proc.d.ts +11 -0
- package/dist/studio/proc.js +69 -0
- package/dist/studio/proc.js.map +1 -0
- package/dist/studio/projects.d.ts +84 -0
- package/dist/studio/projects.js +369 -0
- package/dist/studio/projects.js.map +1 -0
- package/dist/studio/render.d.ts +24 -0
- package/dist/studio/render.js +197 -0
- package/dist/studio/render.js.map +1 -0
- package/dist/studio/reveal.d.ts +7 -0
- package/dist/studio/reveal.js +49 -0
- package/dist/studio/reveal.js.map +1 -0
- package/dist/studio/schema.d.ts +4152 -0
- package/dist/studio/schema.js +358 -0
- package/dist/studio/schema.js.map +1 -0
- package/dist/studio/tools.d.ts +2 -0
- package/dist/studio/tools.js +165 -0
- package/dist/studio/tools.js.map +1 -0
- package/dist/studio/voice.d.ts +150 -0
- package/dist/studio/voice.js +434 -0
- package/dist/studio/voice.js.map +1 -0
- package/dist/studio/workspace.d.ts +31 -0
- package/dist/studio/workspace.js +187 -0
- package/dist/studio/workspace.js.map +1 -0
- package/package.json +50 -4
- package/template/AGENTS.md +13 -0
- package/template/components/CATALOG.md +1306 -0
- package/template/components/README.md +61 -0
- package/template/components/STYLES.md +246 -0
- package/template/components/arcade-title/ArcadeTitle.tsx +860 -0
- package/template/components/arcade-title/meta.json +28 -0
- package/template/components/aurora/Aurora.tsx +63 -0
- package/template/components/aurora/meta.json +28 -0
- package/template/components/bar-wipe-title/BarWipeTitle.tsx +94 -0
- package/template/components/bar-wipe-title/meta.json +29 -0
- package/template/components/before-after/BeforeAfter.tsx +89 -0
- package/template/components/before-after/meta.json +233 -0
- package/template/components/bento-grid/BentoGrid.tsx +202 -0
- package/template/components/bento-grid/meta.json +25 -0
- package/template/components/blur-in-title/BlurInTitle.tsx +121 -0
- package/template/components/blur-in-title/meta.json +32 -0
- package/template/components/catalog.json +8730 -0
- package/template/components/catalog.ts +103 -0
- package/template/components/chat-thread/ChatThread.tsx +128 -0
- package/template/components/chat-thread/meta.json +24 -0
- package/template/components/checklist/Checklist.tsx +129 -0
- package/template/components/checklist/meta.json +25 -0
- package/template/components/confetti/Confetti.tsx +109 -0
- package/template/components/confetti/meta.json +28 -0
- package/template/components/countdown/Countdown.tsx +166 -0
- package/template/components/countdown/meta.json +28 -0
- package/template/components/cut-and-paste/CutAndPaste.tsx +654 -0
- package/template/components/cut-and-paste/meta.json +29 -0
- package/template/components/decode-text/DecodeText.tsx +97 -0
- package/template/components/decode-text/meta.json +29 -0
- package/template/components/editorial-quote/EditorialQuote.tsx +122 -0
- package/template/components/editorial-quote/meta.json +28 -0
- package/template/components/glitch-title/GlitchTitle.tsx +171 -0
- package/template/components/glitch-title/meta.json +32 -0
- package/template/components/halftone-wave/HalftoneWave.tsx +106 -0
- package/template/components/halftone-wave/meta.json +28 -0
- package/template/components/highlighter/Highlighter.tsx +142 -0
- package/template/components/highlighter/meta.json +28 -0
- package/template/components/hook-card/HookCard.tsx +552 -0
- package/template/components/hook-card/meta.json +304 -0
- package/template/components/index.ts +149 -0
- package/template/components/iris-wipe/IrisWipe.tsx +76 -0
- package/template/components/iris-wipe/meta.json +24 -0
- package/template/components/kinetic-poster/KineticPoster.tsx +437 -0
- package/template/components/kinetic-poster/meta.json +31 -0
- package/template/components/kinetic-punch/KineticPunch.tsx +80 -0
- package/template/components/kinetic-punch/meta.json +30 -0
- package/template/components/lava-lamp/LavaLamp.tsx +92 -0
- package/template/components/lava-lamp/meta.json +28 -0
- package/template/components/letter-cascade/LetterCascade.tsx +102 -0
- package/template/components/letter-cascade/meta.json +29 -0
- package/template/components/lib.ts +179 -0
- package/template/components/light-leak/LightLeakTransition.tsx +43 -0
- package/template/components/light-leak/meta.json +74 -0
- package/template/components/line-diagram/LineDiagram.tsx +205 -0
- package/template/components/line-diagram/meta.json +217 -0
- package/template/components/list-card/ListCard.tsx +104 -0
- package/template/components/list-card/meta.json +232 -0
- package/template/components/logo-sting/LogoSting.tsx +129 -0
- package/template/components/logo-sting/meta.json +29 -0
- package/template/components/looks.tsx +1447 -0
- package/template/components/lower-third/LowerThird.tsx +100 -0
- package/template/components/lower-third/meta.json +24 -0
- package/template/components/marquee/Marquee.tsx +100 -0
- package/template/components/marquee/meta.json +30 -0
- package/template/components/notification/Notification.tsx +115 -0
- package/template/components/notification/meta.json +27 -0
- package/template/components/outline-fill/OutlineFill.tsx +106 -0
- package/template/components/outline-fill/meta.json +28 -0
- package/template/components/panel-sweep/PanelSweep.tsx +86 -0
- package/template/components/panel-sweep/meta.json +25 -0
- package/template/components/prompt-box/PromptBox.tsx +131 -0
- package/template/components/prompt-box/meta.json +24 -0
- package/template/components/props.ts +73 -0
- package/template/components/quote-card/QuoteCard.tsx +71 -0
- package/template/components/quote-card/meta.json +216 -0
- package/template/components/shape-shift/ShapeShift.tsx +420 -0
- package/template/components/shape-shift/meta.json +31 -0
- package/template/components/slide-zoom-message/SlideZoomMessage.tsx +179 -0
- package/template/components/slide-zoom-message/meta.json +199 -0
- package/template/components/social-post/SocialPost.tsx +185 -0
- package/template/components/social-post/meta.json +30 -0
- package/template/components/split-flap/SplitFlap.tsx +191 -0
- package/template/components/split-flap/meta.json +29 -0
- package/template/components/spotlight-grid/SpotlightGrid.tsx +84 -0
- package/template/components/spotlight-grid/meta.json +25 -0
- package/template/components/stat-counter/StatCounter.tsx +117 -0
- package/template/components/stat-counter/meta.json +27 -0
- package/template/components/sticker-badge/StickerBadge.tsx +46 -0
- package/template/components/sticker-badge/meta.json +220 -0
- package/template/components/sticker-slam/StickerSlam.tsx +941 -0
- package/template/components/sticker-slam/meta.json +34 -0
- package/template/components/style-layer.tsx +233 -0
- package/template/components/styles.json +762 -0
- package/template/components/styles.ts +113 -0
- package/template/components/target-lock/TargetLock.tsx +662 -0
- package/template/components/target-lock/meta.json +32 -0
- package/template/components/text-reveal/TextReveal.tsx +99 -0
- package/template/components/text-reveal/meta.json +28 -0
- package/template/components/tile-wipe/TileWipe.tsx +75 -0
- package/template/components/tile-wipe/meta.json +24 -0
- package/template/components/type-zoom/TypeZoom.tsx +103 -0
- package/template/components/type-zoom/meta.json +27 -0
- package/template/components/types.ts +66 -0
- package/template/components/typewriter/Typewriter.tsx +112 -0
- package/template/components/typewriter/meta.json +29 -0
- package/template/components/word-pop/WordPop.tsx +59 -0
- package/template/components/word-pop/meta.json +237 -0
- package/template/components/word-stack/WordStack.tsx +122 -0
- package/template/components/word-stack/meta.json +27 -0
- package/template/components/word-swap/WordSwap.tsx +127 -0
- package/template/components/word-swap/meta.json +30 -0
- package/template/presets/charcoal-sketch/PROMPT.md +48 -0
- package/template/presets/charcoal-sketch/assets/paper/grain-0.png +0 -0
- package/template/presets/charcoal-sketch/assets/paper/grain-1.png +0 -0
- package/template/presets/charcoal-sketch/assets/paper/grain-2.png +0 -0
- package/template/presets/charcoal-sketch/assets/paper/sketch-paper.jpg +0 -0
- package/template/presets/charcoal-sketch/assets/paper/smudge.png +0 -0
- package/template/presets/charcoal-sketch/poster.jpg +0 -0
- package/template/presets/charcoal-sketch/preset.json +17 -0
- package/template/presets/charcoal-sketch/preview.mp4 +0 -0
- package/template/presets/charcoal-sketch/scenes/Grain.tsx +23 -0
- package/template/presets/charcoal-sketch/scenes/Paper.tsx +17 -0
- package/template/presets/charcoal-sketch/scenes/examples/Agents.tsx +100 -0
- package/template/presets/charcoal-sketch/scenes/examples/Approvals.tsx +110 -0
- package/template/presets/charcoal-sketch/scenes/examples/Blog.tsx +105 -0
- package/template/presets/charcoal-sketch/scenes/examples/EndCard.tsx +41 -0
- package/template/presets/charcoal-sketch/scenes/examples/Hook.tsx +130 -0
- package/template/presets/charcoal-sketch/scenes/examples/Ideas.tsx +92 -0
- package/template/presets/charcoal-sketch/scenes/examples/Posting.tsx +128 -0
- package/template/presets/charcoal-sketch/scenes/lib/painfix.tsx +119 -0
- package/template/presets/charcoal-sketch/scenes/lib/sketch.tsx +291 -0
- package/template/presets/charcoal-sketch/scripts/build_layers.example.py +193 -0
- package/template/presets/charcoal-sketch/scripts/duck_music.py +34 -0
- package/template/presets/charcoal-sketch/scripts/make_textures.py +93 -0
- package/template/presets/punk-cut-paper/PROMPT.md +37 -0
- package/template/presets/punk-cut-paper/assets/paper/desk-cream.jpg +0 -0
- package/template/presets/punk-cut-paper/assets/paper/grain-overlay.png +0 -0
- package/template/presets/punk-cut-paper/assets/paper/halftone-black.png +0 -0
- package/template/presets/punk-cut-paper/assets/paper/halftone-red.png +0 -0
- package/template/presets/punk-cut-paper/assets/paper/halftone-yellow.png +0 -0
- package/template/presets/punk-cut-paper/assets/paper/kraft.jpg +0 -0
- package/template/presets/punk-cut-paper/assets/paper/newsprint.jpg +0 -0
- package/template/presets/punk-cut-paper/assets/paper/paper-cream.jpg +0 -0
- package/template/presets/punk-cut-paper/assets/paper/paper-white.jpg +0 -0
- package/template/presets/punk-cut-paper/assets/paper/tape.png +0 -0
- package/template/presets/punk-cut-paper/build_layers.example.py +150 -0
- package/template/presets/punk-cut-paper/poster.jpg +0 -0
- package/template/presets/punk-cut-paper/preset.json +15 -0
- package/template/presets/punk-cut-paper/preview.mp4 +0 -0
- package/template/presets/punk-cut-paper/scenes/Backdrop.tsx +76 -0
- package/template/presets/punk-cut-paper/scenes/Motif.tsx +376 -0
- package/template/presets/punk-cut-paper/scenes/Photo.tsx +73 -0
- package/template/presets/punk-cut-paper/scenes/Ransom.tsx +119 -0
- package/template/presets/punk-cut-paper/scenes/Xerox.tsx +31 -0
- package/template/presets/punk-cut-paper/scenes/lib/punk.tsx +208 -0
- package/template/runtime/composition.tsx +918 -0
- package/template/runtime/helpers.tsx +228 -0
- package/template/runtime/index.tsx +22 -0
- package/template/runtime/types.ts +248 -0
- package/template/skill/SKILL.md +149 -0
- package/template/skill/references/browser-export.md +61 -0
- package/template/skill/references/components.md +38 -0
- package/template/skill/references/craft.md +53 -0
- package/template/skill/references/cursor.md +91 -0
- package/template/skill/references/footage.md +73 -0
- package/template/skill/references/format.md +140 -0
- package/template/skill/references/presets.md +56 -0
- package/template/skill/references/sound.md +128 -0
- package/template/starter/.studio/chat.json +1 -0
- package/template/starter/assets/.keep +0 -0
- package/template/starter/layers.json +46 -0
- package/template/starter/notes.md +4 -0
- package/template/starter/project.json +13 -0
- package/template/starter/renders/.keep +0 -0
- package/template/starter/scenes/Title.tsx +38 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// Metadata only (no React, no Remotion): safe for server components, the sitemap and metadata.
|
|
2
|
+
import type { ComponentMeta } from "./types";
|
|
3
|
+
import lightLeak from "./light-leak/meta.json";
|
|
4
|
+
import lowerThird from "./lower-third/meta.json";
|
|
5
|
+
import promptBox from "./prompt-box/meta.json";
|
|
6
|
+
import slideZoomMessage from "./slide-zoom-message/meta.json";
|
|
7
|
+
import statCounter from "./stat-counter/meta.json";
|
|
8
|
+
import textReveal from "./text-reveal/meta.json";
|
|
9
|
+
import blurInTitle from "./blur-in-title/meta.json";
|
|
10
|
+
import letterCascade from "./letter-cascade/meta.json";
|
|
11
|
+
import typewriter from "./typewriter/meta.json";
|
|
12
|
+
import wordSwap from "./word-swap/meta.json";
|
|
13
|
+
import barWipeTitle from "./bar-wipe-title/meta.json";
|
|
14
|
+
import kineticPunch from "./kinetic-punch/meta.json";
|
|
15
|
+
import decodeText from "./decode-text/meta.json";
|
|
16
|
+
import outlineFill from "./outline-fill/meta.json";
|
|
17
|
+
import editorialQuote from "./editorial-quote/meta.json";
|
|
18
|
+
import highlighter from "./highlighter/meta.json";
|
|
19
|
+
import logoSting from "./logo-sting/meta.json";
|
|
20
|
+
import marquee from "./marquee/meta.json";
|
|
21
|
+
import aurora from "./aurora/meta.json";
|
|
22
|
+
import lavaLamp from "./lava-lamp/meta.json";
|
|
23
|
+
import spotlightGrid from "./spotlight-grid/meta.json";
|
|
24
|
+
import irisWipe from "./iris-wipe/meta.json";
|
|
25
|
+
import panelSweep from "./panel-sweep/meta.json";
|
|
26
|
+
import tileWipe from "./tile-wipe/meta.json";
|
|
27
|
+
import notification from "./notification/meta.json";
|
|
28
|
+
import chatThread from "./chat-thread/meta.json";
|
|
29
|
+
import stickerSlam from "./sticker-slam/meta.json";
|
|
30
|
+
import glitchTitle from "./glitch-title/meta.json";
|
|
31
|
+
import splitFlap from "./split-flap/meta.json";
|
|
32
|
+
import countdown from "./countdown/meta.json";
|
|
33
|
+
import wordStack from "./word-stack/meta.json";
|
|
34
|
+
import typeZoom from "./type-zoom/meta.json";
|
|
35
|
+
import halftoneWave from "./halftone-wave/meta.json";
|
|
36
|
+
import bentoGrid from "./bento-grid/meta.json";
|
|
37
|
+
import socialPost from "./social-post/meta.json";
|
|
38
|
+
import checklist from "./checklist/meta.json";
|
|
39
|
+
import confetti from "./confetti/meta.json";
|
|
40
|
+
import kineticPoster from "./kinetic-poster/meta.json";
|
|
41
|
+
import arcadeTitle from "./arcade-title/meta.json";
|
|
42
|
+
import cutAndPaste from "./cut-and-paste/meta.json";
|
|
43
|
+
import targetLock from "./target-lock/meta.json";
|
|
44
|
+
import shapeShift from "./shape-shift/meta.json";
|
|
45
|
+
import hookCard from "./hook-card/meta.json";
|
|
46
|
+
import wordPop from "./word-pop/meta.json";
|
|
47
|
+
import stickerBadge from "./sticker-badge/meta.json";
|
|
48
|
+
import listCard from "./list-card/meta.json";
|
|
49
|
+
import quoteCard from "./quote-card/meta.json";
|
|
50
|
+
import beforeAfter from "./before-after/meta.json";
|
|
51
|
+
import lineDiagram from "./line-diagram/meta.json";
|
|
52
|
+
|
|
53
|
+
export const COMPONENT_METAS: Record<string, ComponentMeta> = {
|
|
54
|
+
"text-reveal": textReveal as unknown as ComponentMeta,
|
|
55
|
+
"slide-zoom-message": slideZoomMessage as unknown as ComponentMeta,
|
|
56
|
+
"lower-third": lowerThird as unknown as ComponentMeta,
|
|
57
|
+
"stat-counter": statCounter as unknown as ComponentMeta,
|
|
58
|
+
"prompt-box": promptBox as unknown as ComponentMeta,
|
|
59
|
+
"light-leak": lightLeak as unknown as ComponentMeta,
|
|
60
|
+
"blur-in-title": blurInTitle as unknown as ComponentMeta,
|
|
61
|
+
"letter-cascade": letterCascade as unknown as ComponentMeta,
|
|
62
|
+
"typewriter": typewriter as unknown as ComponentMeta,
|
|
63
|
+
"word-swap": wordSwap as unknown as ComponentMeta,
|
|
64
|
+
"bar-wipe-title": barWipeTitle as unknown as ComponentMeta,
|
|
65
|
+
"kinetic-punch": kineticPunch as unknown as ComponentMeta,
|
|
66
|
+
"decode-text": decodeText as unknown as ComponentMeta,
|
|
67
|
+
"outline-fill": outlineFill as unknown as ComponentMeta,
|
|
68
|
+
"editorial-quote": editorialQuote as unknown as ComponentMeta,
|
|
69
|
+
"highlighter": highlighter as unknown as ComponentMeta,
|
|
70
|
+
"logo-sting": logoSting as unknown as ComponentMeta,
|
|
71
|
+
"marquee": marquee as unknown as ComponentMeta,
|
|
72
|
+
"aurora": aurora as unknown as ComponentMeta,
|
|
73
|
+
"lava-lamp": lavaLamp as unknown as ComponentMeta,
|
|
74
|
+
"spotlight-grid": spotlightGrid as unknown as ComponentMeta,
|
|
75
|
+
"iris-wipe": irisWipe as unknown as ComponentMeta,
|
|
76
|
+
"panel-sweep": panelSweep as unknown as ComponentMeta,
|
|
77
|
+
"tile-wipe": tileWipe as unknown as ComponentMeta,
|
|
78
|
+
"notification": notification as unknown as ComponentMeta,
|
|
79
|
+
"chat-thread": chatThread as unknown as ComponentMeta,
|
|
80
|
+
"sticker-slam": stickerSlam as unknown as ComponentMeta,
|
|
81
|
+
"glitch-title": glitchTitle as unknown as ComponentMeta,
|
|
82
|
+
"split-flap": splitFlap as unknown as ComponentMeta,
|
|
83
|
+
"countdown": countdown as unknown as ComponentMeta,
|
|
84
|
+
"word-stack": wordStack as unknown as ComponentMeta,
|
|
85
|
+
"type-zoom": typeZoom as unknown as ComponentMeta,
|
|
86
|
+
"halftone-wave": halftoneWave as unknown as ComponentMeta,
|
|
87
|
+
"bento-grid": bentoGrid as unknown as ComponentMeta,
|
|
88
|
+
"social-post": socialPost as unknown as ComponentMeta,
|
|
89
|
+
"checklist": checklist as unknown as ComponentMeta,
|
|
90
|
+
"confetti": confetti as unknown as ComponentMeta,
|
|
91
|
+
"kinetic-poster": kineticPoster as unknown as ComponentMeta,
|
|
92
|
+
"arcade-title": arcadeTitle as unknown as ComponentMeta,
|
|
93
|
+
"cut-and-paste": cutAndPaste as unknown as ComponentMeta,
|
|
94
|
+
"target-lock": targetLock as unknown as ComponentMeta,
|
|
95
|
+
"shape-shift": shapeShift as unknown as ComponentMeta,
|
|
96
|
+
"hook-card": hookCard as unknown as ComponentMeta,
|
|
97
|
+
"word-pop": wordPop as unknown as ComponentMeta,
|
|
98
|
+
"sticker-badge": stickerBadge as unknown as ComponentMeta,
|
|
99
|
+
"list-card": listCard as unknown as ComponentMeta,
|
|
100
|
+
"quote-card": quoteCard as unknown as ComponentMeta,
|
|
101
|
+
"before-after": beforeAfter as unknown as ComponentMeta,
|
|
102
|
+
"line-diagram": lineDiagram as unknown as ComponentMeta,
|
|
103
|
+
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { AbsoluteFill, spring, useCurrentFrame } from "remotion";
|
|
2
|
+
import { FONTS, exitOut, fill, mix, onColor } from "../lib";
|
|
3
|
+
import type { MotionBaseProps } from "../types";
|
|
4
|
+
|
|
5
|
+
type Props = MotionBaseProps & {
|
|
6
|
+
messages: string[];
|
|
7
|
+
accent: string;
|
|
8
|
+
theme: string;
|
|
9
|
+
background: string;
|
|
10
|
+
size: number;
|
|
11
|
+
typing: boolean;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A chat conversation building up: incoming bubbles (left) are preceded by a typing indicator,
|
|
16
|
+
* outgoing ones (lines starting with ">") pop in on the right. The thread grows from the bottom,
|
|
17
|
+
* gliding up as each new bubble arrives.
|
|
18
|
+
*/
|
|
19
|
+
export function ChatThread(props: Props) {
|
|
20
|
+
const frame = useCurrentFrame();
|
|
21
|
+
const { width, height, fps, durationInFrames: d } = props;
|
|
22
|
+
const vertical = height > width;
|
|
23
|
+
const out = exitOut(frame, d, 12);
|
|
24
|
+
const dark = props.theme === "dark";
|
|
25
|
+
const fontSize = (props.size / 100) * Math.min(width, height) * (vertical ? 1.15 : 1);
|
|
26
|
+
const columnWidth = Math.min(width * (vertical ? 0.88 : 0.5), fontSize * 22);
|
|
27
|
+
const messages = props.messages.map((raw) => {
|
|
28
|
+
const mine = raw.startsWith(">");
|
|
29
|
+
return { mine, text: raw.replace(/^>\s*/, "") };
|
|
30
|
+
});
|
|
31
|
+
// Messages share the clip, leaving a moment at the end to read the last one.
|
|
32
|
+
const step = Math.max(10, Math.min(36, (d - 30) / Math.max(1, messages.length)));
|
|
33
|
+
const typingLead = props.typing ? Math.min(14, step * 0.5) : 0;
|
|
34
|
+
const shownAt = messages.map((m, i) => 6 + i * step + (m.mine ? 0 : typingLead));
|
|
35
|
+
const theirBg = dark ? "#2a2b31" : "#e9e9ee";
|
|
36
|
+
const theirFg = dark ? "#f4f4f5" : "#111114";
|
|
37
|
+
const gap = fontSize * 0.45;
|
|
38
|
+
const bubbleHeight = fontSize * 2.1;
|
|
39
|
+
|
|
40
|
+
// The column is anchored at the bottom: a new bubble pushes the others up at once, so offset
|
|
41
|
+
// the column down by the part of that push the bubble hasn't grown into yet.
|
|
42
|
+
const rowHeight = bubbleHeight + gap;
|
|
43
|
+
const pending = shownAt.reduce((sum, at, i) => {
|
|
44
|
+
const start = props.typing && !messages[i].mine ? at - typingLead : at;
|
|
45
|
+
if (frame < start) return sum;
|
|
46
|
+
return sum + (1 - spring({ frame: frame - start, fps, config: { damping: 20, stiffness: 160 } })) * rowHeight;
|
|
47
|
+
}, 0);
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<AbsoluteFill
|
|
51
|
+
style={{
|
|
52
|
+
background: fill(props.background),
|
|
53
|
+
alignItems: "center",
|
|
54
|
+
justifyContent: "flex-end",
|
|
55
|
+
paddingBottom: height * (vertical ? 0.22 : 0.16),
|
|
56
|
+
overflow: "hidden",
|
|
57
|
+
opacity: out,
|
|
58
|
+
}}
|
|
59
|
+
>
|
|
60
|
+
<div
|
|
61
|
+
style={{
|
|
62
|
+
width: columnWidth,
|
|
63
|
+
display: "flex",
|
|
64
|
+
flexDirection: "column",
|
|
65
|
+
gap,
|
|
66
|
+
fontFamily: FONTS.sans,
|
|
67
|
+
fontSize,
|
|
68
|
+
lineHeight: 1.3,
|
|
69
|
+
transform: `translateY(${pending}px)`,
|
|
70
|
+
}}
|
|
71
|
+
>
|
|
72
|
+
{messages.map((m, i) => {
|
|
73
|
+
const at = shownAt[i];
|
|
74
|
+
const pop = spring({ frame: frame - at, fps, config: { damping: 14, stiffness: 190, mass: 0.7 } });
|
|
75
|
+
const typingFrom = at - typingLead;
|
|
76
|
+
const isTyping = !m.mine && props.typing && frame >= typingFrom && frame < at;
|
|
77
|
+
if (!isTyping && frame < at) return null;
|
|
78
|
+
const bg = m.mine ? props.accent : theirBg;
|
|
79
|
+
const fg = m.mine ? onColor(props.accent) : theirFg;
|
|
80
|
+
return (
|
|
81
|
+
<div key={i} style={{ display: "flex", justifyContent: m.mine ? "flex-end" : "flex-start" }}>
|
|
82
|
+
<div
|
|
83
|
+
style={{
|
|
84
|
+
maxWidth: "78%",
|
|
85
|
+
padding: `${fontSize * 0.5}px ${fontSize * 0.8}px`,
|
|
86
|
+
borderRadius: fontSize * 1.05,
|
|
87
|
+
[m.mine ? "borderBottomRightRadius" : "borderBottomLeftRadius"]: fontSize * 0.3,
|
|
88
|
+
background: bg,
|
|
89
|
+
color: fg,
|
|
90
|
+
transformOrigin: m.mine ? "100% 100%" : "0% 100%",
|
|
91
|
+
transform: isTyping
|
|
92
|
+
? `scale(${mix(0.6, 1, Math.min(1, (frame - typingFrom) / 5))})`
|
|
93
|
+
: `scale(${mix(0.4, 1, pop)}) translateY(${(1 - pop) * fontSize}px)`,
|
|
94
|
+
opacity: isTyping ? 1 : Math.min(1, pop * 2),
|
|
95
|
+
}}
|
|
96
|
+
>
|
|
97
|
+
{isTyping ? <TypingDots frame={frame - typingFrom} color={theirFg} size={fontSize} /> : m.text}
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
);
|
|
101
|
+
})}
|
|
102
|
+
</div>
|
|
103
|
+
</AbsoluteFill>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function TypingDots({ frame, color, size }: { frame: number; color: string; size: number }) {
|
|
108
|
+
return (
|
|
109
|
+
<div style={{ display: "flex", gap: size * 0.22, padding: `${size * 0.32}px ${size * 0.05}px`, height: size * 1.3, alignItems: "center" }}>
|
|
110
|
+
{[0, 1, 2].map((i) => {
|
|
111
|
+
const bounce = Math.max(0, Math.sin((frame - i * 3) * 0.45));
|
|
112
|
+
return (
|
|
113
|
+
<div
|
|
114
|
+
key={i}
|
|
115
|
+
style={{
|
|
116
|
+
width: size * 0.36,
|
|
117
|
+
height: size * 0.36,
|
|
118
|
+
borderRadius: "50%",
|
|
119
|
+
background: color,
|
|
120
|
+
opacity: 0.35 + bounce * 0.5,
|
|
121
|
+
transform: `translateY(${-bounce * size * 0.18}px)`,
|
|
122
|
+
}}
|
|
123
|
+
/>
|
|
124
|
+
);
|
|
125
|
+
})}
|
|
126
|
+
</div>
|
|
127
|
+
);
|
|
128
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "chat-thread",
|
|
3
|
+
"name": "Chat Thread",
|
|
4
|
+
"category": "AI & Product",
|
|
5
|
+
"description": "A chat conversation building up bubble by bubble: replies arrive after a typing indicator, your messages pop in on the right.",
|
|
6
|
+
"useWhen": "Showing a conversation: a support chat, a customer DM, a group chat reacting, a user talking to an AI assistant, a before/after story told in messages. Start a line with > for messages from \"me\" (right side). Messages share the clip, so allow about 1 second each.",
|
|
7
|
+
"durationInFrames": 180,
|
|
8
|
+
"layer": "overlay",
|
|
9
|
+
"tags": ["chat", "messages", "imessage", "conversation", "dm", "typing", "bubbles", "assistant"],
|
|
10
|
+
"props": {
|
|
11
|
+
"messages": { "type": "lines", "label": "Messages", "default": ["Did you see the new launch video?", "> Made it in 10 minutes 😅", "No way. With what?", "> Agentcut + Claude"], "max": 12, "help": "One message per line. Start with > for your side (right)." },
|
|
12
|
+
"accent": { "type": "color", "label": "Your bubble", "default": "#0a84ff" },
|
|
13
|
+
"theme": { "type": "select", "label": "Theme", "default": "dark", "options": [{ "value": "dark", "label": "Dark" }, { "value": "light", "label": "Light" }] },
|
|
14
|
+
"background": { "type": "color", "label": "Background", "default": "transparent", "help": "\"transparent\" to sit over other layers." },
|
|
15
|
+
"size": { "type": "number", "label": "Text size", "default": 4.2, "min": 1.5, "max": 7, "step": 0.1, "unit": "% of frame" },
|
|
16
|
+
"typing": { "type": "boolean", "label": "Typing indicator", "default": true }
|
|
17
|
+
},
|
|
18
|
+
"examples": [
|
|
19
|
+
{ "name": "DM", "props": {} },
|
|
20
|
+
{ "name": "Light support chat", "props": { "messages": ["Hi! How can I help?", "> My export is stuck at 90%", "Fixed in the latest version 🎉", "> That was fast, thanks!"], "theme": "light", "accent": "#16a34a", "background": "#f4f4f5" } },
|
|
21
|
+
{ "name": "AI assistant", "props": { "messages": ["> Make the intro punchier", "Done: I added a Kinetic Punch title on the beat.", "> Perfect. Export it."], "accent": "#8b5cf6", "background": "#0b0b12" } }
|
|
22
|
+
],
|
|
23
|
+
"stillAt": 0.9
|
|
24
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { AbsoluteFill, spring, useCurrentFrame } from "remotion";
|
|
2
|
+
import { FONTS, alpha, blurStyle, easeInOut, easeOutExpo, exitOut, fill, mix, onColor, ramp, unit } from "../lib";
|
|
3
|
+
import type { MotionBaseProps } from "../types";
|
|
4
|
+
|
|
5
|
+
type Props = MotionBaseProps & {
|
|
6
|
+
title: string;
|
|
7
|
+
items: string[];
|
|
8
|
+
accent: string;
|
|
9
|
+
theme: string;
|
|
10
|
+
background: string;
|
|
11
|
+
strike: boolean;
|
|
12
|
+
progress: boolean;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** A to-do card: items get ticked off one by one (a checkmark draws in a filling circle), with a progress bar. */
|
|
16
|
+
export function Checklist(props: Props) {
|
|
17
|
+
const frame = useCurrentFrame();
|
|
18
|
+
const { width, height, fps, durationInFrames: d } = props;
|
|
19
|
+
const u = unit(width, height);
|
|
20
|
+
const vertical = height > width;
|
|
21
|
+
const dark = props.theme === "dark";
|
|
22
|
+
const items = props.items.filter((i) => i.trim()).slice(0, 6);
|
|
23
|
+
const n = Math.max(1, items.length);
|
|
24
|
+
const cardWidth = Math.min(width * (vertical ? 0.88 : 0.46), 1000 * u);
|
|
25
|
+
const s = cardWidth / 800;
|
|
26
|
+
const enter = spring({ frame, fps, config: { damping: 17, stiffness: 130, mass: 0.9 } });
|
|
27
|
+
const out = exitOut(frame, d, 14);
|
|
28
|
+
// Ticks spread from just after the entrance to ~25 frames before the end.
|
|
29
|
+
const first = 18;
|
|
30
|
+
const gap = Math.max(6, Math.min(20, (d - 30 - first) / n));
|
|
31
|
+
const tickAt = (i: number) => first + i * gap;
|
|
32
|
+
const done = items.reduce((sum, _, i) => sum + ramp(frame, tickAt(i), 10, easeInOut), 0);
|
|
33
|
+
|
|
34
|
+
const fg = dark ? "#f4f4f5" : "#111114";
|
|
35
|
+
const muted = dark ? "rgba(244,244,245,0.42)" : "rgba(17,17,20,0.4)";
|
|
36
|
+
const line = dark ? "rgba(255,255,255,0.1)" : "rgba(17,17,20,0.09)";
|
|
37
|
+
const box = 50 * s;
|
|
38
|
+
const fontSize = 36 * s;
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<AbsoluteFill style={{ background: fill(props.background), alignItems: "center", justifyContent: "center", opacity: out }}>
|
|
42
|
+
<div
|
|
43
|
+
style={{
|
|
44
|
+
width: cardWidth,
|
|
45
|
+
boxSizing: "border-box",
|
|
46
|
+
padding: `${44 * s}px ${48 * s}px`,
|
|
47
|
+
borderRadius: 40 * s,
|
|
48
|
+
background: dark ? "#16171c" : "#ffffff",
|
|
49
|
+
border: `${Math.max(1, 2 * s)}px solid ${line}`,
|
|
50
|
+
boxShadow: `0 ${30 * s}px ${90 * s}px rgba(0,0,0,${dark ? 0.5 : 0.16})`,
|
|
51
|
+
fontFamily: FONTS.sans,
|
|
52
|
+
color: fg,
|
|
53
|
+
opacity: Math.min(1, enter * 1.5),
|
|
54
|
+
transform: `translateY(${mix(120 * s, 0, enter)}px) scale(${mix(0.94, 1, enter)})`,
|
|
55
|
+
...blurStyle((1 - Math.min(1, enter)) * 10 * s),
|
|
56
|
+
}}
|
|
57
|
+
>
|
|
58
|
+
{props.title ? (
|
|
59
|
+
<div style={{ display: "flex", alignItems: "baseline", marginBottom: 26 * s }}>
|
|
60
|
+
<div style={{ fontFamily: FONTS.display, fontSize: 48 * s, fontWeight: 700, letterSpacing: "-0.03em" }}>{props.title}</div>
|
|
61
|
+
<div style={{ marginLeft: "auto", fontFamily: FONTS.mono, fontSize: 26 * s, color: muted }}>
|
|
62
|
+
{Math.round(done)}/{items.length}
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
) : null}
|
|
66
|
+
{items.map((item, i) => {
|
|
67
|
+
const t = tickAt(i);
|
|
68
|
+
const rowIn = ramp(frame, 4 + i * 3, 18, easeOutExpo);
|
|
69
|
+
const check = spring({ frame: frame - t, fps, config: { damping: 11, stiffness: 220, mass: 0.6 } });
|
|
70
|
+
const draw = ramp(frame, t + 2, 9, easeInOut);
|
|
71
|
+
const dim = ramp(frame, t + 4, 10);
|
|
72
|
+
const on = frame >= t;
|
|
73
|
+
return (
|
|
74
|
+
<div
|
|
75
|
+
key={i}
|
|
76
|
+
style={{
|
|
77
|
+
display: "flex",
|
|
78
|
+
alignItems: "center",
|
|
79
|
+
gap: 26 * s,
|
|
80
|
+
padding: `${18 * s}px 0`,
|
|
81
|
+
borderTop: i > 0 ? `${Math.max(1, 1.5 * s)}px solid ${line}` : undefined,
|
|
82
|
+
opacity: rowIn,
|
|
83
|
+
transform: `translateX(${(1 - rowIn) * 40 * s}px)`,
|
|
84
|
+
}}
|
|
85
|
+
>
|
|
86
|
+
<svg width={box} height={box} viewBox="0 0 50 50" style={{ flexShrink: 0 }}>
|
|
87
|
+
<circle cx={25} cy={25} r={22} fill="none" stroke={on ? props.accent : muted} strokeWidth={3} />
|
|
88
|
+
{on ? <circle cx={25} cy={25} r={23.5 * Math.min(1.08, check)} fill={props.accent} /> : null}
|
|
89
|
+
<path
|
|
90
|
+
d="M15 25.5l7 7 13-14"
|
|
91
|
+
fill="none"
|
|
92
|
+
stroke={onColor(props.accent)}
|
|
93
|
+
strokeWidth={4.2}
|
|
94
|
+
strokeLinecap="round"
|
|
95
|
+
strokeLinejoin="round"
|
|
96
|
+
pathLength={1}
|
|
97
|
+
strokeDasharray={1}
|
|
98
|
+
strokeDashoffset={1 - draw}
|
|
99
|
+
opacity={draw > 0 ? 1 : 0}
|
|
100
|
+
/>
|
|
101
|
+
</svg>
|
|
102
|
+
<div style={{ position: "relative", fontSize, lineHeight: 1.25, color: fg, opacity: mix(1, 0.45, dim) }}>
|
|
103
|
+
{item}
|
|
104
|
+
{props.strike ? (
|
|
105
|
+
<div
|
|
106
|
+
style={{
|
|
107
|
+
position: "absolute",
|
|
108
|
+
left: 0,
|
|
109
|
+
top: "52%",
|
|
110
|
+
height: Math.max(2, 3 * s),
|
|
111
|
+
width: `${ramp(frame, t + 3, 12, easeInOut) * 100}%`,
|
|
112
|
+
borderRadius: 3 * s,
|
|
113
|
+
background: fg,
|
|
114
|
+
}}
|
|
115
|
+
/>
|
|
116
|
+
) : null}
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
);
|
|
120
|
+
})}
|
|
121
|
+
{props.progress ? (
|
|
122
|
+
<div style={{ marginTop: 22 * s, height: 12 * s, borderRadius: 12 * s, background: alpha(props.accent, dark ? 0.16 : 0.14), overflow: "hidden" }}>
|
|
123
|
+
<div style={{ width: `${(done / n) * 100}%`, height: "100%", borderRadius: 12 * s, background: props.accent }} />
|
|
124
|
+
</div>
|
|
125
|
+
) : null}
|
|
126
|
+
</div>
|
|
127
|
+
</AbsoluteFill>
|
|
128
|
+
);
|
|
129
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "checklist",
|
|
3
|
+
"name": "Checklist",
|
|
4
|
+
"category": "Overlays",
|
|
5
|
+
"description": "A to-do card whose items get ticked off one by one: a circle fills, a checkmark draws in, the text dims and strikes through, and a progress bar fills.",
|
|
6
|
+
"useWhen": "Showing steps getting done or features included: an onboarding flow, \"what's in the box\", a launch checklist, before/after task lists, a recap of what the product just did for you.",
|
|
7
|
+
"durationInFrames": 120,
|
|
8
|
+
"layer": "overlay",
|
|
9
|
+
"tags": ["checklist", "todo", "tasks", "steps", "checkmark", "progress", "list", "features"],
|
|
10
|
+
"props": {
|
|
11
|
+
"title": { "type": "text", "label": "Title", "default": "Launch checklist", "help": "Leave empty for none." },
|
|
12
|
+
"items": { "type": "lines", "label": "Items", "default": ["Record the demo", "Add captions", "Pick the music", "Export in 4K"], "max": 6, "help": "3 to 6 items, ticked in order." },
|
|
13
|
+
"accent": { "type": "color", "style": "accent", "label": "Check color", "default": "#22c55e" },
|
|
14
|
+
"theme": { "type": "select", "style": "theme", "label": "Theme", "default": "dark", "options": [{ "value": "dark", "label": "Dark" }, { "value": "light", "label": "Light" }] },
|
|
15
|
+
"background": { "type": "color", "label": "Background", "default": "transparent", "help": "\"transparent\" to sit over other layers." },
|
|
16
|
+
"strike": { "type": "boolean", "label": "Strike through", "default": true },
|
|
17
|
+
"progress": { "type": "boolean", "label": "Progress bar", "default": true }
|
|
18
|
+
},
|
|
19
|
+
"examples": [
|
|
20
|
+
{ "name": "Launch", "props": { "background": "#0b0b0f" } },
|
|
21
|
+
{ "name": "Light onboarding", "props": { "title": "Get started", "items": ["Create your workspace", "Invite your team", "Connect GitHub", "Ship your first video", "Share the link"], "accent": "#6366f1", "theme": "light", "strike": false, "background": "#eef0f5" } },
|
|
22
|
+
{ "name": "No title", "props": { "title": "", "items": ["No editing skills", "No stock footage", "No waiting on renders"], "accent": "#f97316", "progress": false } }
|
|
23
|
+
],
|
|
24
|
+
"stillAt": 0.6
|
|
25
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { AbsoluteFill, random, useCurrentFrame } from "remotion";
|
|
2
|
+
import { exitOut, fill, unit } from "../lib";
|
|
3
|
+
import type { MotionBaseProps } from "../types";
|
|
4
|
+
|
|
5
|
+
type Props = MotionBaseProps & {
|
|
6
|
+
mode: string;
|
|
7
|
+
count: number;
|
|
8
|
+
power: number;
|
|
9
|
+
gravity: number;
|
|
10
|
+
size: number;
|
|
11
|
+
palette: string[];
|
|
12
|
+
originX: number;
|
|
13
|
+
originY: number;
|
|
14
|
+
seed: number;
|
|
15
|
+
background: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/** Linear air drag (per second): pieces slow quickly and settle into a flutter at terminal speed. */
|
|
19
|
+
const DRAG = 1.6;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Confetti: a seeded burst from a point, two cannons from the bottom corners, or rain from the top.
|
|
23
|
+
* Every piece's position is solved from the frame (velocity, gravity and drag in closed form), so
|
|
24
|
+
* any frame renders the same on its own.
|
|
25
|
+
*/
|
|
26
|
+
export function Confetti(props: Props) {
|
|
27
|
+
const frame = useCurrentFrame();
|
|
28
|
+
const { width, height, fps, durationInFrames: d } = props;
|
|
29
|
+
const u = unit(width, height);
|
|
30
|
+
const out = exitOut(frame, d, 14);
|
|
31
|
+
const palette = props.palette.filter((c) => /^#?[0-9a-f]{3,8}$/i.test(c.trim()));
|
|
32
|
+
const colors = palette.length ? palette : ["#f43f5e", "#f59e0b", "#22c55e", "#3b82f6", "#a855f7", "#ffffff"];
|
|
33
|
+
const n = Math.round(props.count);
|
|
34
|
+
const diag = Math.hypot(width, height);
|
|
35
|
+
const g = props.gravity * 900 * u;
|
|
36
|
+
const pieceScale = props.size * u;
|
|
37
|
+
|
|
38
|
+
const pieces = Array.from({ length: n }, (_, i) => {
|
|
39
|
+
const r = (k: string) => random(`${props.seed}-${i}-${k}`);
|
|
40
|
+
let x0: number;
|
|
41
|
+
let y0: number;
|
|
42
|
+
let vx: number;
|
|
43
|
+
let vy: number;
|
|
44
|
+
let delay = r("delay") * 4;
|
|
45
|
+
if (props.mode === "cannons") {
|
|
46
|
+
const left = i % 2 === 0;
|
|
47
|
+
x0 = left ? 0 : width;
|
|
48
|
+
y0 = height;
|
|
49
|
+
const angle = ((-62 + (r("a") - 0.5) * 34) * Math.PI) / 180;
|
|
50
|
+
const speed = diag * props.power * (0.75 + r("v") * 0.6);
|
|
51
|
+
vx = Math.cos(angle) * speed * (left ? 1 : -1);
|
|
52
|
+
vy = Math.sin(angle) * speed;
|
|
53
|
+
} else if (props.mode === "rain") {
|
|
54
|
+
x0 = r("x") * width;
|
|
55
|
+
y0 = -40 * u - r("y") * height * 0.3;
|
|
56
|
+
vx = (r("vx") - 0.5) * 120 * u;
|
|
57
|
+
vy = 80 * u * r("vy");
|
|
58
|
+
delay = r("delay") * d * 0.5;
|
|
59
|
+
} else {
|
|
60
|
+
x0 = (props.originX / 100) * width;
|
|
61
|
+
y0 = (props.originY / 100) * height;
|
|
62
|
+
// A burst that leans upward, like a popper.
|
|
63
|
+
const angle = r("a") * Math.PI * 2;
|
|
64
|
+
const speed = diag * props.power * (0.25 + Math.pow(r("v"), 0.6) * 1.05);
|
|
65
|
+
vx = Math.cos(angle) * speed;
|
|
66
|
+
vy = Math.sin(angle) * speed * 0.85 - speed * 0.35;
|
|
67
|
+
}
|
|
68
|
+
const t = Math.max(0, (frame - delay) / fps);
|
|
69
|
+
if (frame < delay) return null;
|
|
70
|
+
// Closed-form motion with linear drag: v' = g − k·v.
|
|
71
|
+
const decay = (1 - Math.exp(-DRAG * t)) / DRAG;
|
|
72
|
+
const terminal = g / DRAG;
|
|
73
|
+
const flutter = Math.sin(t * (3 + r("fs") * 4) + r("fp") * 6.28) * 26 * u * Math.min(1, t * 2);
|
|
74
|
+
const x = x0 + vx * decay + flutter;
|
|
75
|
+
const y = y0 + terminal * t + (vy - terminal) * decay;
|
|
76
|
+
if (y > height + 80 * u || x < -100 * u || x > width + 100 * u) return null;
|
|
77
|
+
|
|
78
|
+
const kind = r("kind");
|
|
79
|
+
const shape = kind < 0.55 ? "rect" : kind < 0.8 ? "circle" : "streamer";
|
|
80
|
+
const w = (shape === "streamer" ? 5 : shape === "circle" ? 11 : 12 + r("w") * 6) * pieceScale;
|
|
81
|
+
const h = (shape === "streamer" ? 26 + r("h") * 16 : shape === "circle" ? 11 : 7 + r("h") * 5) * pieceScale;
|
|
82
|
+
const spin = (r("spin") - 0.5) * 900;
|
|
83
|
+
const rot = r("rot") * 360 + spin * t;
|
|
84
|
+
// Tumbling: the piece's face turns toward and away from the camera.
|
|
85
|
+
const tumble = Math.cos(t * (6 + r("ts") * 10) + r("tp") * 6.28);
|
|
86
|
+
const color = colors[Math.floor(r("c") * colors.length)];
|
|
87
|
+
return (
|
|
88
|
+
<div
|
|
89
|
+
key={i}
|
|
90
|
+
style={{
|
|
91
|
+
position: "absolute",
|
|
92
|
+
// Rounded so the server-rendered still and the client agree (Math.exp/sin differ in the last digits).
|
|
93
|
+
left: round(x - w / 2),
|
|
94
|
+
top: round(y - h / 2),
|
|
95
|
+
width: round(w),
|
|
96
|
+
height: round(h),
|
|
97
|
+
background: color,
|
|
98
|
+
borderRadius: shape === "circle" ? "50%" : shape === "streamer" ? w / 2 : 1.5 * pieceScale,
|
|
99
|
+
transform: `rotate(${round(rot)}deg) scaleX(${shape === "circle" ? 1 : round(tumble)})`,
|
|
100
|
+
opacity: shape === "circle" ? 1 : round(0.75 + 0.25 * Math.abs(tumble)),
|
|
101
|
+
}}
|
|
102
|
+
/>
|
|
103
|
+
);
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
return <AbsoluteFill style={{ background: fill(props.background), opacity: out, overflow: "hidden" }}>{pieces}</AbsoluteFill>;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const round = (v: number) => Math.round(v * 100) / 100;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "confetti",
|
|
3
|
+
"name": "Confetti Burst",
|
|
4
|
+
"category": "Overlays",
|
|
5
|
+
"description": "Seeded confetti with real physics: a burst from a point, two cannons from the bottom corners, or rain from the top, with pieces that spin, tumble and flutter down.",
|
|
6
|
+
"useWhen": "Celebrating a moment: a launch, a milestone, a payment going through, \"you did it\" at the end of a flow, a number hitting its target. Put it on a track above the moment and start it on the beat.",
|
|
7
|
+
"durationInFrames": 90,
|
|
8
|
+
"layer": "overlay",
|
|
9
|
+
"tags": ["confetti", "celebration", "party", "burst", "particles", "success", "launch", "win"],
|
|
10
|
+
"props": {
|
|
11
|
+
"mode": { "type": "select", "label": "Style", "default": "burst", "options": [{ "value": "burst", "label": "Burst from a point" }, { "value": "cannons", "label": "Corner cannons" }, { "value": "rain", "label": "Rain from the top" }] },
|
|
12
|
+
"count": { "type": "number", "label": "Pieces", "default": 160, "min": 20, "max": 400, "step": 10 },
|
|
13
|
+
"power": { "type": "number", "label": "Power", "default": 0.7, "min": 0.2, "max": 1.5, "step": 0.05, "help": "How far the pieces fly (burst and cannons)." },
|
|
14
|
+
"gravity": { "type": "number", "label": "Gravity", "default": 1, "min": 0.2, "max": 2.5, "step": 0.1 },
|
|
15
|
+
"size": { "type": "number", "label": "Piece size", "default": 1.2, "min": 0.5, "max": 3, "step": 0.1 },
|
|
16
|
+
"palette": { "type": "lines", "label": "Colors", "default": ["#f43f5e", "#f59e0b", "#22c55e", "#3b82f6", "#a855f7", "#ffffff"], "max": 8, "help": "Hex colors, one per line." },
|
|
17
|
+
"originX": { "type": "number", "label": "Burst X", "default": 50, "min": 0, "max": 100, "step": 1, "unit": "%" },
|
|
18
|
+
"originY": { "type": "number", "label": "Burst Y", "default": 55, "min": 0, "max": 100, "step": 1, "unit": "%" },
|
|
19
|
+
"seed": { "type": "number", "label": "Seed", "default": 7, "min": 0, "max": 999, "step": 1, "help": "Change for a different scatter." },
|
|
20
|
+
"background": { "type": "color", "label": "Background", "default": "transparent", "help": "\"transparent\" to sit over other layers." }
|
|
21
|
+
},
|
|
22
|
+
"examples": [
|
|
23
|
+
{ "name": "Burst", "props": { "background": "#0b0b0f" } },
|
|
24
|
+
{ "name": "Cannons", "props": { "mode": "cannons", "count": 240, "power": 0.9, "background": "#0b0b0f" } },
|
|
25
|
+
{ "name": "Gold rain", "props": { "mode": "rain", "count": 200, "gravity": 0.6, "palette": ["#facc15", "#fde68a", "#f59e0b", "#ffffff"], "background": "#111111" } }
|
|
26
|
+
],
|
|
27
|
+
"stillAt": 0.3
|
|
28
|
+
}
|