Skip to main content
Glama
template.tsx.j22.93 kB
{/* chuk-motion/src/chuk_motion/components/layouts/DialogueFrame/template.tsx.j2 */} import React from 'react'; import { AbsoluteFill, useCurrentFrame } from 'remotion'; interface DialogueFrameProps { left_speaker?: React.ReactNode; right_speaker?: React.ReactNode; center_content?: React.ReactNode; startFrame: number; durationInFrames: number; speaker_size?: number; padding?: number; gap?: number; border_width?: number; border_color?: string; border_radius?: number; } export const DialogueFrame: React.FC<DialogueFrameProps> = ({ left_speaker, right_speaker, center_content, startFrame, durationInFrames, speaker_size = 40, padding = parseInt('[[ spacing.spacing.xl ]]'), gap = parseInt('[[ spacing.spacing.md ]]'), border_width, border_color = '[[ colors.border.light ]]', border_radius = parseInt('[[ spacing.border_radius.md ]]') }) => { const frame = useCurrentFrame(); if (frame < startFrame || frame >= startFrame + durationInFrames) { return null; } const center_size = 100 - (speaker_size * 2); return ( <AbsoluteFill style={{ pointerEvents: 'none' }}> <div style={{ position: 'absolute', top: padding, left: padding, right: padding, bottom: padding, display: 'flex', flexDirection: 'row', gap: gap, width: `calc(100% - ${padding * 2}px)`, height: `calc(100% - ${padding * 2}px)`, }} > {left_speaker && ( <div style={{ width: `${speaker_size}%`, height: '100%', display: 'flex', overflow: 'hidden', position: 'relative', ...(border_width && { border: `${border_width}px solid ${border_color}`, borderRadius: border_radius }), }}> {left_speaker} </div> )} {center_content && ( <div style={{ width: `${center_size}%`, height: '100%', display: 'flex', alignItems: 'center', justifyContent: 'center', overflow: 'hidden', position: 'relative', ...(border_width && { border: `${border_width}px solid ${border_color}`, borderRadius: border_radius }), }}> {center_content} </div> )} {right_speaker && ( <div style={{ width: `${speaker_size}%`, height: '100%', display: 'flex', overflow: 'hidden', position: 'relative', ...(border_width && { border: `${border_width}px solid ${border_color}`, borderRadius: border_radius }), }}> {right_speaker} </div> )} </div> </AbsoluteFill> ); };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/chrishayuk/chuk-mcp-remotion'

If you have feedback or need assistance with the MCP directory API, please join our Discord server