@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.
Files changed (246) hide show
  1. package/config/customize.sh +143 -0
  2. package/config/kortix-env-setup.sh +25 -0
  3. package/kortix-master/package.json +22 -0
  4. package/kortix-master/src/config.ts +22 -0
  5. package/kortix-master/src/index.ts +44 -0
  6. package/kortix-master/src/routes/env.ts +65 -0
  7. package/kortix-master/src/routes/proxy.ts +108 -0
  8. package/kortix-master/src/routes/update.ts +185 -0
  9. package/kortix-master/src/services/proxy.ts +43 -0
  10. package/kortix-master/src/services/secret-store.ts +156 -0
  11. package/kortix-master/tsconfig.json +14 -0
  12. package/opencode/agents/kortix-browser.md +142 -0
  13. package/opencode/agents/kortix-build.md +62 -0
  14. package/opencode/agents/kortix-explore.md +66 -0
  15. package/opencode/agents/kortix-image-gen.md +33 -0
  16. package/opencode/agents/kortix-main.md +450 -0
  17. package/opencode/agents/kortix-plan.md +100 -0
  18. package/opencode/agents/kortix-research.md +84 -0
  19. package/opencode/agents/kortix-sheets.md +61 -0
  20. package/opencode/agents/kortix-slides.md +64 -0
  21. package/opencode/agents/kortix-web-dev.md +572 -0
  22. package/opencode/commands/email.md +36 -0
  23. package/opencode/commands/init.md +43 -0
  24. package/opencode/commands/journal.md +44 -0
  25. package/opencode/commands/memory-init.md +81 -0
  26. package/opencode/commands/memory-search.md +50 -0
  27. package/opencode/commands/memory-status.md +56 -0
  28. package/opencode/commands/research.md +36 -0
  29. package/opencode/commands/search.md +38 -0
  30. package/opencode/commands/slides.md +32 -0
  31. package/opencode/commands/spreadsheet.md +30 -0
  32. package/opencode/memory.json +37 -0
  33. package/opencode/ocx.jsonc +10 -0
  34. package/opencode/opencode.jsonc +103 -0
  35. package/opencode/package.json +25 -0
  36. package/opencode/patches/apply.sh +19 -0
  37. package/opencode/patches/opencode-pty-spawn.txt +49 -0
  38. package/opencode/plugin/background-agents.ts.disabled +483 -0
  39. package/opencode/plugin/kdco-primitives/get-project-id.ts +172 -0
  40. package/opencode/plugin/kdco-primitives/index.ts +26 -0
  41. package/opencode/plugin/kdco-primitives/log-warn.ts +51 -0
  42. package/opencode/plugin/kdco-primitives/mutex.ts +122 -0
  43. package/opencode/plugin/kdco-primitives/shell.ts +138 -0
  44. package/opencode/plugin/kdco-primitives/temp.ts +36 -0
  45. package/opencode/plugin/kdco-primitives/terminal-detect.ts +34 -0
  46. package/opencode/plugin/kdco-primitives/types.ts +13 -0
  47. package/opencode/plugin/kdco-primitives/with-timeout.ts +84 -0
  48. package/opencode/plugin/memory.ts +306 -0
  49. package/opencode/plugin/worktree/state.ts +412 -0
  50. package/opencode/plugin/worktree/terminal.ts +1002 -0
  51. package/opencode/plugin/worktree.ts +861 -0
  52. package/opencode/skills/KORTIX-browser/SKILL.md +478 -0
  53. package/opencode/skills/KORTIX-cron-triggers/SKILL.md +173 -0
  54. package/opencode/skills/KORTIX-deep-research/SKILL.md +278 -0
  55. package/opencode/skills/KORTIX-docx/SKILL.md +398 -0
  56. package/opencode/skills/KORTIX-docx/scripts/__init__.py +1 -0
  57. package/opencode/skills/KORTIX-docx/scripts/accept_changes.py +104 -0
  58. package/opencode/skills/KORTIX-docx/scripts/comment.py +244 -0
  59. package/opencode/skills/KORTIX-docx/scripts/office/helpers/__init__.py +0 -0
  60. package/opencode/skills/KORTIX-docx/scripts/office/helpers/merge_runs.py +199 -0
  61. package/opencode/skills/KORTIX-docx/scripts/office/helpers/simplify_redlines.py +197 -0
  62. package/opencode/skills/KORTIX-docx/scripts/office/pack.py +159 -0
  63. package/opencode/skills/KORTIX-docx/scripts/office/soffice.py +183 -0
  64. package/opencode/skills/KORTIX-docx/scripts/office/unpack.py +132 -0
  65. package/opencode/skills/KORTIX-docx/scripts/office/validate.py +111 -0
  66. package/opencode/skills/KORTIX-docx/scripts/office/validators/__init__.py +15 -0
  67. package/opencode/skills/KORTIX-docx/scripts/office/validators/base.py +847 -0
  68. package/opencode/skills/KORTIX-docx/scripts/office/validators/docx.py +446 -0
  69. package/opencode/skills/KORTIX-docx/scripts/office/validators/pptx.py +275 -0
  70. package/opencode/skills/KORTIX-docx/scripts/office/validators/redlining.py +247 -0
  71. package/opencode/skills/KORTIX-docx/scripts/render_docx.py +179 -0
  72. package/opencode/skills/KORTIX-docx/scripts/templates/comments.xml +3 -0
  73. package/opencode/skills/KORTIX-docx/scripts/templates/commentsExtended.xml +3 -0
  74. package/opencode/skills/KORTIX-docx/scripts/templates/commentsExtensible.xml +3 -0
  75. package/opencode/skills/KORTIX-docx/scripts/templates/commentsIds.xml +3 -0
  76. package/opencode/skills/KORTIX-docx/scripts/templates/people.xml +3 -0
  77. package/opencode/skills/KORTIX-domain-research/SKILL.md +96 -0
  78. package/opencode/skills/KORTIX-domain-research/scripts/domain-lookup.py +810 -0
  79. package/opencode/skills/KORTIX-elevenlabs/SKILL.md +230 -0
  80. package/opencode/skills/KORTIX-elevenlabs/scripts/tts.py +389 -0
  81. package/opencode/skills/KORTIX-email/SKILL.md +145 -0
  82. package/opencode/skills/KORTIX-legal-writer/SKILL.md +409 -0
  83. package/opencode/skills/KORTIX-legal-writer/references/bluebook.md +152 -0
  84. package/opencode/skills/KORTIX-legal-writer/references/document-types.md +416 -0
  85. package/opencode/skills/KORTIX-legal-writer/scripts/courtlistener.py +291 -0
  86. package/opencode/skills/KORTIX-legal-writer/scripts/ecfr_lookup.py +299 -0
  87. package/opencode/skills/KORTIX-legal-writer/scripts/verify-legal.py +507 -0
  88. package/opencode/skills/KORTIX-logo-creator/SKILL.md +293 -0
  89. package/opencode/skills/KORTIX-logo-creator/references/prompt-patterns.md +134 -0
  90. package/opencode/skills/KORTIX-logo-creator/scripts/compose_logo.py +406 -0
  91. package/opencode/skills/KORTIX-logo-creator/scripts/create_logo_sheet.py +258 -0
  92. package/opencode/skills/KORTIX-logo-creator/scripts/remove_bg.py +96 -0
  93. package/opencode/skills/KORTIX-memory/SKILL.md +261 -0
  94. package/opencode/skills/KORTIX-memory/scripts/export-sessions.py +409 -0
  95. package/opencode/skills/KORTIX-paper-creator/SKILL.md +549 -0
  96. package/opencode/skills/KORTIX-paper-creator/assets/template.tex +101 -0
  97. package/opencode/skills/KORTIX-paper-creator/scripts/compile.sh +177 -0
  98. package/opencode/skills/KORTIX-paper-creator/scripts/openalex_to_bibtex.py +220 -0
  99. package/opencode/skills/KORTIX-paper-creator/scripts/verify.sh +354 -0
  100. package/opencode/skills/KORTIX-paper-search/SKILL.md +418 -0
  101. package/opencode/skills/KORTIX-pdf/SKILL.md +232 -0
  102. package/opencode/skills/KORTIX-pdf/forms.md +36 -0
  103. package/opencode/skills/KORTIX-pdf/reference.md +105 -0
  104. package/opencode/skills/KORTIX-pdf/scripts/check_bounding_boxes.py +65 -0
  105. package/opencode/skills/KORTIX-pdf/scripts/check_fillable_fields.py +11 -0
  106. package/opencode/skills/KORTIX-pdf/scripts/convert_pdf_to_images.py +33 -0
  107. package/opencode/skills/KORTIX-pdf/scripts/create_validation_image.py +37 -0
  108. package/opencode/skills/KORTIX-pdf/scripts/extract_form_field_info.py +122 -0
  109. package/opencode/skills/KORTIX-pdf/scripts/extract_form_structure.py +115 -0
  110. package/opencode/skills/KORTIX-pdf/scripts/fill_fillable_fields.py +98 -0
  111. package/opencode/skills/KORTIX-pdf/scripts/fill_pdf_form_with_annotations.py +107 -0
  112. package/opencode/skills/KORTIX-plan/SKILL.md +228 -0
  113. package/opencode/skills/KORTIX-presentation-viewer/SKILL.md +87 -0
  114. package/opencode/skills/KORTIX-presentation-viewer/serve.ts +136 -0
  115. package/opencode/skills/KORTIX-presentation-viewer/viewer.html +559 -0
  116. package/opencode/skills/KORTIX-presentations/SKILL.md +344 -0
  117. package/opencode/skills/KORTIX-remotion/SKILL.md +56 -0
  118. package/opencode/skills/KORTIX-remotion/rules/3d.md +86 -0
  119. package/opencode/skills/KORTIX-remotion/rules/animations.md +29 -0
  120. package/opencode/skills/KORTIX-remotion/rules/assets.md +78 -0
  121. package/opencode/skills/KORTIX-remotion/rules/audio-visualization.md +198 -0
  122. package/opencode/skills/KORTIX-remotion/rules/audio.md +169 -0
  123. package/opencode/skills/KORTIX-remotion/rules/calculate-metadata.md +104 -0
  124. package/opencode/skills/KORTIX-remotion/rules/can-decode.md +75 -0
  125. package/opencode/skills/KORTIX-remotion/rules/charts.md +120 -0
  126. package/opencode/skills/KORTIX-remotion/rules/compositions.md +141 -0
  127. package/opencode/skills/KORTIX-remotion/rules/display-captions.md +184 -0
  128. package/opencode/skills/KORTIX-remotion/rules/extract-frames.md +229 -0
  129. package/opencode/skills/KORTIX-remotion/rules/ffmpeg.md +38 -0
  130. package/opencode/skills/KORTIX-remotion/rules/fonts.md +152 -0
  131. package/opencode/skills/KORTIX-remotion/rules/get-audio-duration.md +58 -0
  132. package/opencode/skills/KORTIX-remotion/rules/get-video-dimensions.md +68 -0
  133. package/opencode/skills/KORTIX-remotion/rules/get-video-duration.md +58 -0
  134. package/opencode/skills/KORTIX-remotion/rules/gifs.md +141 -0
  135. package/opencode/skills/KORTIX-remotion/rules/images.md +130 -0
  136. package/opencode/skills/KORTIX-remotion/rules/import-srt-captions.md +69 -0
  137. package/opencode/skills/KORTIX-remotion/rules/light-leaks.md +73 -0
  138. package/opencode/skills/KORTIX-remotion/rules/lottie.md +68 -0
  139. package/opencode/skills/KORTIX-remotion/rules/maps.md +401 -0
  140. package/opencode/skills/KORTIX-remotion/rules/measuring-dom-nodes.md +35 -0
  141. package/opencode/skills/KORTIX-remotion/rules/measuring-text.md +143 -0
  142. package/opencode/skills/KORTIX-remotion/rules/parameters.md +98 -0
  143. package/opencode/skills/KORTIX-remotion/rules/sequencing.md +118 -0
  144. package/opencode/skills/KORTIX-remotion/rules/subtitles.md +36 -0
  145. package/opencode/skills/KORTIX-remotion/rules/tailwind.md +11 -0
  146. package/opencode/skills/KORTIX-remotion/rules/text-animations.md +20 -0
  147. package/opencode/skills/KORTIX-remotion/rules/timing.md +179 -0
  148. package/opencode/skills/KORTIX-remotion/rules/transcribe-captions.md +70 -0
  149. package/opencode/skills/KORTIX-remotion/rules/transitions.md +197 -0
  150. package/opencode/skills/KORTIX-remotion/rules/transparent-videos.md +106 -0
  151. package/opencode/skills/KORTIX-remotion/rules/trimming.md +53 -0
  152. package/opencode/skills/KORTIX-remotion/rules/videos.md +171 -0
  153. package/opencode/skills/KORTIX-secrets/SKILL.md +280 -0
  154. package/opencode/skills/KORTIX-semantic-search/SKILL.md +213 -0
  155. package/opencode/skills/KORTIX-session-search/SKILL.md +807 -0
  156. package/opencode/skills/KORTIX-session-search/Untitled +1 -0
  157. package/opencode/skills/KORTIX-skill-creator/SKILL.md +163 -0
  158. package/opencode/skills/KORTIX-web-research/SKILL.md +69 -0
  159. package/opencode/skills/KORTIX-xlsx/LICENSE.txt +30 -0
  160. package/opencode/skills/KORTIX-xlsx/SKILL.md +549 -0
  161. package/opencode/skills/KORTIX-xlsx/scripts/office/helpers/__init__.py +0 -0
  162. package/opencode/skills/KORTIX-xlsx/scripts/office/helpers/merge_runs.py +199 -0
  163. package/opencode/skills/KORTIX-xlsx/scripts/office/helpers/simplify_redlines.py +197 -0
  164. package/opencode/skills/KORTIX-xlsx/scripts/office/pack.py +159 -0
  165. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  166. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  167. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  168. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  169. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  170. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  171. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  172. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  173. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  174. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  175. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  176. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  177. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  178. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  179. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  180. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  181. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  182. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  183. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  184. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  185. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  186. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  187. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  188. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  189. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  190. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  191. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  192. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  193. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  194. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  195. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  196. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/mce/mc.xsd +75 -0
  197. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
  198. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
  199. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
  200. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
  201. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
  202. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  203. package/opencode/skills/KORTIX-xlsx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
  204. package/opencode/skills/KORTIX-xlsx/scripts/office/soffice.py +183 -0
  205. package/opencode/skills/KORTIX-xlsx/scripts/office/unpack.py +132 -0
  206. package/opencode/skills/KORTIX-xlsx/scripts/office/validate.py +111 -0
  207. package/opencode/skills/KORTIX-xlsx/scripts/office/validators/__init__.py +15 -0
  208. package/opencode/skills/KORTIX-xlsx/scripts/office/validators/base.py +847 -0
  209. package/opencode/skills/KORTIX-xlsx/scripts/office/validators/docx.py +446 -0
  210. package/opencode/skills/KORTIX-xlsx/scripts/office/validators/pptx.py +275 -0
  211. package/opencode/skills/KORTIX-xlsx/scripts/office/validators/redlining.py +247 -0
  212. package/opencode/skills/KORTIX-xlsx/scripts/recalc.py +184 -0
  213. package/opencode/tools/image-gen.ts +342 -0
  214. package/opencode/tools/image-search.ts +190 -0
  215. package/opencode/tools/memory-get.ts +168 -0
  216. package/opencode/tools/memory-search.ts +247 -0
  217. package/opencode/tools/presentation-gen.ts +723 -0
  218. package/opencode/tools/scrape-webpage.ts +115 -0
  219. package/opencode/tools/scripts/.python-version +1 -0
  220. package/opencode/tools/scripts/convert_pdf.py +184 -0
  221. package/opencode/tools/scripts/convert_pptx.py +562 -0
  222. package/opencode/tools/scripts/pyproject.toml +11 -0
  223. package/opencode/tools/scripts/uv.lock +287 -0
  224. package/opencode/tools/scripts/validate_slide.py +74 -0
  225. package/opencode/tools/show-user.ts +217 -0
  226. package/opencode/tools/tests/e2e-presentation-fix.ts +277 -0
  227. package/opencode/tools/tests/image-gen.test.ts +215 -0
  228. package/opencode/tools/tests/image-search.test.ts +125 -0
  229. package/opencode/tools/tests/memory-system-benchmark.ts +1076 -0
  230. package/opencode/tools/tests/presentation-gen.test.ts +389 -0
  231. package/opencode/tools/tests/scrape-webpage.test.ts +74 -0
  232. package/opencode/tools/tests/show-user.test.ts +241 -0
  233. package/opencode/tools/tests/video-gen.test.ts +110 -0
  234. package/opencode/tools/tests/web-search.test.ts +106 -0
  235. package/opencode/tools/video-gen.ts +200 -0
  236. package/opencode/tools/web-search.ts +153 -0
  237. package/opencode/tsconfig.json +29 -0
  238. package/package.json +36 -0
  239. package/patch-agent-browser.js +100 -0
  240. package/postinstall.sh +88 -0
  241. package/services/KORTIX-presentation-viewer/run +37 -0
  242. package/services/agent-browser-viewer/run +48 -0
  243. package/services/kortix-master/run +16 -0
  244. package/services/lss-sync/run +22 -0
  245. package/services/opencode-serve/run +25 -0
  246. package/services/opencode-web/run +21 -0
@@ -0,0 +1,73 @@
1
+ ---
2
+ name: light-leaks
3
+ description: Light leak overlay effects for Remotion using @remotion/light-leaks.
4
+ metadata:
5
+ tags: light-leaks, overlays, effects, transitions
6
+ ---
7
+
8
+ ## Light Leaks
9
+
10
+ This only works from Remotion 4.0.415 and up. Use `npx remotion versions` to check your Remotion version and `npx remotion upgrade` to upgrade your Remotion version.
11
+
12
+ `<LightLeak>` from `@remotion/light-leaks` renders a WebGL-based light leak effect. It reveals during the first half of its duration and retracts during the second half.
13
+
14
+ Typically used inside a `<TransitionSeries.Overlay>` to play over the cut point between two scenes. See the **transitions** rule for `<TransitionSeries>` and overlay usage.
15
+
16
+ ## Prerequisites
17
+
18
+ ```bash
19
+ npx remotion add @remotion/light-leaks
20
+ ```
21
+
22
+ ## Basic usage with TransitionSeries
23
+
24
+ ```tsx
25
+ import { TransitionSeries } from "@remotion/transitions";
26
+ import { LightLeak } from "@remotion/light-leaks";
27
+
28
+ <TransitionSeries>
29
+ <TransitionSeries.Sequence durationInFrames={60}>
30
+ <SceneA />
31
+ </TransitionSeries.Sequence>
32
+ <TransitionSeries.Overlay durationInFrames={30}>
33
+ <LightLeak />
34
+ </TransitionSeries.Overlay>
35
+ <TransitionSeries.Sequence durationInFrames={60}>
36
+ <SceneB />
37
+ </TransitionSeries.Sequence>
38
+ </TransitionSeries>;
39
+ ```
40
+
41
+ ## Props
42
+
43
+ - `durationInFrames?` — defaults to the parent sequence/composition duration. The effect reveals during the first half and retracts during the second half.
44
+ - `seed?` — determines the shape of the light leak pattern. Different seeds produce different patterns. Default: `0`.
45
+ - `hueShift?` — rotates the hue in degrees (`0`–`360`). Default: `0` (yellow-to-orange). `120` = green, `240` = blue.
46
+
47
+ ## Customizing the look
48
+
49
+ ```tsx
50
+ import { LightLeak } from "@remotion/light-leaks";
51
+
52
+ // Blue-tinted light leak with a different pattern
53
+ <LightLeak seed={5} hueShift={240} />;
54
+
55
+ // Green-tinted light leak
56
+ <LightLeak seed={2} hueShift={120} />;
57
+ ```
58
+
59
+ ## Standalone usage
60
+
61
+ `<LightLeak>` can also be used outside of `<TransitionSeries>`, for example as a decorative overlay in any composition:
62
+
63
+ ```tsx
64
+ import { AbsoluteFill } from "remotion";
65
+ import { LightLeak } from "@remotion/light-leaks";
66
+
67
+ const MyComp: React.FC = () => (
68
+ <AbsoluteFill>
69
+ <MyContent />
70
+ <LightLeak durationInFrames={60} seed={3} />
71
+ </AbsoluteFill>
72
+ );
73
+ ```
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: lottie
3
+ description: Embedding Lottie animations in Remotion.
4
+ metadata:
5
+ category: Animation
6
+ ---
7
+
8
+ # Using Lottie Animations in Remotion
9
+
10
+ ## Prerequisites
11
+
12
+ First, the @remotion/lottie package needs to be installed.
13
+ If it is not, use the following command:
14
+
15
+ ```bash
16
+ npx remotion add @remotion/lottie # If project uses npm
17
+ bunx remotion add @remotion/lottie # If project uses bun
18
+ yarn remotion add @remotion/lottie # If project uses yarn
19
+ pnpm exec remotion add @remotion/lottie # If project uses pnpm
20
+ ```
21
+
22
+ ## Displaying a Lottie file
23
+
24
+ To import a Lottie animation:
25
+
26
+ - Fetch the Lottie asset
27
+ - Wrap the loading process in `delayRender()` and `continueRender()`
28
+ - Save the animation data in a state
29
+ - Render the Lottie animation using the `Lottie` component from the `@remotion/lottie` package
30
+
31
+ ```tsx
32
+ import {Lottie, LottieAnimationData} from '@remotion/lottie';
33
+ import {useEffect, useState} from 'react';
34
+ import {cancelRender, continueRender, delayRender} from 'remotion';
35
+
36
+ export const MyAnimation = () => {
37
+ const [handle] = useState(() => delayRender('Loading Lottie animation'));
38
+
39
+ const [animationData, setAnimationData] = useState<LottieAnimationData | null>(null);
40
+
41
+ useEffect(() => {
42
+ fetch('https://assets4.lottiefiles.com/packages/lf20_zyquagfl.json')
43
+ .then((data) => data.json())
44
+ .then((json) => {
45
+ setAnimationData(json);
46
+ continueRender(handle);
47
+ })
48
+ .catch((err) => {
49
+ cancelRender(err);
50
+ });
51
+ }, [handle]);
52
+
53
+ if (!animationData) {
54
+ return null;
55
+ }
56
+
57
+ return <Lottie animationData={animationData} />;
58
+ };
59
+ ```
60
+
61
+ ## Styling and animating
62
+
63
+ Lottie supports the `style` prop to allow styles and animations:
64
+
65
+ ```tsx
66
+ return <Lottie animationData={animationData} style={{width: 400, height: 400}} />;
67
+ ```
68
+
@@ -0,0 +1,401 @@
1
+ ---
2
+ name: maps
3
+ description: Make map animations with Mapbox
4
+ metadata:
5
+ tags: map, map animation, mapbox
6
+ ---
7
+
8
+ Maps can be added to a Remotion video with Mapbox.
9
+ The [Mapbox documentation](https://docs.mapbox.com/mapbox-gl-js/api/) has the API reference.
10
+
11
+ ## Prerequisites
12
+
13
+ Mapbox and `@turf/turf` need to be installed.
14
+
15
+ Search the project for lockfiles and run the correct command depending on the package manager:
16
+
17
+ If `package-lock.json` is found, use the following command:
18
+
19
+ ```bash
20
+ npm i mapbox-gl @turf/turf @types/mapbox-gl
21
+ ```
22
+
23
+ If `bun.lock` is found, use the following command:
24
+
25
+ ```bash
26
+ bun i mapbox-gl @turf/turf @types/mapbox-gl
27
+ ```
28
+
29
+ If `yarn.lock` is found, use the following command:
30
+
31
+ ```bash
32
+ yarn add mapbox-gl @turf/turf @types/mapbox-gl
33
+ ```
34
+
35
+ If `pnpm-lock.yaml` is found, use the following command:
36
+
37
+ ```bash
38
+ pnpm i mapbox-gl @turf/turf @types/mapbox-gl
39
+ ```
40
+
41
+ The user needs to create a free Mapbox account and create an access token by visiting https://console.mapbox.com/account/access-tokens/.
42
+
43
+ The mapbox token needs to be added to the `.env` file:
44
+
45
+ ```txt title=".env"
46
+ REMOTION_MAPBOX_TOKEN==pk.your-mapbox-access-token
47
+ ```
48
+
49
+ ## Adding a map
50
+
51
+ Here is a basic example of a map in Remotion.
52
+
53
+ ```tsx
54
+ import {useEffect, useMemo, useRef, useState} from 'react';
55
+ import {AbsoluteFill, useDelayRender, useVideoConfig} from 'remotion';
56
+ import mapboxgl, {Map} from 'mapbox-gl';
57
+
58
+ export const lineCoordinates = [
59
+ [6.56158447265625, 46.059891147620725],
60
+ [6.5691375732421875, 46.05679376154153],
61
+ [6.5842437744140625, 46.05059898938315],
62
+ [6.594886779785156, 46.04702502069337],
63
+ [6.601066589355469, 46.0460718554722],
64
+ [6.6089630126953125, 46.0365370783104],
65
+ [6.6185760498046875, 46.018420689207964],
66
+ ];
67
+
68
+ mapboxgl.accessToken = process.env.REMOTION_MAPBOX_TOKEN as string;
69
+
70
+ export const MyComposition = () => {
71
+ const ref = useRef<HTMLDivElement>(null);
72
+ const {delayRender, continueRender} = useDelayRender();
73
+
74
+ const {width, height} = useVideoConfig();
75
+ const [handle] = useState(() => delayRender('Loading map...'));
76
+ const [map, setMap] = useState<Map | null>(null);
77
+
78
+ useEffect(() => {
79
+ const _map = new Map({
80
+ container: ref.current!,
81
+ zoom: 11.53,
82
+ center: [6.5615, 46.0598],
83
+ pitch: 65,
84
+ bearing: 0,
85
+ style: '⁠mapbox://styles/mapbox/standard',
86
+ interactive: false,
87
+ fadeDuration: 0,
88
+ });
89
+
90
+ _map.on('style.load', () => {
91
+ // Hide all features from the Mapbox Standard style
92
+ const hideFeatures = [
93
+ 'showRoadsAndTransit',
94
+ 'showRoads',
95
+ 'showTransit',
96
+ 'showPedestrianRoads',
97
+ 'showRoadLabels',
98
+ 'showTransitLabels',
99
+ 'showPlaceLabels',
100
+ 'showPointOfInterestLabels',
101
+ 'showPointsOfInterest',
102
+ 'showAdminBoundaries',
103
+ 'showLandmarkIcons',
104
+ 'showLandmarkIconLabels',
105
+ 'show3dObjects',
106
+ 'show3dBuildings',
107
+ 'show3dTrees',
108
+ 'show3dLandmarks',
109
+ 'show3dFacades',
110
+ ];
111
+ for (const feature of hideFeatures) {
112
+ _map.setConfigProperty('basemap', feature, false);
113
+ }
114
+
115
+ _map.setConfigProperty('basemap', 'colorTrunks', 'rgba(0, 0, 0, 0)');
116
+
117
+ _map.addSource('trace', {
118
+ type: 'geojson',
119
+ data: {
120
+ type: 'Feature',
121
+ properties: {},
122
+ geometry: {
123
+ type: 'LineString',
124
+ coordinates: lineCoordinates,
125
+ },
126
+ },
127
+ });
128
+ _map.addLayer({
129
+ type: 'line',
130
+ source: 'trace',
131
+ id: 'line',
132
+ paint: {
133
+ 'line-color': 'black',
134
+ 'line-width': 5,
135
+ },
136
+ layout: {
137
+ 'line-cap': 'round',
138
+ 'line-join': 'round',
139
+ },
140
+ });
141
+ });
142
+
143
+ _map.on('load', () => {
144
+ continueRender(handle);
145
+ setMap(_map);
146
+ });
147
+ }, [handle, lineCoordinates]);
148
+
149
+ const style: React.CSSProperties = useMemo(() => ({width, height, position: 'absolute'}), [width, height]);
150
+
151
+ return <AbsoluteFill ref={ref} style={style} />;
152
+ };
153
+ ```
154
+
155
+ The following is important in Remotion:
156
+
157
+ - Animations must be driven by `useCurrentFrame()` and animations that Mapbox brings itself should be disabled. For example, the `fadeDuration` prop should be set to `0`, `interactive` should be set to `false`, etc.
158
+ - Loading the map should be delayed using `useDelayRender()` and the map should be set to `null` until it is loaded.
159
+ - The element containing the ref MUST have an explicit width and height and `position: "absolute"`.
160
+ - Do not add a `_map.remove();` cleanup function.
161
+
162
+ ## Drawing lines
163
+
164
+ Unless I request it, do not add a glow effect to the lines.
165
+ Unless I request it, do not add additional points to the lines.
166
+
167
+ ## Map style
168
+
169
+ By default, use the `mapbox://styles/mapbox/standard` style.
170
+ Hide the labels from the base map style.
171
+
172
+ Unless I request otherwise, remove all features from the Mapbox Standard style.
173
+
174
+ ```tsx
175
+ // Hide all features from the Mapbox Standard style
176
+ const hideFeatures = [
177
+ 'showRoadsAndTransit',
178
+ 'showRoads',
179
+ 'showTransit',
180
+ 'showPedestrianRoads',
181
+ 'showRoadLabels',
182
+ 'showTransitLabels',
183
+ 'showPlaceLabels',
184
+ 'showPointOfInterestLabels',
185
+ 'showPointsOfInterest',
186
+ 'showAdminBoundaries',
187
+ 'showLandmarkIcons',
188
+ 'showLandmarkIconLabels',
189
+ 'show3dObjects',
190
+ 'show3dBuildings',
191
+ 'show3dTrees',
192
+ 'show3dLandmarks',
193
+ 'show3dFacades',
194
+ ];
195
+ for (const feature of hideFeatures) {
196
+ _map.setConfigProperty('basemap', feature, false);
197
+ }
198
+
199
+ _map.setConfigProperty('basemap', 'colorMotorways', 'transparent');
200
+ _map.setConfigProperty('basemap', 'colorRoads', 'transparent');
201
+ _map.setConfigProperty('basemap', 'colorTrunks', 'transparent');
202
+ ```
203
+
204
+ ## Animating the camera
205
+
206
+ You can animate the camera along the line by adding a `useEffect` hook that updates the camera position based on the current frame.
207
+
208
+ Unless I ask for it, do not jump between camera angles.
209
+
210
+ ```tsx
211
+ import * as turf from '@turf/turf';
212
+ import {interpolate} from 'remotion';
213
+ import {Easing} from 'remotion';
214
+ import {useCurrentFrame, useVideoConfig, useDelayRender} from 'remotion';
215
+
216
+ const animationDuration = 20;
217
+ const cameraAltitude = 4000;
218
+ ```
219
+
220
+ ```tsx
221
+ const frame = useCurrentFrame();
222
+ const {fps} = useVideoConfig();
223
+ const {delayRender, continueRender} = useDelayRender();
224
+
225
+ useEffect(() => {
226
+ if (!map) {
227
+ return;
228
+ }
229
+ const handle = delayRender('Moving point...');
230
+
231
+ const routeDistance = turf.length(turf.lineString(lineCoordinates));
232
+
233
+ const progress = interpolate(frame / fps, [0.00001, animationDuration], [0, 1], {
234
+ easing: Easing.inOut(Easing.sin),
235
+ extrapolateLeft: 'clamp',
236
+ extrapolateRight: 'clamp',
237
+ });
238
+
239
+ const camera = map.getFreeCameraOptions();
240
+
241
+ const alongRoute = turf.along(turf.lineString(lineCoordinates), routeDistance * progress).geometry.coordinates;
242
+
243
+ camera.lookAtPoint({
244
+ lng: alongRoute[0],
245
+ lat: alongRoute[1],
246
+ });
247
+
248
+ map.setFreeCameraOptions(camera);
249
+ map.once('idle', () => continueRender(handle));
250
+ }, [lineCoordinates, fps, frame, handle, map]);
251
+ ```
252
+
253
+ Notes:
254
+
255
+ IMPORTANT: Keep the camera by default so north is up.
256
+ IMPORTANT: For multi-step animations, set all properties at all stages (zoom, position, line progress) to prevent jumps. Override initial values.
257
+
258
+ - The progress is clamped to a minimum value to avoid the line being empty, which can lead to turf errors
259
+ - See [Timing](./timing.md) for more options for timing.
260
+ - Consider the dimensions of the composition and make the lines thick enough and the label font size large enough to be legible for when the composition is scaled down.
261
+
262
+ ## Animating lines
263
+
264
+ ### Straight lines (linear interpolation)
265
+
266
+ To animate a line that appears straight on the map, use linear interpolation between coordinates. Do NOT use turf's `lineSliceAlong` or `along` functions, as they use geodesic (great circle) calculations which appear curved on a Mercator projection.
267
+
268
+ ```tsx
269
+ const frame = useCurrentFrame();
270
+ const {durationInFrames} = useVideoConfig();
271
+
272
+ useEffect(() => {
273
+ if (!map) return;
274
+
275
+ const animationHandle = delayRender('Animating line...');
276
+
277
+ const progress = interpolate(frame, [0, durationInFrames - 1], [0, 1], {
278
+ extrapolateLeft: 'clamp',
279
+ extrapolateRight: 'clamp',
280
+ easing: Easing.inOut(Easing.cubic),
281
+ });
282
+
283
+ // Linear interpolation for a straight line on the map
284
+ const start = lineCoordinates[0];
285
+ const end = lineCoordinates[1];
286
+ const currentLng = start[0] + (end[0] - start[0]) * progress;
287
+ const currentLat = start[1] + (end[1] - start[1]) * progress;
288
+
289
+ const lineData: GeoJSON.Feature<GeoJSON.LineString> = {
290
+ type: 'Feature',
291
+ properties: {},
292
+ geometry: {
293
+ type: 'LineString',
294
+ coordinates: [start, [currentLng, currentLat]],
295
+ },
296
+ };
297
+
298
+ const source = map.getSource('trace') as mapboxgl.GeoJSONSource;
299
+ if (source) {
300
+ source.setData(lineData);
301
+ }
302
+
303
+ map.once('idle', () => continueRender(animationHandle));
304
+ }, [frame, map, durationInFrames]);
305
+ ```
306
+
307
+ ### Curved lines (geodesic/great circle)
308
+
309
+ To animate a line that follows the geodesic (great circle) path between two points, use turf's `lineSliceAlong`. This is useful for showing flight paths or the actual shortest distance on Earth.
310
+
311
+ ```tsx
312
+ import * as turf from '@turf/turf';
313
+
314
+ const routeLine = turf.lineString(lineCoordinates);
315
+ const routeDistance = turf.length(routeLine);
316
+
317
+ const currentDistance = Math.max(0.001, routeDistance * progress);
318
+ const slicedLine = turf.lineSliceAlong(routeLine, 0, currentDistance);
319
+
320
+ const source = map.getSource('route') as mapboxgl.GeoJSONSource;
321
+ if (source) {
322
+ source.setData(slicedLine);
323
+ }
324
+ ```
325
+
326
+ ## Markers
327
+
328
+ Add labels, and markers where appropriate.
329
+
330
+ ```tsx
331
+ _map.addSource('markers', {
332
+ type: 'geojson',
333
+ data: {
334
+ type: 'FeatureCollection',
335
+ features: [
336
+ {
337
+ type: 'Feature',
338
+ properties: {name: 'Point 1'},
339
+ geometry: {type: 'Point', coordinates: [-118.2437, 34.0522]},
340
+ },
341
+ ],
342
+ },
343
+ });
344
+
345
+ _map.addLayer({
346
+ id: 'city-markers',
347
+ type: 'circle',
348
+ source: 'markers',
349
+ paint: {
350
+ 'circle-radius': 40,
351
+ 'circle-color': '#FF4444',
352
+ 'circle-stroke-width': 4,
353
+ 'circle-stroke-color': '#FFFFFF',
354
+ },
355
+ });
356
+
357
+ _map.addLayer({
358
+ id: 'labels',
359
+ type: 'symbol',
360
+ source: 'markers',
361
+ layout: {
362
+ 'text-field': ['get', 'name'],
363
+ 'text-font': ['DIN Pro Bold', 'Arial Unicode MS Bold'],
364
+ 'text-size': 50,
365
+ 'text-offset': [0, 0.5],
366
+ 'text-anchor': 'top',
367
+ },
368
+ paint: {
369
+ 'text-color': '#FFFFFF',
370
+ 'text-halo-color': '#000000',
371
+ 'text-halo-width': 2,
372
+ },
373
+ });
374
+ ```
375
+
376
+ Make sure they are big enough. Check the composition dimensions and scale the labels accordingly.
377
+ For a composition size of 1920x1080, the label font size should be at least 40px.
378
+
379
+ IMPORTANT: Keep the `text-offset` small enough so it is close to the marker. Consider the marker circle radius. For a circle radius of 40, this is a good offset:
380
+
381
+ ```tsx
382
+ "text-offset": [0, 0.5],
383
+ ```
384
+
385
+ ## 3D buildings
386
+
387
+ To enable 3D buildings, use the following code:
388
+
389
+ ```tsx
390
+ _map.setConfigProperty('basemap', 'show3dObjects', true);
391
+ _map.setConfigProperty('basemap', 'show3dLandmarks', true);
392
+ _map.setConfigProperty('basemap', 'show3dBuildings', true);
393
+ ```
394
+
395
+ ## Rendering
396
+
397
+ When rendering a map animation, make sure to render with the following flags:
398
+
399
+ ```
400
+ npx remotion render --gl=angle --concurrency=1
401
+ ```
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: measuring-dom-nodes
3
+ description: Measuring DOM element dimensions in Remotion
4
+ metadata:
5
+ tags: measure, layout, dimensions, getBoundingClientRect, scale
6
+ ---
7
+
8
+ # Measuring DOM nodes in Remotion
9
+
10
+ Remotion applies a `scale()` transform to the video container, which affects values from `getBoundingClientRect()`. Use `useCurrentScale()` to get correct measurements.
11
+
12
+ ## Measuring element dimensions
13
+
14
+ ```tsx
15
+ import { useCurrentScale } from "remotion";
16
+ import { useRef, useEffect, useState } from "react";
17
+
18
+ export const MyComponent = () => {
19
+ const ref = useRef<HTMLDivElement>(null);
20
+ const scale = useCurrentScale();
21
+ const [dimensions, setDimensions] = useState({ width: 0, height: 0 });
22
+
23
+ useEffect(() => {
24
+ if (!ref.current) return;
25
+ const rect = ref.current.getBoundingClientRect();
26
+ setDimensions({
27
+ width: rect.width / scale,
28
+ height: rect.height / scale,
29
+ });
30
+ }, [scale]);
31
+
32
+ return <div ref={ref}>Content to measure</div>;
33
+ };
34
+ ```
35
+