tim-hub/powerball-harness / .claude/skills/generate-video
generate-video
VerifiedGenerates product demo videos and release walkthroughs via Remotion. Use when creating video documentation or animated demos.
remotion/components/TransitionWrapper.tsx
View on GitHubimport React from 'react';
import { useCurrentFrame, useVideoConfig, interpolate, spring, Easing } from 'remotion';
/**
* TransitionWrapper Component
*
* Wraps children with transition effects using Remotion's interpolate and spring.
* Supports 4 transition types: fade, slide_in, zoom, cut.
*/
export type TransitionType = 'fade' | 'slide_in' | 'zoom' | 'cut';
export type SlideDirection = 'left' | 'right' | 'top' | 'bottom';
export type EasingType = 'linear' | 'easeIn' | 'easeOut' | 'easeInOut';
export interface TransitionWrapperProps {
/** Transition type */
type: TransitionType;
/** Duration of the transition in frames */
duration?: number;
/** Direction for slide_in transition */
direction?: SlideDirection;
/** Easing function for interpolation */
easing?: EasingType;
/** Use spring physics instead of interpolation */
useSpring?: boolean;
/** Spring configuration (when useSpring is true) */
springConfig?: {
damping?: number;
stiffness?: number;
mass?: number;
};
/** Delay before transition starts (frames) */
delay?: number;
/** Children to wrap with transition */
children: React.ReactNode;
/** Custom opacity range [from, to] */
opacityRange?: [number, number];
/** Custom scale range [from, to] for zoom */
scaleRange?: [number, number];
/** Custom slide distance in pixels */
slideDistance?: number;
}
const EASING_MAP: Record<EasingType, typeof Easing.linear> = {
linear: Easing.linear,
easeIn: Easing.in(Easing.ease),
easeOut: Easing.out(Easing.ease),
easeInOut: Easing.inOut(Easing.ease),
};
export const TransitionWrapper: React.FC<TransitionWrapperProps> = ({
type,
duration = 15,
direction = 'right',
easing = 'easeInOut',
useSpring: shouldUseSpring = false,
springConfig = {
damping: 200,
stiffness: 100,
mass: 1,
},
delay = 0,
children,
opacityRange = [0, 1],
scaleRange = [0.5, 1],
slideDistance = 100,
}) => {
const frame = useCurrentFrame();
const { fps, width, height } = useVideoConfig();
const relativeFrame = frame - delay;
// Calculate transition progress
let progress: number;
if (type === 'cut') {
// Instant cut (no animation)
progress = relativeFrame >= 0 ? 1 : 0;
} else if (shouldUseSpring) {
// Use spring physics
progress = spring({
frame: relativeFrame,
fps,
config: springConfig,
});
} else {
// Use interpolation with easing
progress = interpolate(
relativeFrame,
[0, duration],
[0, 1],
{
easing: EASING_MAP[easing],
extrapolateLeft: 'clamp',
extrapolateRight: 'clamp',
}
);
}
// Calculate transition properties based on type
const getTransitionStyle = (): React.CSSProperties => {
switch (type) {
case 'fade': {
const opacity = interpolate(
progress,
[0, 1],
opacityRange,
{ extrapolateLeft: 'clamp', extrapolateRight: 'clamp' }
);
return {
opacity,
};
}
case 'slide_in': {
const slideOffset = interpolate(
progress,
[0, 1],
[slideDistance, 0],
{ extrapolateLeft: 'clamp', extrapolateRight: 'clamp' }
);
let translateX = 0;
let translateY = 0;
switch (direction) {
case 'left':
translateX = slideOffset;
break;
case 'right':
translateX = -slideOffset;
break;
case 'top':
translateY = slideOffset;
break;
case 'bottom':
translateY = -slideOffset;
break;
}
const opacity = interpolate(
progress,
[0, 0.3, 1],
[0, 1, 1],
{ extrapolateLeft: 'clamp', extrapolateRight: 'clamp' }
);
return {
transform: `translate(${translateX}px, ${translateY}px)`,
opacity,
};
}
case 'zoom': {
const scale = interpolate(
progress,
[0, 1],
scaleRange,
{ extrapolateLeft: 'clamp', extrapolateRight: 'clamp' }
);
const opacity = interpolate(
progress,
[0, 0.2, 1],
[0, 1, 1],
{ extrapolateLeft: 'clamp', extrapolateRight: 'clamp' }
);
return {
transform: `scale(${scale})`,
opacity,
};
}
case 'cut':
default: {
return {
opacity: progress >= 1 ? 1 : 0,
};
}
}
};
const transitionStyle = getTransitionStyle();
const containerStyle: React.CSSProperties = {
width: '100%',
height: '100%',
position: 'relative',
...transitionStyle,
};
return (
<div style={containerStyle}>
{children}
</div>
);
};
/**
* Utility function to create transition presets
*/
export const TransitionPresets = {
fadeIn: (duration = 15): Partial<TransitionWrapperProps> => ({
type: 'fade',
duration,
opacityRange: [0, 1],
}),
fadeOut: (duration = 15): Partial<TransitionWrapperProps> => ({
type: 'fade',
duration,
opacityRange: [1, 0],
}),
slideFromRight: (duration = 20): Partial<TransitionWrapperProps> => ({
type: 'slide_in',
duration,
direction: 'right',
slideDistance: 200,
}),
slideFromLeft: (duration = 20): Partial<TransitionWrapperProps> => ({
type: 'slide_in',
duration,
direction: 'left',
slideDistance: 200,
}),
zoomIn: (duration = 20): Partial<TransitionWrapperProps> => ({
type: 'zoom',
duration,
scaleRange: [0.8, 1],
}),
springBounce: (): Partial<TransitionWrapperProps> => ({
type: 'zoom',
useSpring: true,
springConfig: {
damping: 100,
stiffness: 200,
mass: 1,
},
}),
};
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-changelog-updatemorluto/reaPrepare or rewrite REA release changelogs and GitHub release notes from pinned Git history, with verified contributor thanks and Release Please synchronization. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| academy-guideanthropics/skillsStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials, and use cases from Claude Academy (academy.claude.com), Anthropic's learning hub. Trigger on: "how do I", "how can I", "getting started with", "what can Claude do", "teach me", "learn to use"; questions about artifacts, projects, skills, plugins, connectors, MCP; requests about rolling Claude out to a team, class, or organization; and any ask for training materials, onboarding content, or learning resources. Use it when the user is learning how to use a feature or product — not when they are mid-task and just want the task done. This skill composes with other skills: after consulting product documentation to answer how a Claude feature works, also check here for a matching course or tutorial — a docs-grounded answer and an Academy recommendation belong together. Only recommend on a strong match; never invent Academy content. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| claude-apianthropics/skillsReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER — read BEFORE opening the target file; don't skip because it "looks like a one-liner" — whenever: the prompt names Claude/Anthropic in any form (Claude, Anthropic, Fable, Opus, Sonnet, Haiku, `anthropic`, `@anthropic-ai`, `claude-*`, `us.anthropic.*`, `[1m]`); the user asks about an LLM (pricing/model choice/limits/caching) — never answer from memory; OR the task is LLM-shaped with provider unstated (agent/MCP/tool-definition/multi-agent/RAG/LLM-judge/computer-use; generate/summarize/extract/classify/rewrite/converse over NL; debugging refusals/cutoffs/streaming/tool-calls/tokens). SKIP only when another provider is being worked on (overrides all triggers): OpenAI/GPT/Gemini/Llama/Mistral/Cohere/Ollama named in the query; OR `grep -rE 'openai|langchain_openai|google.generativeai|genai|mistralai|cohere|ollama'` over the project hits (run this grep FIRST if no provider named — don't Read the file). | Stars: 198k | Updated | Claude CodeCodex | Unverified | Install |
| doc-coauthoringanthropics/skillsGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |