@kolbo-cli/kolbo-linux-x64 0.0.0-dev-202604101350 → 0.0.0-dev-202604102129
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/bin/kolbo +0 -0
- package/package.json +1 -1
- package/skills/frontend-design/SKILL.md +42 -0
- package/skills/kolbo/SKILL.md +61 -0
- package/skills/remotion-best-practices/SKILL.md +61 -0
- package/skills/remotion-best-practices/rules/3d.md +86 -0
- package/skills/remotion-best-practices/rules/animations.md +27 -0
- package/skills/remotion-best-practices/rules/assets/charts-bar-chart.tsx +173 -0
- package/skills/remotion-best-practices/rules/assets/text-animations-typewriter.tsx +100 -0
- package/skills/remotion-best-practices/rules/assets/text-animations-word-highlight.tsx +103 -0
- package/skills/remotion-best-practices/rules/assets.md +78 -0
- package/skills/remotion-best-practices/rules/audio-visualization.md +198 -0
- package/skills/remotion-best-practices/rules/audio.md +169 -0
- package/skills/remotion-best-practices/rules/calculate-metadata.md +134 -0
- package/skills/remotion-best-practices/rules/can-decode.md +81 -0
- package/skills/remotion-best-practices/rules/charts.md +120 -0
- package/skills/remotion-best-practices/rules/compositions.md +154 -0
- package/skills/remotion-best-practices/rules/display-captions.md +184 -0
- package/skills/remotion-best-practices/rules/extract-frames.md +229 -0
- package/skills/remotion-best-practices/rules/ffmpeg.md +38 -0
- package/skills/remotion-best-practices/rules/fonts.md +152 -0
- package/skills/remotion-best-practices/rules/get-audio-duration.md +58 -0
- package/skills/remotion-best-practices/rules/get-video-dimensions.md +68 -0
- package/skills/remotion-best-practices/rules/get-video-duration.md +60 -0
- package/skills/remotion-best-practices/rules/gifs.md +141 -0
- package/skills/remotion-best-practices/rules/images.md +134 -0
- package/skills/remotion-best-practices/rules/import-srt-captions.md +69 -0
- package/skills/remotion-best-practices/rules/light-leaks.md +73 -0
- package/skills/remotion-best-practices/rules/lottie.md +70 -0
- package/skills/remotion-best-practices/rules/maps.md +412 -0
- package/skills/remotion-best-practices/rules/measuring-dom-nodes.md +34 -0
- package/skills/remotion-best-practices/rules/measuring-text.md +140 -0
- package/skills/remotion-best-practices/rules/parameters.md +109 -0
- package/skills/remotion-best-practices/rules/sequencing.md +118 -0
- package/skills/remotion-best-practices/rules/sfx.md +30 -0
- package/skills/remotion-best-practices/rules/subtitles.md +36 -0
- package/skills/remotion-best-practices/rules/tailwind.md +11 -0
- package/skills/remotion-best-practices/rules/text-animations.md +20 -0
- package/skills/remotion-best-practices/rules/timing.md +179 -0
- package/skills/remotion-best-practices/rules/transcribe-captions.md +70 -0
- package/skills/remotion-best-practices/rules/transitions.md +197 -0
- package/skills/remotion-best-practices/rules/transparent-videos.md +106 -0
- package/skills/remotion-best-practices/rules/trimming.md +51 -0
- package/skills/remotion-best-practices/rules/videos.md +171 -0
- package/skills/remotion-best-practices/rules/voiceover.md +99 -0
- package/skills/video-production/SKILL.md +152 -0
- package/skills/youtube-clipper/SKILL.md +187 -0
package/bin/kolbo
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: frontend-design
|
|
3
|
+
description: Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.
|
|
4
|
+
license: Complete terms in LICENSE.txt
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
This skill guides creation of distinctive, production-grade frontend interfaces that avoid generic "AI slop" aesthetics. Implement real working code with exceptional attention to aesthetic details and creative choices.
|
|
8
|
+
|
|
9
|
+
The user provides frontend requirements: a component, page, application, or interface to build. They may include context about the purpose, audience, or technical constraints.
|
|
10
|
+
|
|
11
|
+
## Design Thinking
|
|
12
|
+
|
|
13
|
+
Before coding, understand the context and commit to a BOLD aesthetic direction:
|
|
14
|
+
- **Purpose**: What problem does this interface solve? Who uses it?
|
|
15
|
+
- **Tone**: Pick an extreme: brutally minimal, maximalist chaos, retro-futuristic, organic/natural, luxury/refined, playful/toy-like, editorial/magazine, brutalist/raw, art deco/geometric, soft/pastel, industrial/utilitarian, etc. There are so many flavors to choose from. Use these for inspiration but design one that is true to the aesthetic direction.
|
|
16
|
+
- **Constraints**: Technical requirements (framework, performance, accessibility).
|
|
17
|
+
- **Differentiation**: What makes this UNFORGETTABLE? What's the one thing someone will remember?
|
|
18
|
+
|
|
19
|
+
**CRITICAL**: Choose a clear conceptual direction and execute it with precision. Bold maximalism and refined minimalism both work - the key is intentionality, not intensity.
|
|
20
|
+
|
|
21
|
+
Then implement working code (HTML/CSS/JS, React, Vue, etc.) that is:
|
|
22
|
+
- Production-grade and functional
|
|
23
|
+
- Visually striking and memorable
|
|
24
|
+
- Cohesive with a clear aesthetic point-of-view
|
|
25
|
+
- Meticulously refined in every detail
|
|
26
|
+
|
|
27
|
+
## Frontend Aesthetics Guidelines
|
|
28
|
+
|
|
29
|
+
Focus on:
|
|
30
|
+
- **Typography**: Choose fonts that are beautiful, unique, and interesting. Avoid generic fonts like Arial and Inter; opt instead for distinctive choices that elevate the frontend's aesthetics; unexpected, characterful font choices. Pair a distinctive display font with a refined body font.
|
|
31
|
+
- **Color & Theme**: Commit to a cohesive aesthetic. Use CSS variables for consistency. Dominant colors with sharp accents outperform timid, evenly-distributed palettes.
|
|
32
|
+
- **Motion**: Use animations for effects and micro-interactions. Prioritize CSS-only solutions for HTML. Use Motion library for React when available. Focus on high-impact moments: one well-orchestrated page load with staggered reveals (animation-delay) creates more delight than scattered micro-interactions. Use scroll-triggering and hover states that surprise.
|
|
33
|
+
- **Spatial Composition**: Unexpected layouts. Asymmetry. Overlap. Diagonal flow. Grid-breaking elements. Generous negative space OR controlled density.
|
|
34
|
+
- **Backgrounds & Visual Details**: Create atmosphere and depth rather than defaulting to solid colors. Add contextual effects and textures that match the overall aesthetic. Apply creative forms like gradient meshes, noise textures, geometric patterns, layered transparencies, dramatic shadows, decorative borders, custom cursors, and grain overlays.
|
|
35
|
+
|
|
36
|
+
NEVER use generic AI-generated aesthetics like overused font families (Inter, Roboto, Arial, system fonts), cliched color schemes (particularly purple gradients on white backgrounds), predictable layouts and component patterns, and cookie-cutter design that lacks context-specific character.
|
|
37
|
+
|
|
38
|
+
Interpret creatively and make unexpected choices that feel genuinely designed for the context. No design should be the same. Vary between light and dark themes, different fonts, different aesthetics. NEVER converge on common choices (Space Grotesk, for example) across generations.
|
|
39
|
+
|
|
40
|
+
**IMPORTANT**: Match implementation complexity to the aesthetic vision. Maximalist designs need elaborate code with extensive animations and effects. Minimalist or refined designs need restraint, precision, and careful attention to spacing, typography, and subtle details. Elegance comes from executing the vision well.
|
|
41
|
+
|
|
42
|
+
Remember: Claude is capable of extraordinary creative work. Don't hold back, show what can truly be created when thinking outside the box and committing fully to a distinctive vision.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kolbo
|
|
3
|
+
description: Generate images, videos, music, speech, and sound effects using Kolbo AI. Use when asked to create any visual, audio, or video content — or to list available AI models or check credit balance.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Kolbo AI — Creative Generation
|
|
7
|
+
|
|
8
|
+
You have access to the Kolbo AI platform via MCP tools. Use them to generate images, videos, music, speech, and sound effects directly from conversation.
|
|
9
|
+
|
|
10
|
+
## Available Tools
|
|
11
|
+
|
|
12
|
+
| Tool | Description |
|
|
13
|
+
|------|-------------|
|
|
14
|
+
| `generate_image` | Create images from text prompts. Returns image URL(s). |
|
|
15
|
+
| `generate_video` | Create videos from text. Returns video URL. |
|
|
16
|
+
| `generate_video_from_image` | Animate a static image into video. Returns video URL. |
|
|
17
|
+
| `generate_music` | Create music from descriptions. Returns audio URL. |
|
|
18
|
+
| `generate_speech` | Convert text to speech. Returns audio URL. |
|
|
19
|
+
| `generate_sound` | Generate sound effects. Returns audio URL. |
|
|
20
|
+
| `list_models` | Browse available AI models filtered by type. |
|
|
21
|
+
| `check_credits` | Check remaining Kolbo credit balance. |
|
|
22
|
+
| `get_generation_status` | Poll status of an in-progress generation by ID. |
|
|
23
|
+
|
|
24
|
+
## Workflow
|
|
25
|
+
|
|
26
|
+
1. **Check credits** — call `check_credits` before generating to confirm balance
|
|
27
|
+
2. **Discover models** — call `list_models` with a `type` filter to get current model identifiers. Models change frequently; never hardcode them.
|
|
28
|
+
3. **Generate** — call the appropriate tool. Pass the `identifier` from `list_models` as `model`, or omit it to let Kolbo auto-select the best model.
|
|
29
|
+
4. **Result** — the tool polls internally and returns the final URL when ready.
|
|
30
|
+
|
|
31
|
+
## Model Types
|
|
32
|
+
|
|
33
|
+
Use these values with `list_models`:
|
|
34
|
+
|
|
35
|
+
| Type | Use for |
|
|
36
|
+
|------|---------|
|
|
37
|
+
| `image` | Image generation |
|
|
38
|
+
| `video` | Text-to-video |
|
|
39
|
+
| `video_from_image` | Image-to-video animation |
|
|
40
|
+
| `music` | Music generation |
|
|
41
|
+
| `speech` | Text-to-speech |
|
|
42
|
+
| `sound` | Sound effects |
|
|
43
|
+
|
|
44
|
+
## Tips
|
|
45
|
+
|
|
46
|
+
- **Images** are fastest (~10–30s). `enhance_prompt: true` is on by default.
|
|
47
|
+
- **Video** takes longest (~1–5 min). Check `supported_durations` and `supported_aspect_ratios` from `list_models` before generating.
|
|
48
|
+
- **Music** supports `style`, `instrumental`, and `lyrics` parameters.
|
|
49
|
+
- **Speech** — pass a voice `identifier` from `list_models` for a consistent voice.
|
|
50
|
+
- If a video generation times out, use `get_generation_status` with the returned generation ID to retrieve the result.
|
|
51
|
+
- Models marked `recommended: true` in `list_models` are Kolbo's top picks for quality and speed.
|
|
52
|
+
|
|
53
|
+
## Examples
|
|
54
|
+
|
|
55
|
+
> "Generate an image of a neon-lit Tokyo street at night"
|
|
56
|
+
> "Create a 5-second video of ocean waves"
|
|
57
|
+
> "Make a lo-fi hip hop beat, instrumental only"
|
|
58
|
+
> "Convert this text to speech: Welcome to Kolbo"
|
|
59
|
+
> "Animate this image into a short video"
|
|
60
|
+
> "What image models are available?"
|
|
61
|
+
> "Check my credit balance"
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: remotion-best-practices
|
|
3
|
+
description: Best practices for Remotion - Video creation in React
|
|
4
|
+
metadata:
|
|
5
|
+
tags: remotion, video, react, animation, composition
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## When to use
|
|
9
|
+
|
|
10
|
+
Use this skills whenever you are dealing with Remotion code to obtain the domain-specific knowledge.
|
|
11
|
+
|
|
12
|
+
## Captions
|
|
13
|
+
|
|
14
|
+
When dealing with captions or subtitles, load the [./rules/subtitles.md](./rules/subtitles.md) file for more information.
|
|
15
|
+
|
|
16
|
+
## Using FFmpeg
|
|
17
|
+
|
|
18
|
+
For some video operations, such as trimming videos or detecting silence, FFmpeg should be used. Load the [./rules/ffmpeg.md](./rules/ffmpeg.md) file for more information.
|
|
19
|
+
|
|
20
|
+
## Audio visualization
|
|
21
|
+
|
|
22
|
+
When needing to visualize audio (spectrum bars, waveforms, bass-reactive effects), load the [./rules/audio-visualization.md](./rules/audio-visualization.md) file for more information.
|
|
23
|
+
|
|
24
|
+
## Sound effects
|
|
25
|
+
|
|
26
|
+
When needing to use sound effects, load the [./rules/sound-effects.md](./rules/sound-effects.md) file for more information.
|
|
27
|
+
|
|
28
|
+
## How to use
|
|
29
|
+
|
|
30
|
+
Read individual rule files for detailed explanations and code examples:
|
|
31
|
+
|
|
32
|
+
- [rules/3d.md](rules/3d.md) - 3D content in Remotion using Three.js and React Three Fiber
|
|
33
|
+
- [rules/animations.md](rules/animations.md) - Fundamental animation skills for Remotion
|
|
34
|
+
- [rules/assets.md](rules/assets.md) - Importing images, videos, audio, and fonts into Remotion
|
|
35
|
+
- [rules/audio.md](rules/audio.md) - Using audio and sound in Remotion - importing, trimming, volume, speed, pitch
|
|
36
|
+
- [rules/calculate-metadata.md](rules/calculate-metadata.md) - Dynamically set composition duration, dimensions, and props
|
|
37
|
+
- [rules/can-decode.md](rules/can-decode.md) - Check if a video can be decoded by the browser using Mediabunny
|
|
38
|
+
- [rules/charts.md](rules/charts.md) - Chart and data visualization patterns for Remotion (bar, pie, line, stock charts)
|
|
39
|
+
- [rules/compositions.md](rules/compositions.md) - Defining compositions, stills, folders, default props and dynamic metadata
|
|
40
|
+
- [rules/extract-frames.md](rules/extract-frames.md) - Extract frames from videos at specific timestamps using Mediabunny
|
|
41
|
+
- [rules/fonts.md](rules/fonts.md) - Loading Google Fonts and local fonts in Remotion
|
|
42
|
+
- [rules/get-audio-duration.md](rules/get-audio-duration.md) - Getting the duration of an audio file in seconds with Mediabunny
|
|
43
|
+
- [rules/get-video-dimensions.md](rules/get-video-dimensions.md) - Getting the width and height of a video file with Mediabunny
|
|
44
|
+
- [rules/get-video-duration.md](rules/get-video-duration.md) - Getting the duration of a video file in seconds with Mediabunny
|
|
45
|
+
- [rules/gifs.md](rules/gifs.md) - Displaying GIFs synchronized with Remotion's timeline
|
|
46
|
+
- [rules/images.md](rules/images.md) - Embedding images in Remotion using the Img component
|
|
47
|
+
- [rules/light-leaks.md](rules/light-leaks.md) - Light leak overlay effects using @remotion/light-leaks
|
|
48
|
+
- [rules/lottie.md](rules/lottie.md) - Embedding Lottie animations in Remotion
|
|
49
|
+
- [rules/measuring-dom-nodes.md](rules/measuring-dom-nodes.md) - Measuring DOM element dimensions in Remotion
|
|
50
|
+
- [rules/measuring-text.md](rules/measuring-text.md) - Measuring text dimensions, fitting text to containers, and checking overflow
|
|
51
|
+
- [rules/sequencing.md](rules/sequencing.md) - Sequencing patterns for Remotion - delay, trim, limit duration of items
|
|
52
|
+
- [rules/tailwind.md](rules/tailwind.md) - Using TailwindCSS in Remotion
|
|
53
|
+
- [rules/text-animations.md](rules/text-animations.md) - Typography and text animation patterns for Remotion
|
|
54
|
+
- [rules/timing.md](rules/timing.md) - Interpolation curves in Remotion - linear, easing, spring animations
|
|
55
|
+
- [rules/transitions.md](rules/transitions.md) - Scene transition patterns for Remotion
|
|
56
|
+
- [rules/transparent-videos.md](rules/transparent-videos.md) - Rendering out a video with transparency
|
|
57
|
+
- [rules/trimming.md](rules/trimming.md) - Trimming patterns for Remotion - cut the beginning or end of animations
|
|
58
|
+
- [rules/videos.md](rules/videos.md) - Embedding videos in Remotion - trimming, volume, speed, looping, pitch
|
|
59
|
+
- [rules/parameters.md](rules/parameters.md) - Make a video parametrizable by adding a Zod schema
|
|
60
|
+
- [rules/maps.md](rules/maps.md) - Add a map using Mapbox and animate it
|
|
61
|
+
- [rules/voiceover.md](rules/voiceover.md) - Adding AI-generated voiceover to Remotion compositions using ElevenLabs TTS
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 3d
|
|
3
|
+
description: 3D content in Remotion using Three.js and React Three Fiber.
|
|
4
|
+
metadata:
|
|
5
|
+
tags: 3d, three, threejs
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Using Three.js and React Three Fiber in Remotion
|
|
9
|
+
|
|
10
|
+
Follow React Three Fiber and Three.js best practices.
|
|
11
|
+
Only the following Remotion-specific rules need to be followed:
|
|
12
|
+
|
|
13
|
+
## Prerequisites
|
|
14
|
+
|
|
15
|
+
First, the `@remotion/three` package needs to be installed.
|
|
16
|
+
If it is not, use the following command:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npx remotion add @remotion/three # If project uses npm
|
|
20
|
+
bunx remotion add @remotion/three # If project uses bun
|
|
21
|
+
yarn remotion add @remotion/three # If project uses yarn
|
|
22
|
+
pnpm exec remotion add @remotion/three # If project uses pnpm
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Using ThreeCanvas
|
|
26
|
+
|
|
27
|
+
You MUST wrap 3D content in `<ThreeCanvas>` and include proper lighting.
|
|
28
|
+
`<ThreeCanvas>` MUST have a `width` and `height` prop.
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
import { ThreeCanvas } from "@remotion/three";
|
|
32
|
+
import { useVideoConfig } from "remotion";
|
|
33
|
+
|
|
34
|
+
const { width, height } = useVideoConfig();
|
|
35
|
+
|
|
36
|
+
<ThreeCanvas width={width} height={height}>
|
|
37
|
+
<ambientLight intensity={0.4} />
|
|
38
|
+
<directionalLight position={[5, 5, 5]} intensity={0.8} />
|
|
39
|
+
<mesh>
|
|
40
|
+
<sphereGeometry args={[1, 32, 32]} />
|
|
41
|
+
<meshStandardMaterial color="red" />
|
|
42
|
+
</mesh>
|
|
43
|
+
</ThreeCanvas>;
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## No animations not driven by `useCurrentFrame()`
|
|
47
|
+
|
|
48
|
+
Shaders, models etc MUST NOT animate by themselves.
|
|
49
|
+
No animations are allowed unless they are driven by `useCurrentFrame()`.
|
|
50
|
+
Otherwise, it will cause flickering during rendering.
|
|
51
|
+
|
|
52
|
+
Using `useFrame()` from `@react-three/fiber` is forbidden.
|
|
53
|
+
|
|
54
|
+
## Animate using `useCurrentFrame()`
|
|
55
|
+
|
|
56
|
+
Use `useCurrentFrame()` to perform animations.
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
const frame = useCurrentFrame();
|
|
60
|
+
const rotationY = frame * 0.02;
|
|
61
|
+
|
|
62
|
+
<mesh rotation={[0, rotationY, 0]}>
|
|
63
|
+
<boxGeometry args={[2, 2, 2]} />
|
|
64
|
+
<meshStandardMaterial color="#4a9eff" />
|
|
65
|
+
</mesh>;
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Using `<Sequence>` inside `<ThreeCanvas>`
|
|
69
|
+
|
|
70
|
+
The `layout` prop of any `<Sequence>` inside a `<ThreeCanvas>` must be set to `none`.
|
|
71
|
+
|
|
72
|
+
```tsx
|
|
73
|
+
import { Sequence } from "remotion";
|
|
74
|
+
import { ThreeCanvas } from "@remotion/three";
|
|
75
|
+
|
|
76
|
+
const { width, height } = useVideoConfig();
|
|
77
|
+
|
|
78
|
+
<ThreeCanvas width={width} height={height}>
|
|
79
|
+
<Sequence layout="none">
|
|
80
|
+
<mesh>
|
|
81
|
+
<boxGeometry args={[2, 2, 2]} />
|
|
82
|
+
<meshStandardMaterial color="#4a9eff" />
|
|
83
|
+
</mesh>
|
|
84
|
+
</Sequence>
|
|
85
|
+
</ThreeCanvas>;
|
|
86
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: animations
|
|
3
|
+
description: Fundamental animation skills for Remotion
|
|
4
|
+
metadata:
|
|
5
|
+
tags: animations, transitions, frames, useCurrentFrame
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
All animations MUST be driven by the `useCurrentFrame()` hook.
|
|
9
|
+
Write animations in seconds and multiply them by the `fps` value from `useVideoConfig()`.
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import { useCurrentFrame } from "remotion";
|
|
13
|
+
|
|
14
|
+
export const FadeIn = () => {
|
|
15
|
+
const frame = useCurrentFrame();
|
|
16
|
+
const { fps } = useVideoConfig();
|
|
17
|
+
|
|
18
|
+
const opacity = interpolate(frame, [0, 2 * fps], [0, 1], {
|
|
19
|
+
extrapolateRight: "clamp",
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
return <div style={{ opacity }}>Hello World!</div>;
|
|
23
|
+
};
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
CSS transitions or animations are FORBIDDEN - they will not render correctly.
|
|
27
|
+
Tailwind animation class names are FORBIDDEN - they will not render correctly.
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import {loadFont} from '@remotion/google-fonts/Inter';
|
|
2
|
+
import {AbsoluteFill, spring, useCurrentFrame, useVideoConfig} from 'remotion';
|
|
3
|
+
|
|
4
|
+
const {fontFamily} = loadFont();
|
|
5
|
+
|
|
6
|
+
const COLOR_BAR = '#D4AF37';
|
|
7
|
+
const COLOR_TEXT = '#ffffff';
|
|
8
|
+
const COLOR_MUTED = '#888888';
|
|
9
|
+
const COLOR_BG = '#0a0a0a';
|
|
10
|
+
const COLOR_AXIS = '#333333';
|
|
11
|
+
|
|
12
|
+
// Ideal composition size: 1280x720
|
|
13
|
+
|
|
14
|
+
const Title: React.FC<{children: React.ReactNode}> = ({children}) => (
|
|
15
|
+
<div style={{textAlign: 'center', marginBottom: 40}}>
|
|
16
|
+
<div style={{color: COLOR_TEXT, fontSize: 48, fontWeight: 600}}>
|
|
17
|
+
{children}
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
const YAxis: React.FC<{steps: number[]; height: number}> = ({
|
|
23
|
+
steps,
|
|
24
|
+
height,
|
|
25
|
+
}) => (
|
|
26
|
+
<div
|
|
27
|
+
style={{
|
|
28
|
+
display: 'flex',
|
|
29
|
+
flexDirection: 'column',
|
|
30
|
+
justifyContent: 'space-between',
|
|
31
|
+
height,
|
|
32
|
+
paddingRight: 16,
|
|
33
|
+
}}
|
|
34
|
+
>
|
|
35
|
+
{steps
|
|
36
|
+
.slice()
|
|
37
|
+
.reverse()
|
|
38
|
+
.map((step) => (
|
|
39
|
+
<div
|
|
40
|
+
key={step}
|
|
41
|
+
style={{
|
|
42
|
+
color: COLOR_MUTED,
|
|
43
|
+
fontSize: 20,
|
|
44
|
+
textAlign: 'right',
|
|
45
|
+
}}
|
|
46
|
+
>
|
|
47
|
+
{step.toLocaleString()}
|
|
48
|
+
</div>
|
|
49
|
+
))}
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
const Bar: React.FC<{
|
|
54
|
+
height: number;
|
|
55
|
+
progress: number;
|
|
56
|
+
}> = ({height, progress}) => (
|
|
57
|
+
<div
|
|
58
|
+
style={{
|
|
59
|
+
flex: 1,
|
|
60
|
+
display: 'flex',
|
|
61
|
+
flexDirection: 'column',
|
|
62
|
+
justifyContent: 'flex-end',
|
|
63
|
+
}}
|
|
64
|
+
>
|
|
65
|
+
<div
|
|
66
|
+
style={{
|
|
67
|
+
width: '100%',
|
|
68
|
+
height,
|
|
69
|
+
backgroundColor: COLOR_BAR,
|
|
70
|
+
borderRadius: '8px 8px 0 0',
|
|
71
|
+
opacity: progress,
|
|
72
|
+
}}
|
|
73
|
+
/>
|
|
74
|
+
</div>
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
const XAxis: React.FC<{
|
|
78
|
+
children: React.ReactNode;
|
|
79
|
+
labels: string[];
|
|
80
|
+
height: number;
|
|
81
|
+
}> = ({children, labels, height}) => (
|
|
82
|
+
<div style={{flex: 1, display: 'flex', flexDirection: 'column'}}>
|
|
83
|
+
<div
|
|
84
|
+
style={{
|
|
85
|
+
display: 'flex',
|
|
86
|
+
alignItems: 'flex-end',
|
|
87
|
+
gap: 16,
|
|
88
|
+
height,
|
|
89
|
+
borderLeft: `2px solid ${COLOR_AXIS}`,
|
|
90
|
+
borderBottom: `2px solid ${COLOR_AXIS}`,
|
|
91
|
+
paddingLeft: 16,
|
|
92
|
+
}}
|
|
93
|
+
>
|
|
94
|
+
{children}
|
|
95
|
+
</div>
|
|
96
|
+
<div
|
|
97
|
+
style={{
|
|
98
|
+
display: 'flex',
|
|
99
|
+
gap: 16,
|
|
100
|
+
paddingLeft: 16,
|
|
101
|
+
marginTop: 12,
|
|
102
|
+
}}
|
|
103
|
+
>
|
|
104
|
+
{labels.map((label) => (
|
|
105
|
+
<div
|
|
106
|
+
key={label}
|
|
107
|
+
style={{
|
|
108
|
+
flex: 1,
|
|
109
|
+
textAlign: 'center',
|
|
110
|
+
color: COLOR_MUTED,
|
|
111
|
+
fontSize: 20,
|
|
112
|
+
}}
|
|
113
|
+
>
|
|
114
|
+
{label}
|
|
115
|
+
</div>
|
|
116
|
+
))}
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
export const MyAnimation = () => {
|
|
122
|
+
const frame = useCurrentFrame();
|
|
123
|
+
const {fps, height} = useVideoConfig();
|
|
124
|
+
|
|
125
|
+
const data = [
|
|
126
|
+
{month: 'Jan', price: 2039},
|
|
127
|
+
{month: 'Mar', price: 2160},
|
|
128
|
+
{month: 'May', price: 2327},
|
|
129
|
+
{month: 'Jul', price: 2426},
|
|
130
|
+
{month: 'Sep', price: 2634},
|
|
131
|
+
{month: 'Nov', price: 2672},
|
|
132
|
+
];
|
|
133
|
+
|
|
134
|
+
const minPrice = 2000;
|
|
135
|
+
const maxPrice = 2800;
|
|
136
|
+
const priceRange = maxPrice - minPrice;
|
|
137
|
+
const chartHeight = height - 280;
|
|
138
|
+
const yAxisSteps = [2000, 2400, 2800];
|
|
139
|
+
|
|
140
|
+
return (
|
|
141
|
+
<AbsoluteFill
|
|
142
|
+
style={{
|
|
143
|
+
backgroundColor: COLOR_BG,
|
|
144
|
+
padding: 60,
|
|
145
|
+
display: 'flex',
|
|
146
|
+
flexDirection: 'column',
|
|
147
|
+
fontFamily,
|
|
148
|
+
}}
|
|
149
|
+
>
|
|
150
|
+
<Title>Gold Price 2024</Title>
|
|
151
|
+
|
|
152
|
+
<div style={{display: 'flex', flex: 1}}>
|
|
153
|
+
<YAxis steps={yAxisSteps} height={chartHeight} />
|
|
154
|
+
<XAxis height={chartHeight} labels={data.map((d) => d.month)}>
|
|
155
|
+
{data.map((item, i) => {
|
|
156
|
+
const progress = spring({
|
|
157
|
+
frame: frame - i * 5 - 10,
|
|
158
|
+
fps,
|
|
159
|
+
config: {damping: 18, stiffness: 80},
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
const barHeight =
|
|
163
|
+
((item.price - minPrice) / priceRange) * chartHeight * progress;
|
|
164
|
+
|
|
165
|
+
return (
|
|
166
|
+
<Bar key={item.month} height={barHeight} progress={progress} />
|
|
167
|
+
);
|
|
168
|
+
})}
|
|
169
|
+
</XAxis>
|
|
170
|
+
</div>
|
|
171
|
+
</AbsoluteFill>
|
|
172
|
+
);
|
|
173
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AbsoluteFill,
|
|
3
|
+
interpolate,
|
|
4
|
+
useCurrentFrame,
|
|
5
|
+
useVideoConfig,
|
|
6
|
+
} from 'remotion';
|
|
7
|
+
|
|
8
|
+
const COLOR_BG = '#ffffff';
|
|
9
|
+
const COLOR_TEXT = '#000000';
|
|
10
|
+
const FULL_TEXT = 'From prompt to motion graphics. This is Remotion.';
|
|
11
|
+
const PAUSE_AFTER = 'From prompt to motion graphics.';
|
|
12
|
+
const FONT_SIZE = 72;
|
|
13
|
+
const FONT_WEIGHT = 700;
|
|
14
|
+
const CHAR_FRAMES = 2;
|
|
15
|
+
const CURSOR_BLINK_FRAMES = 16;
|
|
16
|
+
const PAUSE_SECONDS = 1;
|
|
17
|
+
|
|
18
|
+
// Ideal composition size: 1280x720
|
|
19
|
+
|
|
20
|
+
const getTypedText = ({
|
|
21
|
+
frame,
|
|
22
|
+
fullText,
|
|
23
|
+
pauseAfter,
|
|
24
|
+
charFrames,
|
|
25
|
+
pauseFrames,
|
|
26
|
+
}: {
|
|
27
|
+
frame: number;
|
|
28
|
+
fullText: string;
|
|
29
|
+
pauseAfter: string;
|
|
30
|
+
charFrames: number;
|
|
31
|
+
pauseFrames: number;
|
|
32
|
+
}): string => {
|
|
33
|
+
const pauseIndex = fullText.indexOf(pauseAfter);
|
|
34
|
+
const preLen =
|
|
35
|
+
pauseIndex >= 0 ? pauseIndex + pauseAfter.length : fullText.length;
|
|
36
|
+
|
|
37
|
+
let typedChars = 0;
|
|
38
|
+
if (frame < preLen * charFrames) {
|
|
39
|
+
typedChars = Math.floor(frame / charFrames);
|
|
40
|
+
} else if (frame < preLen * charFrames + pauseFrames) {
|
|
41
|
+
typedChars = preLen;
|
|
42
|
+
} else {
|
|
43
|
+
const postPhase = frame - preLen * charFrames - pauseFrames;
|
|
44
|
+
typedChars = Math.min(
|
|
45
|
+
fullText.length,
|
|
46
|
+
preLen + Math.floor(postPhase / charFrames),
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
return fullText.slice(0, typedChars);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const Cursor: React.FC<{
|
|
53
|
+
frame: number;
|
|
54
|
+
blinkFrames: number;
|
|
55
|
+
symbol?: string;
|
|
56
|
+
}> = ({frame, blinkFrames, symbol = '\u258C'}) => {
|
|
57
|
+
const opacity = interpolate(
|
|
58
|
+
frame % blinkFrames,
|
|
59
|
+
[0, blinkFrames / 2, blinkFrames],
|
|
60
|
+
[1, 0, 1],
|
|
61
|
+
{extrapolateLeft: 'clamp', extrapolateRight: 'clamp'},
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
return <span style={{opacity}}>{symbol}</span>;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const MyAnimation = () => {
|
|
68
|
+
const frame = useCurrentFrame();
|
|
69
|
+
const {fps} = useVideoConfig();
|
|
70
|
+
|
|
71
|
+
const pauseFrames = Math.round(fps * PAUSE_SECONDS);
|
|
72
|
+
|
|
73
|
+
const typedText = getTypedText({
|
|
74
|
+
frame,
|
|
75
|
+
fullText: FULL_TEXT,
|
|
76
|
+
pauseAfter: PAUSE_AFTER,
|
|
77
|
+
charFrames: CHAR_FRAMES,
|
|
78
|
+
pauseFrames,
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
return (
|
|
82
|
+
<AbsoluteFill
|
|
83
|
+
style={{
|
|
84
|
+
backgroundColor: COLOR_BG,
|
|
85
|
+
}}
|
|
86
|
+
>
|
|
87
|
+
<div
|
|
88
|
+
style={{
|
|
89
|
+
color: COLOR_TEXT,
|
|
90
|
+
fontSize: FONT_SIZE,
|
|
91
|
+
fontWeight: FONT_WEIGHT,
|
|
92
|
+
fontFamily: 'sans-serif',
|
|
93
|
+
}}
|
|
94
|
+
>
|
|
95
|
+
<span>{typedText}</span>
|
|
96
|
+
<Cursor frame={frame} blinkFrames={CURSOR_BLINK_FRAMES} />
|
|
97
|
+
</div>
|
|
98
|
+
</AbsoluteFill>
|
|
99
|
+
);
|
|
100
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import {loadFont} from '@remotion/google-fonts/Inter';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import {AbsoluteFill, spring, useCurrentFrame, useVideoConfig} from 'remotion';
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* Highlight a word in a sentence with a spring-animated wipe effect.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
// Ideal composition size: 1280x720
|
|
10
|
+
|
|
11
|
+
const COLOR_BG = '#ffffff';
|
|
12
|
+
const COLOR_TEXT = '#000000';
|
|
13
|
+
const COLOR_HIGHLIGHT = '#A7C7E7';
|
|
14
|
+
const FULL_TEXT = 'This is Remotion.';
|
|
15
|
+
const HIGHLIGHT_WORD = 'Remotion';
|
|
16
|
+
const FONT_SIZE = 72;
|
|
17
|
+
const FONT_WEIGHT = 700;
|
|
18
|
+
const HIGHLIGHT_START_FRAME = 30;
|
|
19
|
+
const HIGHLIGHT_WIPE_DURATION = 18;
|
|
20
|
+
|
|
21
|
+
const {fontFamily} = loadFont();
|
|
22
|
+
|
|
23
|
+
const Highlight: React.FC<{
|
|
24
|
+
word: string;
|
|
25
|
+
color: string;
|
|
26
|
+
delay: number;
|
|
27
|
+
durationInFrames: number;
|
|
28
|
+
}> = ({word, color, delay, durationInFrames}) => {
|
|
29
|
+
const frame = useCurrentFrame();
|
|
30
|
+
const {fps} = useVideoConfig();
|
|
31
|
+
|
|
32
|
+
const highlightProgress = spring({
|
|
33
|
+
fps,
|
|
34
|
+
frame,
|
|
35
|
+
config: {damping: 200},
|
|
36
|
+
delay,
|
|
37
|
+
durationInFrames,
|
|
38
|
+
});
|
|
39
|
+
const scaleX = Math.max(0, Math.min(1, highlightProgress));
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<span style={{position: 'relative', display: 'inline-block'}}>
|
|
43
|
+
<span
|
|
44
|
+
style={{
|
|
45
|
+
position: 'absolute',
|
|
46
|
+
left: 0,
|
|
47
|
+
right: 0,
|
|
48
|
+
top: '50%',
|
|
49
|
+
height: '1.05em',
|
|
50
|
+
transform: `translateY(-50%) scaleX(${scaleX})`,
|
|
51
|
+
transformOrigin: 'left center',
|
|
52
|
+
backgroundColor: color,
|
|
53
|
+
borderRadius: '0.18em',
|
|
54
|
+
zIndex: 0,
|
|
55
|
+
}}
|
|
56
|
+
/>
|
|
57
|
+
<span style={{position: 'relative', zIndex: 1}}>{word}</span>
|
|
58
|
+
</span>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const MyAnimation = () => {
|
|
63
|
+
const highlightIndex = FULL_TEXT.indexOf(HIGHLIGHT_WORD);
|
|
64
|
+
const hasHighlight = highlightIndex >= 0;
|
|
65
|
+
const preText = hasHighlight ? FULL_TEXT.slice(0, highlightIndex) : FULL_TEXT;
|
|
66
|
+
const postText = hasHighlight
|
|
67
|
+
? FULL_TEXT.slice(highlightIndex + HIGHLIGHT_WORD.length)
|
|
68
|
+
: '';
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<AbsoluteFill
|
|
72
|
+
style={{
|
|
73
|
+
backgroundColor: COLOR_BG,
|
|
74
|
+
alignItems: 'center',
|
|
75
|
+
justifyContent: 'center',
|
|
76
|
+
fontFamily,
|
|
77
|
+
}}
|
|
78
|
+
>
|
|
79
|
+
<div
|
|
80
|
+
style={{
|
|
81
|
+
color: COLOR_TEXT,
|
|
82
|
+
fontSize: FONT_SIZE,
|
|
83
|
+
fontWeight: FONT_WEIGHT,
|
|
84
|
+
}}
|
|
85
|
+
>
|
|
86
|
+
{hasHighlight ? (
|
|
87
|
+
<>
|
|
88
|
+
<span>{preText}</span>
|
|
89
|
+
<Highlight
|
|
90
|
+
word={HIGHLIGHT_WORD}
|
|
91
|
+
color={COLOR_HIGHLIGHT}
|
|
92
|
+
delay={HIGHLIGHT_START_FRAME}
|
|
93
|
+
durationInFrames={HIGHLIGHT_WIPE_DURATION}
|
|
94
|
+
/>
|
|
95
|
+
<span>{postText}</span>
|
|
96
|
+
</>
|
|
97
|
+
) : (
|
|
98
|
+
<span>{FULL_TEXT}</span>
|
|
99
|
+
)}
|
|
100
|
+
</div>
|
|
101
|
+
</AbsoluteFill>
|
|
102
|
+
);
|
|
103
|
+
};
|