Production-ready animations, transitions, backgrounds, and scenes for Remotion
TypeScript ai-agentsclaude-codedemo-videomcpmcp-servermodel-context-protocolmotion-designproduct-demoreactremotionshadcnvideo
{
"type": "remotion-element",
"version": 1,
"element": {
"assets": [],
"dependencies": [
{
"name": "@paper-design/shaders-react",
"version": "0.0.76"
}
],
"dimensions": null,
"displayName": "Shader Gem Smoke",
"initialProps": null,
"slug": "shader-gem-smoke",
"sourceCode": "import { GemSmoke, type GemSmokeProps } from \"@paper-design/shaders-react\";\nimport React, { forwardRef, useCallback, useImperativeHandle, useRef, useState, type ComponentProps } from \"react\";\nimport { Interactive, Sequence, continueRender, delayRender, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\nconst NEUTRAL_COLORS = [\"#3a3a5c\", \"#52527a\"];\n\ninterface ShaderGemSmokeProps\n extends Omit<GemSmokeProps, \"frame\" | \"ref\"> {}\n\n/**\n * Paper's Gem Smoke shader, driven deterministically by the current frame.\n *\n * Animated color fields placed over a logo shape — smoke lives behind (and\n * inside) the glassy silhouette. Feed it a brand mark via `image` (a URL,\n * e.g. staticFile('prisma/symbol-light.svg')); the shape is processed once\n * and cached, so every frame renders the same smoke at the same time.\n */\nfunction ShaderGemSmokeBase({\n speed = 1,\n colors = NEUTRAL_COLORS,\n colorBack = \"#0a0a10\",\n innerDistortion = 0.8,\n outerDistortion = 0.6,\n outerGlow = 0.55,\n innerGlow = 1,\n size = 0.8,\n className,\n ...rest\n}: ShaderGemSmokeProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n\n const [handle] = useState(() => delayRender(\"shader-gem-smoke\"));\n const gate = useCallback(\n (element: HTMLDivElement | null) => {\n if (!element) return;\n requestAnimationFrame(() =>\n requestAnimationFrame(() => continueRender(handle)),\n );\n },\n [handle],\n );\n\n return (\n <div\n ref={gate}\n className={className}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <React.Suspense fallback={null}>\n <GemSmoke\n speed={0}\n frame={(frame / fps) * speed * 1000}\n colors={colors}\n colorBack={colorBack}\n innerDistortion={innerDistortion}\n outerDistortion={outerDistortion}\n outerGlow={outerGlow}\n innerGlow={innerGlow}\n size={size}\n fit=\"cover\"\n width={width}\n height={height}\n suspendWhenProcessingImage\n {...rest}\n />\n </React.Suspense>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n colorBack: {\n type: \"color\",\n default: \"#0a0a10\",\n description: \"Background\",\n },\n innerDistortion: {\n type: \"number\",\n min: 0,\n max: 2,\n step: 0.05,\n default: 0.8,\n description: \"Inner distortion\",\n hiddenFromList: false,\n },\n outerDistortion: {\n type: \"number\",\n min: 0,\n max: 2,\n step: 0.05,\n default: 0.6,\n description: \"Outer distortion\",\n hiddenFromList: false,\n },\n size: {\n type: \"number\",\n min: 0.2,\n max: 1.5,\n step: 0.05,\n default: 0.8,\n description: \"Size\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"speed\",\"colorBack\",\"innerDistortion\",\"outerDistortion\",\"size\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n speed: 1,\n colorBack: \"#0a0a10\",\n innerDistortion: 0.8,\n outerDistortion: 0.6,\n size: 0.8,\n};\n\ntype ShaderGemSmokeElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShaderGemSmokeBase>;\n\nconst ShaderGemSmokeInner = forwardRef<\n HTMLDivElement,\n ShaderGemSmokeElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ShaderGemSmoke>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ShaderGemSmokeBase\n {...(componentProps as unknown as ComponentProps<typeof ShaderGemSmokeBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShaderGemSmoke = Interactive.withSchema({\n Component: ShaderGemSmokeInner,\n componentName: \"<ShaderGemSmoke>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n",
"durationInFrames": 150,
"installationMode": "component-owned-sequence"
},
"durationInFrames": 150
}