mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-04-12 12:43:32 +08:00
Ports functionality from 10+ separate plugins into ECC so users only need one plugin installed. Consolidates: pr-review-toolkit, feature-dev, commit-commands, hookify, code-simplifier, security-guidance, frontend-design, explanatory-output-style, and personal skills. New agents (8): code-architect, code-explorer, code-simplifier, comment-analyzer, conversation-analyzer, pr-test-analyzer, silent-failure-hunter, type-design-analyzer New commands (9): commit, commit-push-pr, clean-gone, review-pr, feature-dev, hookify, hookify-list, hookify-configure, hookify-help New skills (8): frontend-design, hookify-rules, github-ops, knowledge-ops, lead-intelligence, oura-health, pmx-guidelines, remotion Enhanced skills (8): article-writing, content-engine, market-research, investor-materials, investor-outreach, x-api, security-scan, autonomous-loops — merged with personal skill content New hook: security-reminder.py (pattern-based OWASP vulnerability warnings on file edits) Totals: 36 agents, 69 commands, 128 skills, 29 hook scripts
147 lines
3.4 KiB
Markdown
147 lines
3.4 KiB
Markdown
---
|
|
name: compositions
|
|
description: Defining compositions, stills, folders, default props and dynamic metadata
|
|
metadata:
|
|
tags: composition, still, folder, props, metadata
|
|
---
|
|
|
|
A `<Composition>` defines the component, width, height, fps and duration of a renderable video.
|
|
|
|
It normally is placed in the `src/Root.tsx` file.
|
|
|
|
```tsx
|
|
import { Composition } from "remotion";
|
|
import { MyComposition } from "./MyComposition";
|
|
|
|
export const RemotionRoot = () => {
|
|
return (
|
|
<Composition
|
|
id="MyComposition"
|
|
component={MyComposition}
|
|
durationInFrames={100}
|
|
fps={30}
|
|
width={1080}
|
|
height={1080}
|
|
/>
|
|
);
|
|
};
|
|
```
|
|
|
|
## Default Props
|
|
|
|
Pass `defaultProps` to provide initial values for your component.
|
|
Values must be JSON-serializable (`Date`, `Map`, `Set`, and `staticFile()` are supported).
|
|
|
|
```tsx
|
|
import { Composition } from "remotion";
|
|
import { MyComposition, MyCompositionProps } from "./MyComposition";
|
|
|
|
export const RemotionRoot = () => {
|
|
return (
|
|
<Composition
|
|
id="MyComposition"
|
|
component={MyComposition}
|
|
durationInFrames={100}
|
|
fps={30}
|
|
width={1080}
|
|
height={1080}
|
|
defaultProps={{
|
|
title: "Hello World",
|
|
color: "#ff0000",
|
|
} satisfies MyCompositionProps}
|
|
/>
|
|
);
|
|
};
|
|
```
|
|
|
|
Use `type` declarations for props rather than `interface` to ensure `defaultProps` type safety.
|
|
|
|
## Folders
|
|
|
|
Use `<Folder>` to organize compositions in the sidebar.
|
|
Folder names can only contain letters, numbers, and hyphens.
|
|
|
|
```tsx
|
|
import { Composition, Folder } from "remotion";
|
|
|
|
export const RemotionRoot = () => {
|
|
return (
|
|
<>
|
|
<Folder name="Marketing">
|
|
<Composition id="Promo" /* ... */ />
|
|
<Composition id="Ad" /* ... */ />
|
|
</Folder>
|
|
<Folder name="Social">
|
|
<Folder name="Instagram">
|
|
<Composition id="Story" /* ... */ />
|
|
<Composition id="Reel" /* ... */ />
|
|
</Folder>
|
|
</Folder>
|
|
</>
|
|
);
|
|
};
|
|
```
|
|
|
|
## Stills
|
|
|
|
Use `<Still>` for single-frame images. It does not require `durationInFrames` or `fps`.
|
|
|
|
```tsx
|
|
import { Still } from "remotion";
|
|
import { Thumbnail } from "./Thumbnail";
|
|
|
|
export const RemotionRoot = () => {
|
|
return (
|
|
<Still
|
|
id="Thumbnail"
|
|
component={Thumbnail}
|
|
width={1280}
|
|
height={720}
|
|
/>
|
|
);
|
|
};
|
|
```
|
|
|
|
## Calculate Metadata
|
|
|
|
Use `calculateMetadata` to make dimensions, duration, or props dynamic based on data.
|
|
|
|
```tsx
|
|
import { Composition, CalculateMetadataFunction } from "remotion";
|
|
import { MyComposition, MyCompositionProps } from "./MyComposition";
|
|
|
|
const calculateMetadata: CalculateMetadataFunction<MyCompositionProps> = async ({
|
|
props,
|
|
abortSignal,
|
|
}) => {
|
|
const data = await fetch(`https://api.example.com/video/${props.videoId}`, {
|
|
signal: abortSignal,
|
|
}).then((res) => res.json());
|
|
|
|
return {
|
|
durationInFrames: Math.ceil(data.duration * 30),
|
|
props: {
|
|
...props,
|
|
videoUrl: data.url,
|
|
},
|
|
};
|
|
};
|
|
|
|
export const RemotionRoot = () => {
|
|
return (
|
|
<Composition
|
|
id="MyComposition"
|
|
component={MyComposition}
|
|
durationInFrames={100} // Placeholder, will be overridden
|
|
fps={30}
|
|
width={1080}
|
|
height={1080}
|
|
defaultProps={{ videoId: "abc123" }}
|
|
calculateMetadata={calculateMetadata}
|
|
/>
|
|
);
|
|
};
|
|
```
|
|
|
|
The function can return `props`, `durationInFrames`, `width`, `height`, `fps`, and codec-related defaults. It runs once before rendering begins.
|