@kortix/sandbox 0.4.1
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/config/customize.sh +143 -0
- package/config/kortix-env-setup.sh +25 -0
- package/kortix-master/package.json +22 -0
- package/kortix-master/src/config.ts +22 -0
- package/kortix-master/src/index.ts +44 -0
- package/kortix-master/src/routes/env.ts +65 -0
- package/kortix-master/src/routes/proxy.ts +108 -0
- package/kortix-master/src/routes/update.ts +185 -0
- package/kortix-master/src/services/proxy.ts +43 -0
- package/kortix-master/src/services/secret-store.ts +156 -0
- package/kortix-master/tsconfig.json +14 -0
- package/opencode/agents/kortix-browser.md +142 -0
- package/opencode/agents/kortix-build.md +62 -0
- package/opencode/agents/kortix-explore.md +66 -0
- package/opencode/agents/kortix-image-gen.md +33 -0
- package/opencode/agents/kortix-main.md +450 -0
- package/opencode/agents/kortix-plan.md +100 -0
- package/opencode/agents/kortix-research.md +84 -0
- package/opencode/agents/kortix-sheets.md +61 -0
- package/opencode/agents/kortix-slides.md +64 -0
- package/opencode/agents/kortix-web-dev.md +572 -0
- package/opencode/commands/email.md +36 -0
- package/opencode/commands/init.md +43 -0
- package/opencode/commands/journal.md +44 -0
- package/opencode/commands/memory-init.md +81 -0
- package/opencode/commands/memory-search.md +50 -0
- package/opencode/commands/memory-status.md +56 -0
- package/opencode/commands/research.md +36 -0
- package/opencode/commands/search.md +38 -0
- package/opencode/commands/slides.md +32 -0
- package/opencode/commands/spreadsheet.md +30 -0
- package/opencode/memory.json +37 -0
- package/opencode/ocx.jsonc +10 -0
- package/opencode/opencode.jsonc +103 -0
- package/opencode/package.json +25 -0
- package/opencode/patches/apply.sh +19 -0
- package/opencode/patches/opencode-pty-spawn.txt +49 -0
- package/opencode/plugin/background-agents.ts.disabled +483 -0
- package/opencode/plugin/kdco-primitives/get-project-id.ts +172 -0
- package/opencode/plugin/kdco-primitives/index.ts +26 -0
- package/opencode/plugin/kdco-primitives/log-warn.ts +51 -0
- package/opencode/plugin/kdco-primitives/mutex.ts +122 -0
- package/opencode/plugin/kdco-primitives/shell.ts +138 -0
- package/opencode/plugin/kdco-primitives/temp.ts +36 -0
- package/opencode/plugin/kdco-primitives/terminal-detect.ts +34 -0
- package/opencode/plugin/kdco-primitives/types.ts +13 -0
- package/opencode/plugin/kdco-primitives/with-timeout.ts +84 -0
- package/opencode/plugin/memory.ts +306 -0
- package/opencode/plugin/worktree/state.ts +412 -0
- package/opencode/plugin/worktree/terminal.ts +1002 -0
- package/opencode/plugin/worktree.ts +861 -0
- package/opencode/skills/KORTIX-browser/SKILL.md +478 -0
- package/opencode/skills/KORTIX-cron-triggers/SKILL.md +173 -0
- package/opencode/skills/KORTIX-deep-research/SKILL.md +278 -0
- package/opencode/skills/KORTIX-docx/SKILL.md +398 -0
- package/opencode/skills/KORTIX-docx/scripts/__init__.py +1 -0
- package/opencode/skills/KORTIX-docx/scripts/accept_changes.py +104 -0
- package/opencode/skills/KORTIX-docx/scripts/comment.py +244 -0
- package/opencode/skills/KORTIX-docx/scripts/office/helpers/__init__.py +0 -0
- package/opencode/skills/KORTIX-docx/scripts/office/helpers/merge_runs.py +199 -0
- package/opencode/skills/KORTIX-docx/scripts/office/helpers/simplify_redlines.py +197 -0
- package/opencode/skills/KORTIX-docx/scripts/office/pack.py +159 -0
- package/opencode/skills/KORTIX-docx/scripts/office/soffice.py +183 -0
- package/opencode/skills/KORTIX-docx/scripts/office/unpack.py +132 -0
- package/opencode/skills/KORTIX-docx/scripts/office/validate.py +111 -0
- package/opencode/skills/KORTIX-docx/scripts/office/validators/__init__.py +15 -0
- package/opencode/skills/KORTIX-docx/scripts/office/validators/base.py +847 -0
- package/opencode/skills/KORTIX-docx/scripts/office/validators/docx.py +446 -0
- package/opencode/skills/KORTIX-docx/scripts/office/validators/pptx.py +275 -0
- package/opencode/skills/KORTIX-docx/scripts/office/validators/redlining.py +247 -0
- package/opencode/skills/KORTIX-docx/scripts/render_docx.py +179 -0
- package/opencode/skills/KORTIX-docx/scripts/templates/comments.xml +3 -0
- package/opencode/skills/KORTIX-docx/scripts/templates/commentsExtended.xml +3 -0
- package/opencode/skills/KORTIX-docx/scripts/templates/commentsExtensible.xml +3 -0
- package/opencode/skills/KORTIX-docx/scripts/templates/commentsIds.xml +3 -0
- package/opencode/skills/KORTIX-docx/scripts/templates/people.xml +3 -0
- package/opencode/skills/KORTIX-domain-research/SKILL.md +96 -0
- package/opencode/skills/KORTIX-domain-research/scripts/domain-lookup.py +810 -0
- package/opencode/skills/KORTIX-elevenlabs/SKILL.md +230 -0
- package/opencode/skills/KORTIX-elevenlabs/scripts/tts.py +389 -0
- package/opencode/skills/KORTIX-email/SKILL.md +145 -0
- package/opencode/skills/KORTIX-legal-writer/SKILL.md +409 -0
- package/opencode/skills/KORTIX-legal-writer/references/bluebook.md +152 -0
- package/opencode/skills/KORTIX-legal-writer/references/document-types.md +416 -0
- package/opencode/skills/KORTIX-legal-writer/scripts/courtlistener.py +291 -0
- package/opencode/skills/KORTIX-legal-writer/scripts/ecfr_lookup.py +299 -0
- package/opencode/skills/KORTIX-legal-writer/scripts/verify-legal.py +507 -0
- package/opencode/skills/KORTIX-logo-creator/SKILL.md +293 -0
- package/opencode/skills/KORTIX-logo-creator/references/prompt-patterns.md +134 -0
- package/opencode/skills/KORTIX-logo-creator/scripts/compose_logo.py +406 -0
- package/opencode/skills/KORTIX-logo-creator/scripts/create_logo_sheet.py +258 -0
- package/opencode/skills/KORTIX-logo-creator/scripts/remove_bg.py +96 -0
- package/opencode/skills/KORTIX-memory/SKILL.md +261 -0
- package/opencode/skills/KORTIX-memory/scripts/export-sessions.py +409 -0
- package/opencode/skills/KORTIX-paper-creator/SKILL.md +549 -0
- package/opencode/skills/KORTIX-paper-creator/assets/template.tex +101 -0
- package/opencode/skills/KORTIX-paper-creator/scripts/compile.sh +177 -0
- package/opencode/skills/KORTIX-paper-creator/scripts/openalex_to_bibtex.py +220 -0
- package/opencode/skills/KORTIX-paper-creator/scripts/verify.sh +354 -0
- package/opencode/skills/KORTIX-paper-search/SKILL.md +418 -0
- package/opencode/skills/KORTIX-pdf/SKILL.md +232 -0
- package/opencode/skills/KORTIX-pdf/forms.md +36 -0
- package/opencode/skills/KORTIX-pdf/reference.md +105 -0
- package/opencode/skills/KORTIX-pdf/scripts/check_bounding_boxes.py +65 -0
- package/opencode/skills/KORTIX-pdf/scripts/check_fillable_fields.py +11 -0
- package/opencode/skills/KORTIX-pdf/scripts/convert_pdf_to_images.py +33 -0
- package/opencode/skills/KORTIX-pdf/scripts/create_validation_image.py +37 -0
- package/opencode/skills/KORTIX-pdf/scripts/extract_form_field_info.py +122 -0
- package/opencode/skills/KORTIX-pdf/scripts/extract_form_structure.py +115 -0
- package/opencode/skills/KORTIX-pdf/scripts/fill_fillable_fields.py +98 -0
- package/opencode/skills/KORTIX-pdf/scripts/fill_pdf_form_with_annotations.py +107 -0
- package/opencode/skills/KORTIX-plan/SKILL.md +228 -0
- package/opencode/skills/KORTIX-presentation-viewer/SKILL.md +87 -0
- package/opencode/skills/KORTIX-presentation-viewer/serve.ts +136 -0
- package/opencode/skills/KORTIX-presentation-viewer/viewer.html +559 -0
- package/opencode/skills/KORTIX-presentations/SKILL.md +344 -0
- package/opencode/skills/KORTIX-remotion/SKILL.md +56 -0
- package/opencode/skills/KORTIX-remotion/rules/3d.md +86 -0
- package/opencode/skills/KORTIX-remotion/rules/animations.md +29 -0
- package/opencode/skills/KORTIX-remotion/rules/assets.md +78 -0
- package/opencode/skills/KORTIX-remotion/rules/audio-visualization.md +198 -0
- package/opencode/skills/KORTIX-remotion/rules/audio.md +169 -0
- package/opencode/skills/KORTIX-remotion/rules/calculate-metadata.md +104 -0
- package/opencode/skills/KORTIX-remotion/rules/can-decode.md +75 -0
- package/opencode/skills/KORTIX-remotion/rules/charts.md +120 -0
- package/opencode/skills/KORTIX-remotion/rules/compositions.md +141 -0
- package/opencode/skills/KORTIX-remotion/rules/display-captions.md +184 -0
- package/opencode/skills/KORTIX-remotion/rules/extract-frames.md +229 -0
- package/opencode/skills/KORTIX-remotion/rules/ffmpeg.md +38 -0
- package/opencode/skills/KORTIX-remotion/rules/fonts.md +152 -0
- package/opencode/skills/KORTIX-remotion/rules/get-audio-duration.md +58 -0
- package/opencode/skills/KORTIX-remotion/rules/get-video-dimensions.md +68 -0
- package/opencode/skills/KORTIX-remotion/rules/get-video-duration.md +58 -0
- package/opencode/skills/KORTIX-remotion/rules/gifs.md +141 -0
- package/opencode/skills/KORTIX-remotion/rules/images.md +130 -0
- package/opencode/skills/KORTIX-remotion/rules/import-srt-captions.md +69 -0
- package/opencode/skills/KORTIX-remotion/rules/light-leaks.md +73 -0
- package/opencode/skills/KORTIX-remotion/rules/lottie.md +68 -0
- package/opencode/skills/KORTIX-remotion/rules/maps.md +401 -0
- package/opencode/skills/KORTIX-remotion/rules/measuring-dom-nodes.md +35 -0
- package/opencode/skills/KORTIX-remotion/rules/measuring-text.md +143 -0
- package/opencode/skills/KORTIX-remotion/rules/parameters.md +98 -0
- package/opencode/skills/KORTIX-remotion/rules/sequencing.md +118 -0
- package/opencode/skills/KORTIX-remotion/rules/subtitles.md +36 -0
- package/opencode/skills/KORTIX-remotion/rules/tailwind.md +11 -0
- package/opencode/skills/KORTIX-remotion/rules/text-animations.md +20 -0
- package/opencode/skills/KORTIX-remotion/rules/timing.md +179 -0
- package/opencode/skills/KORTIX-remotion/rules/transcribe-captions.md +70 -0
- package/opencode/skills/KORTIX-remotion/rules/transitions.md +197 -0
- package/opencode/skills/KORTIX-remotion/rules/transparent-videos.md +106 -0
- package/opencode/skills/KORTIX-remotion/rules/trimming.md +53 -0
- package/opencode/skills/KORTIX-remotion/rules/videos.md +171 -0
- package/opencode/skills/KORTIX-secrets/SKILL.md +280 -0
- package/opencode/skills/KORTIX-semantic-search/SKILL.md +213 -0
- package/opencode/skills/KORTIX-session-search/SKILL.md +807 -0
- package/opencode/skills/KORTIX-session-search/Untitled +1 -0
- package/opencode/skills/KORTIX-skill-creator/SKILL.md +163 -0
- package/opencode/skills/KORTIX-web-research/SKILL.md +69 -0
- package/opencode/skills/KORTIX-xlsx/LICENSE.txt +30 -0
- package/opencode/skills/KORTIX-xlsx/SKILL.md +549 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/helpers/__init__.py +0 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/helpers/merge_runs.py +199 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/helpers/simplify_redlines.py +197 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/pack.py +159 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/mce/mc.xsd +75 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/soffice.py +183 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/unpack.py +132 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/validate.py +111 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/validators/__init__.py +15 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/validators/base.py +847 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/validators/docx.py +446 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/validators/pptx.py +275 -0
- package/opencode/skills/KORTIX-xlsx/scripts/office/validators/redlining.py +247 -0
- package/opencode/skills/KORTIX-xlsx/scripts/recalc.py +184 -0
- package/opencode/tools/image-gen.ts +342 -0
- package/opencode/tools/image-search.ts +190 -0
- package/opencode/tools/memory-get.ts +168 -0
- package/opencode/tools/memory-search.ts +247 -0
- package/opencode/tools/presentation-gen.ts +723 -0
- package/opencode/tools/scrape-webpage.ts +115 -0
- package/opencode/tools/scripts/.python-version +1 -0
- package/opencode/tools/scripts/convert_pdf.py +184 -0
- package/opencode/tools/scripts/convert_pptx.py +562 -0
- package/opencode/tools/scripts/pyproject.toml +11 -0
- package/opencode/tools/scripts/uv.lock +287 -0
- package/opencode/tools/scripts/validate_slide.py +74 -0
- package/opencode/tools/show-user.ts +217 -0
- package/opencode/tools/tests/e2e-presentation-fix.ts +277 -0
- package/opencode/tools/tests/image-gen.test.ts +215 -0
- package/opencode/tools/tests/image-search.test.ts +125 -0
- package/opencode/tools/tests/memory-system-benchmark.ts +1076 -0
- package/opencode/tools/tests/presentation-gen.test.ts +389 -0
- package/opencode/tools/tests/scrape-webpage.test.ts +74 -0
- package/opencode/tools/tests/show-user.test.ts +241 -0
- package/opencode/tools/tests/video-gen.test.ts +110 -0
- package/opencode/tools/tests/web-search.test.ts +106 -0
- package/opencode/tools/video-gen.ts +200 -0
- package/opencode/tools/web-search.ts +153 -0
- package/opencode/tsconfig.json +29 -0
- package/package.json +36 -0
- package/patch-agent-browser.js +100 -0
- package/postinstall.sh +88 -0
- package/services/KORTIX-presentation-viewer/run +37 -0
- package/services/agent-browser-viewer/run +48 -0
- package/services/kortix-master/run +16 -0
- package/services/lss-sync/run +22 -0
- package/services/opencode-serve/run +25 -0
- package/services/opencode-web/run +21 -0
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kortix-presentations
|
|
3
|
+
description: "Use this skill any time the user wants to create, edit, or export a slide deck presentation. This includes any task involving slides, decks, pitch decks, keynotes, or visual presentations. Trigger when the user says anything like 'create a presentation', 'make slides', 'build a deck', 'presentation about X'. The deliverable is a set of HTML slides (1920x1080) created via the presentation-gen tool, with optional PDF/PPTX export. Do NOT trigger for documents, reports, spreadsheets, or web pages — only slide deck presentations."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Kortix Presentations — Slide Deck Creation Skill
|
|
7
|
+
|
|
8
|
+
You are loading the presentation creation skill. Follow these instructions for ALL presentation work.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Autonomy Doctrine
|
|
13
|
+
|
|
14
|
+
**Act, don't ask.** Receive the topic, research it, design a custom theme, create all slides, validate, preview, export. No permission requests. No presenting options. Just deliver a complete, polished deck.
|
|
15
|
+
|
|
16
|
+
- **Decide the structure yourself.** Pick the right number of slides, the right layout, the right visuals.
|
|
17
|
+
- **Research before designing.** Never use generic colors. Find actual brand colors and visual identity.
|
|
18
|
+
- **Create all slides in parallel.** Don't build one at a time — batch them.
|
|
19
|
+
- **Validate and preview before delivering.** Fix any overflows or visual issues yourself.
|
|
20
|
+
- Only ask for clarification if the topic is completely unclear or genuinely ambiguous.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Available Tools
|
|
25
|
+
|
|
26
|
+
- **`presentation-gen`** — Create, manage, validate, preview, and export slides.
|
|
27
|
+
- `create_slide` — Create a single slide (HTML body content)
|
|
28
|
+
- `list_slides` / `delete_slide` — Manage slides
|
|
29
|
+
- `list_presentations` / `delete_presentation` — Manage presentations
|
|
30
|
+
- `validate_slide` — Check dimensions via Playwright (must fit 1920x1080)
|
|
31
|
+
- `export_pdf` — Render all slides to merged PDF via Playwright
|
|
32
|
+
- `export_pptx` — 3-layer PPTX (background + visual elements + editable text) via Playwright + python-pptx
|
|
33
|
+
- `preview` — Start local HTTP server at `http://localhost:3210` with keyboard nav, fullscreen, thumbnails
|
|
34
|
+
- **`image-search`** — Search Google Images. Batch queries with `|||` separator.
|
|
35
|
+
- **`image-gen`** — Generate images via Replicate (Flux Schnell). Actions: `generate`, `edit`, `upscale`, `remove_bg`.
|
|
36
|
+
- **`web-search`** — Search the web via Tavily. Batch queries with `|||` separator.
|
|
37
|
+
- **`scrape-webpage`** — Fetch and extract content from URLs via Firecrawl.
|
|
38
|
+
|
|
39
|
+
**CRITICAL**: ALWAYS use `presentation-gen` with `action: "create_slide"` to build slides. NEVER create slide HTML files manually.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Folder Structure
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
presentations/
|
|
47
|
+
images/ ← shared images (downloaded BEFORE slides)
|
|
48
|
+
hero.jpg
|
|
49
|
+
logo.png
|
|
50
|
+
[presentation-name]/ ← created automatically by create_slide
|
|
51
|
+
metadata.json
|
|
52
|
+
slide_01.html
|
|
53
|
+
slide_02.html
|
|
54
|
+
viewer.html ← auto-generated on every create/delete
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Images go to `presentations/images/` BEFORE the presentation folder exists. Reference images as `../images/[filename]` from slides.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Efficiency Rules
|
|
62
|
+
|
|
63
|
+
1. **Batch searches** — Multiple queries in ONE call using `|||` separator
|
|
64
|
+
2. **Chain shell commands** — ALL folder creation + image downloads in ONE bash command
|
|
65
|
+
3. **Parallel slide creation** — Create ALL slides simultaneously (multiple `create_slide` calls at once)
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
# Creation Workflow
|
|
70
|
+
|
|
71
|
+
## Phase 1: Topic Confirmation
|
|
72
|
+
|
|
73
|
+
1. Extract the topic from the user's message
|
|
74
|
+
2. If clear enough to act on, proceed immediately with defaults:
|
|
75
|
+
- Target audience: "General public" unless specified
|
|
76
|
+
- Goals: "Informative overview" unless specified
|
|
77
|
+
3. Only ask for clarification if the topic is completely unclear
|
|
78
|
+
|
|
79
|
+
## Phase 2: Theme Design
|
|
80
|
+
|
|
81
|
+
1. **Batch web search for brand identity** — ALL in one call:
|
|
82
|
+
- `[topic] brand colors`
|
|
83
|
+
- `[topic] visual identity`
|
|
84
|
+
- `[topic] official website design`
|
|
85
|
+
- `[topic] brand guidelines`
|
|
86
|
+
|
|
87
|
+
2. **Define custom color scheme** based on research:
|
|
88
|
+
- USE ACTUAL brand colors found in research
|
|
89
|
+
- FORBIDDEN: "blue for tech", "red for speed", "green for innovation" without research backing
|
|
90
|
+
- For companies: use their official brand colors
|
|
91
|
+
- For people: find their associated visual identity
|
|
92
|
+
- Document WHERE you found the color information
|
|
93
|
+
- Define: primary, secondary, accent, text color, font choices, layout patterns
|
|
94
|
+
|
|
95
|
+
## Phase 3: Research and Content Planning
|
|
96
|
+
|
|
97
|
+
Complete ALL steps including ALL image downloads before Phase 4.
|
|
98
|
+
|
|
99
|
+
1. **Batch content research** — ALL in one call:
|
|
100
|
+
- `[topic] history background`
|
|
101
|
+
- `[topic] key features`
|
|
102
|
+
- `[topic] statistics data facts`
|
|
103
|
+
- `[topic] significance impact`
|
|
104
|
+
- Scrape key pages for detail
|
|
105
|
+
|
|
106
|
+
2. **Create content outline** — one main idea per slide. Note a TOPIC-SPECIFIC image query for each slide (always include the actual topic name/brand/person — never generic category queries).
|
|
107
|
+
|
|
108
|
+
3. **Batch image search** — ALL queries in one call with `num_results: 2`
|
|
109
|
+
|
|
110
|
+
4. **Select images** based on:
|
|
111
|
+
- Topic specificity (actual brand/person images, not generic stock)
|
|
112
|
+
- Dimensions (landscape for backgrounds, portrait for side panels)
|
|
113
|
+
- Visual quality and relevance
|
|
114
|
+
|
|
115
|
+
5. **Download ALL images in one command**:
|
|
116
|
+
```bash
|
|
117
|
+
mkdir -p presentations/images && \
|
|
118
|
+
curl -L "URL1" -o presentations/images/slide1_hero.jpg && \
|
|
119
|
+
curl -L "URL2" -o presentations/images/slide2_detail.jpg && \
|
|
120
|
+
ls -lh presentations/images/
|
|
121
|
+
```
|
|
122
|
+
Verify ALL expected files exist. Retry any failures.
|
|
123
|
+
|
|
124
|
+
6. **Document image mapping**: slide number -> filename, dimensions, orientation, placement
|
|
125
|
+
|
|
126
|
+
## Phase 4: Slide Creation
|
|
127
|
+
|
|
128
|
+
Only start after Phase 3 is complete with all images downloaded and verified.
|
|
129
|
+
|
|
130
|
+
1. **Create ALL slides in parallel** — multiple `create_slide` calls simultaneously:
|
|
131
|
+
```
|
|
132
|
+
presentation-gen(
|
|
133
|
+
action: "create_slide",
|
|
134
|
+
presentation_name: "my_pres",
|
|
135
|
+
slide_number: 1,
|
|
136
|
+
slide_title: "Introduction",
|
|
137
|
+
content: "<div>...</div>",
|
|
138
|
+
presentation_title: "My Presentation"
|
|
139
|
+
)
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
2. **Use downloaded images** — Reference as `../images/filename` in `<img>` tags:
|
|
143
|
+
- Landscape → full-width backgrounds, hero images
|
|
144
|
+
- Portrait → side panels, accent images
|
|
145
|
+
- Square → centered focal points, logos
|
|
146
|
+
|
|
147
|
+
## Phase 5: Validate, Preview, Export
|
|
148
|
+
|
|
149
|
+
1. **Validate** — `presentation-gen` with `action: "validate_slide"` on each slide. Fix any overflows (content exceeding 1920x1080).
|
|
150
|
+
|
|
151
|
+
2. **Preview** — `presentation-gen` with `action: "preview"` to launch viewer at `http://localhost:3210`.
|
|
152
|
+
|
|
153
|
+
3. **Export** — both formats:
|
|
154
|
+
- `action: "export_pdf"` — merged PDF via Playwright
|
|
155
|
+
- `action: "export_pptx"` — 3-layer PPTX (background + visuals + editable text)
|
|
156
|
+
|
|
157
|
+
Both require `presentation_name`. Output saved in the presentation folder.
|
|
158
|
+
|
|
159
|
+
## Phase 6: Deliver
|
|
160
|
+
|
|
161
|
+
Review all slides for visual consistency, then report:
|
|
162
|
+
- What was created (topic, slide count, theme)
|
|
163
|
+
- Viewer URL: `http://localhost:3210`
|
|
164
|
+
- Paths to exported PDF and PPTX files
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
# Slide Content Rules
|
|
169
|
+
|
|
170
|
+
## HTML Rules
|
|
171
|
+
|
|
172
|
+
- HTML body content ONLY — no `<!DOCTYPE>`, `<html>`, `<head>`, `<body>` tags (added automatically)
|
|
173
|
+
- Inter font is pre-loaded — use it directly
|
|
174
|
+
- Use emoji for icons — no Font Awesome or icon libraries
|
|
175
|
+
- Design for FIXED **1920x1080 pixels** — NOT responsive
|
|
176
|
+
- `box-sizing: border-box` on all containers
|
|
177
|
+
- Max 40px container padding
|
|
178
|
+
- `overflow: hidden` on all containers
|
|
179
|
+
|
|
180
|
+
## Typography
|
|
181
|
+
|
|
182
|
+
| Element | Size | Weight |
|
|
183
|
+
|---|---|---|
|
|
184
|
+
| Titles | 48-72px | 700-900 |
|
|
185
|
+
| Subtitles | 32-42px | 600-700 |
|
|
186
|
+
| Headings | 28-36px | 600 |
|
|
187
|
+
| Body | 20-24px | 400-500 |
|
|
188
|
+
| Small/captions | 16-18px | 300-400 |
|
|
189
|
+
|
|
190
|
+
Line height: 1.5-1.8 for all text.
|
|
191
|
+
|
|
192
|
+
## Layout — PRESENTATION, NOT WEBSITE
|
|
193
|
+
|
|
194
|
+
**FORBIDDEN:**
|
|
195
|
+
- Multi-column card grids
|
|
196
|
+
- Responsive patterns, `vw`/`vh` units, media queries
|
|
197
|
+
- Scrolling content
|
|
198
|
+
- More than 5 bullet points per slide
|
|
199
|
+
- More than 2 ideas per slide
|
|
200
|
+
|
|
201
|
+
**REQUIRED:**
|
|
202
|
+
- Centered, focused content
|
|
203
|
+
- Large titles with visual impact
|
|
204
|
+
- Fixed pixel dimensions only
|
|
205
|
+
- 1-2 ideas per slide max
|
|
206
|
+
- 3-5 bullet points max
|
|
207
|
+
- Think PowerPoint: large title, centered content, minimal elements
|
|
208
|
+
|
|
209
|
+
## Color Usage
|
|
210
|
+
|
|
211
|
+
- **Primary** — backgrounds, main elements
|
|
212
|
+
- **Secondary** — subtle backgrounds, section dividers
|
|
213
|
+
- **Accent** — highlights, CTAs, key numbers
|
|
214
|
+
- **Text** — all text content
|
|
215
|
+
- Consistent scheme across ALL slides — no slide should look like it belongs to a different deck
|
|
216
|
+
|
|
217
|
+
## Image Placement Patterns
|
|
218
|
+
|
|
219
|
+
### Full-bleed background
|
|
220
|
+
```html
|
|
221
|
+
<div style="position:absolute;inset:0;background:url('../images/hero.jpg') center/cover;"></div>
|
|
222
|
+
<div style="position:absolute;inset:0;background:rgba(0,0,0,0.5);"></div>
|
|
223
|
+
<div style="position:relative;z-index:1;padding:60px;">
|
|
224
|
+
<!-- content over darkened image -->
|
|
225
|
+
</div>
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Side panel (40/60 split)
|
|
229
|
+
```html
|
|
230
|
+
<div style="display:flex;width:1920px;height:1080px;">
|
|
231
|
+
<div style="width:40%;background:url('../images/photo.jpg') center/cover;"></div>
|
|
232
|
+
<div style="width:60%;padding:60px;display:flex;flex-direction:column;justify-content:center;">
|
|
233
|
+
<!-- content -->
|
|
234
|
+
</div>
|
|
235
|
+
</div>
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### Centered accent image
|
|
239
|
+
```html
|
|
240
|
+
<div style="text-align:center;padding:40px;">
|
|
241
|
+
<img src="../images/logo.png" style="max-height:300px;margin:0 auto 30px;">
|
|
242
|
+
<!-- content below -->
|
|
243
|
+
</div>
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
## Data Visualization
|
|
247
|
+
|
|
248
|
+
D3.js and Chart.js are pre-loaded. Use them for charts, graphs, and data visualizations directly in slide HTML.
|
|
249
|
+
|
|
250
|
+
```html
|
|
251
|
+
<canvas id="myChart" width="800" height="400"></canvas>
|
|
252
|
+
<script>
|
|
253
|
+
new Chart(document.getElementById('myChart'), {
|
|
254
|
+
type: 'bar',
|
|
255
|
+
data: {
|
|
256
|
+
labels: ['Q1', 'Q2', 'Q3', 'Q4'],
|
|
257
|
+
datasets: [{
|
|
258
|
+
label: 'Revenue ($M)',
|
|
259
|
+
data: [12, 19, 8, 15],
|
|
260
|
+
backgroundColor: '#1F4E79'
|
|
261
|
+
}]
|
|
262
|
+
},
|
|
263
|
+
options: { responsive: false }
|
|
264
|
+
});
|
|
265
|
+
</script>
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
# Slide Templates
|
|
271
|
+
|
|
272
|
+
## Title Slide
|
|
273
|
+
```html
|
|
274
|
+
<div style="width:1920px;height:1080px;display:flex;flex-direction:column;justify-content:center;align-items:center;background:linear-gradient(135deg,PRIMARY,SECONDARY);padding:80px;box-sizing:border-box;">
|
|
275
|
+
<h1 style="font-size:64px;font-weight:800;color:#fff;text-align:center;margin:0 0 20px;">
|
|
276
|
+
Presentation Title
|
|
277
|
+
</h1>
|
|
278
|
+
<p style="font-size:28px;font-weight:400;color:rgba(255,255,255,0.8);text-align:center;">
|
|
279
|
+
Subtitle or tagline
|
|
280
|
+
</p>
|
|
281
|
+
</div>
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
## Content Slide (title + bullets)
|
|
285
|
+
```html
|
|
286
|
+
<div style="width:1920px;height:1080px;padding:60px 80px;box-sizing:border-box;background:#fff;display:flex;flex-direction:column;">
|
|
287
|
+
<h2 style="font-size:48px;font-weight:700;color:PRIMARY;margin:0 0 40px;">
|
|
288
|
+
Section Title
|
|
289
|
+
</h2>
|
|
290
|
+
<ul style="font-size:24px;line-height:1.8;color:#333;list-style:none;padding:0;">
|
|
291
|
+
<li style="margin-bottom:20px;">• First key point with supporting detail</li>
|
|
292
|
+
<li style="margin-bottom:20px;">• Second key point with supporting detail</li>
|
|
293
|
+
<li style="margin-bottom:20px;">• Third key point with supporting detail</li>
|
|
294
|
+
</ul>
|
|
295
|
+
</div>
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
## Stats/Numbers Slide
|
|
299
|
+
```html
|
|
300
|
+
<div style="width:1920px;height:1080px;padding:60px 80px;box-sizing:border-box;background:PRIMARY;display:flex;flex-direction:column;justify-content:center;">
|
|
301
|
+
<h2 style="font-size:42px;font-weight:700;color:#fff;margin:0 0 60px;text-align:center;">
|
|
302
|
+
Key Numbers
|
|
303
|
+
</h2>
|
|
304
|
+
<div style="display:flex;justify-content:space-around;">
|
|
305
|
+
<div style="text-align:center;">
|
|
306
|
+
<div style="font-size:72px;font-weight:900;color:ACCENT;">$2.5B</div>
|
|
307
|
+
<div style="font-size:20px;color:rgba(255,255,255,0.8);margin-top:10px;">Revenue</div>
|
|
308
|
+
</div>
|
|
309
|
+
<div style="text-align:center;">
|
|
310
|
+
<div style="font-size:72px;font-weight:900;color:ACCENT;">150K+</div>
|
|
311
|
+
<div style="font-size:20px;color:rgba(255,255,255,0.8);margin-top:10px;">Customers</div>
|
|
312
|
+
</div>
|
|
313
|
+
<div style="text-align:center;">
|
|
314
|
+
<div style="font-size:72px;font-weight:900;color:ACCENT;">98%</div>
|
|
315
|
+
<div style="font-size:20px;color:rgba(255,255,255,0.8);margin-top:10px;">Satisfaction</div>
|
|
316
|
+
</div>
|
|
317
|
+
</div>
|
|
318
|
+
</div>
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
## Quote Slide
|
|
322
|
+
```html
|
|
323
|
+
<div style="width:1920px;height:1080px;display:flex;align-items:center;justify-content:center;background:SECONDARY;padding:120px;box-sizing:border-box;">
|
|
324
|
+
<div style="max-width:1200px;text-align:center;">
|
|
325
|
+
<div style="font-size:120px;color:ACCENT;line-height:1;margin-bottom:20px;">"</div>
|
|
326
|
+
<p style="font-size:36px;font-weight:500;color:PRIMARY;line-height:1.6;font-style:italic;">
|
|
327
|
+
The quote text goes here, keeping it impactful and concise.
|
|
328
|
+
</p>
|
|
329
|
+
<p style="font-size:20px;color:#666;margin-top:30px;">— Attribution Name, Title</p>
|
|
330
|
+
</div>
|
|
331
|
+
</div>
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
## Closing/CTA Slide
|
|
335
|
+
```html
|
|
336
|
+
<div style="width:1920px;height:1080px;display:flex;flex-direction:column;justify-content:center;align-items:center;background:linear-gradient(135deg,PRIMARY,SECONDARY);padding:80px;box-sizing:border-box;">
|
|
337
|
+
<h2 style="font-size:56px;font-weight:800;color:#fff;text-align:center;margin:0 0 30px;">
|
|
338
|
+
Thank You
|
|
339
|
+
</h2>
|
|
340
|
+
<p style="font-size:24px;color:rgba(255,255,255,0.8);text-align:center;">
|
|
341
|
+
Contact info or call to action
|
|
342
|
+
</p>
|
|
343
|
+
</div>
|
|
344
|
+
```
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
## How to use
|
|
25
|
+
|
|
26
|
+
Read individual rule files for detailed explanations and code examples:
|
|
27
|
+
|
|
28
|
+
- [rules/3d.md](rules/3d.md) - 3D content in Remotion using Three.js and React Three Fiber
|
|
29
|
+
- [rules/animations.md](rules/animations.md) - Fundamental animation skills for Remotion
|
|
30
|
+
- [rules/assets.md](rules/assets.md) - Importing images, videos, audio, and fonts into Remotion
|
|
31
|
+
- [rules/audio.md](rules/audio.md) - Using audio and sound in Remotion - importing, trimming, volume, speed, pitch
|
|
32
|
+
- [rules/calculate-metadata.md](rules/calculate-metadata.md) - Dynamically set composition duration, dimensions, and props
|
|
33
|
+
- [rules/can-decode.md](rules/can-decode.md) - Check if a video can be decoded by the browser using Mediabunny
|
|
34
|
+
- [rules/charts.md](rules/charts.md) - Chart and data visualization patterns for Remotion (bar, pie, line, stock charts)
|
|
35
|
+
- [rules/compositions.md](rules/compositions.md) - Defining compositions, stills, folders, default props and dynamic metadata
|
|
36
|
+
- [rules/extract-frames.md](rules/extract-frames.md) - Extract frames from videos at specific timestamps using Mediabunny
|
|
37
|
+
- [rules/fonts.md](rules/fonts.md) - Loading Google Fonts and local fonts in Remotion
|
|
38
|
+
- [rules/get-audio-duration.md](rules/get-audio-duration.md) - Getting the duration of an audio file in seconds with Mediabunny
|
|
39
|
+
- [rules/get-video-dimensions.md](rules/get-video-dimensions.md) - Getting the width and height of a video file with Mediabunny
|
|
40
|
+
- [rules/get-video-duration.md](rules/get-video-duration.md) - Getting the duration of a video file in seconds with Mediabunny
|
|
41
|
+
- [rules/gifs.md](rules/gifs.md) - Displaying GIFs synchronized with Remotion's timeline
|
|
42
|
+
- [rules/images.md](rules/images.md) - Embedding images in Remotion using the Img component
|
|
43
|
+
- [rules/light-leaks.md](rules/light-leaks.md) - Light leak overlay effects using @remotion/light-leaks
|
|
44
|
+
- [rules/lottie.md](rules/lottie.md) - Embedding Lottie animations in Remotion
|
|
45
|
+
- [rules/measuring-dom-nodes.md](rules/measuring-dom-nodes.md) - Measuring DOM element dimensions in Remotion
|
|
46
|
+
- [rules/measuring-text.md](rules/measuring-text.md) - Measuring text dimensions, fitting text to containers, and checking overflow
|
|
47
|
+
- [rules/sequencing.md](rules/sequencing.md) - Sequencing patterns for Remotion - delay, trim, limit duration of items
|
|
48
|
+
- [rules/tailwind.md](rules/tailwind.md) - Using TailwindCSS in Remotion
|
|
49
|
+
- [rules/text-animations.md](rules/text-animations.md) - Typography and text animation patterns for Remotion
|
|
50
|
+
- [rules/timing.md](rules/timing.md) - Interpolation curves in Remotion - linear, easing, spring animations
|
|
51
|
+
- [rules/transitions.md](rules/transitions.md) - Scene transition patterns for Remotion
|
|
52
|
+
- [rules/transparent-videos.md](rules/transparent-videos.md) - Rendering out a video with transparency
|
|
53
|
+
- [rules/trimming.md](rules/trimming.md) - Trimming patterns for Remotion - cut the beginning or end of animations
|
|
54
|
+
- [rules/videos.md](rules/videos.md) - Embedding videos in Remotion - trimming, volume, speed, looping, pitch
|
|
55
|
+
- [rules/parameters.md](rules/parameters.md) - Make a video parametrizable by adding a Zod schema
|
|
56
|
+
- [rules/maps.md](rules/maps.md) - Add a map using Mapbox and animate it
|
|
@@ -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,29 @@
|
|
|
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 (
|
|
23
|
+
<div style={{ opacity }}>Hello World!</div>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
CSS transitions or animations are FORBIDDEN - they will not render correctly.
|
|
29
|
+
Tailwind animation class names are FORBIDDEN - they will not render correctly.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: assets
|
|
3
|
+
description: Importing images, videos, audio, and fonts into Remotion
|
|
4
|
+
metadata:
|
|
5
|
+
tags: assets, staticFile, images, fonts, public
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Importing assets in Remotion
|
|
9
|
+
|
|
10
|
+
## The public folder
|
|
11
|
+
|
|
12
|
+
Place assets in the `public/` folder at your project root.
|
|
13
|
+
|
|
14
|
+
## Using staticFile()
|
|
15
|
+
|
|
16
|
+
You MUST use `staticFile()` to reference files from the `public/` folder:
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
import {Img, staticFile} from 'remotion';
|
|
20
|
+
|
|
21
|
+
export const MyComposition = () => {
|
|
22
|
+
return <Img src={staticFile('logo.png')} />;
|
|
23
|
+
};
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The function returns an encoded URL that works correctly when deploying to subdirectories.
|
|
27
|
+
|
|
28
|
+
## Using with components
|
|
29
|
+
|
|
30
|
+
**Images:**
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
import {Img, staticFile} from 'remotion';
|
|
34
|
+
|
|
35
|
+
<Img src={staticFile('photo.png')} />;
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**Videos:**
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
import {Video} from '@remotion/media';
|
|
42
|
+
import {staticFile} from 'remotion';
|
|
43
|
+
|
|
44
|
+
<Video src={staticFile('clip.mp4')} />;
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Audio:**
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
import {Audio} from '@remotion/media';
|
|
51
|
+
import {staticFile} from 'remotion';
|
|
52
|
+
|
|
53
|
+
<Audio src={staticFile('music.mp3')} />;
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Fonts:**
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
import {staticFile} from 'remotion';
|
|
60
|
+
|
|
61
|
+
const fontFamily = new FontFace('MyFont', `url(${staticFile('font.woff2')})`);
|
|
62
|
+
await fontFamily.load();
|
|
63
|
+
document.fonts.add(fontFamily);
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Remote URLs
|
|
67
|
+
|
|
68
|
+
Remote URLs can be used directly without `staticFile()`:
|
|
69
|
+
|
|
70
|
+
```tsx
|
|
71
|
+
<Img src="https://example.com/image.png" />
|
|
72
|
+
<Video src="https://remotion.media/video.mp4" />
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Important notes
|
|
76
|
+
|
|
77
|
+
- Remotion components (`<Img>`, `<Video>`, `<Audio>`) ensure assets are fully loaded before rendering
|
|
78
|
+
- Special characters in filenames (`#`, `?`, `&`) are automatically encoded
|