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/ProgressIndicator.tsx
View on GitHubimport React from 'react';
import { useCurrentFrame, interpolate } from 'remotion';
/**
* ProgressIndicator Component
*
* Displays section position in the video with current position highlight.
* Shows a visual progress bar or dot indicators for multi-section videos.
*/
export interface Section {
/** Section identifier */
id: string;
/** Section display name */
name: string;
/** Start frame of this section */
startFrame: number;
/** End frame of this section */
endFrame: number;
/** Optional section color */
color?: string;
}
export interface ProgressIndicatorProps {
/** Array of sections in the video */
sections: Section[];
/** Current section index (0-based) */
currentIndex?: number;
/** Position on screen */
position?: 'top' | 'bottom' | 'left' | 'right';
/** Display style */
style?: 'bar' | 'dots' | 'minimal';
/** Show section labels */
showLabels?: boolean;
/** Primary color for active section */
activeColor?: string;
/** Color for inactive sections */
inactiveColor?: string;
/** Size of the indicator (pixels) */
size?: 'small' | 'medium' | 'large';
/** Animate transitions between sections */
animated?: boolean;
}
const SIZE_CONFIG = {
small: { height: 3, dotSize: 8, fontSize: 12, padding: 8 },
medium: { height: 4, dotSize: 12, fontSize: 14, padding: 12 },
large: { height: 6, dotSize: 16, fontSize: 16, padding: 16 },
};
export const ProgressIndicator: React.FC<ProgressIndicatorProps> = ({
sections,
currentIndex,
position = 'bottom',
style = 'dots',
showLabels = false,
activeColor = '#00F5FF',
inactiveColor = '#444444',
size = 'medium',
animated = true,
}) => {
const frame = useCurrentFrame();
const sizeConfig = SIZE_CONFIG[size];
// Auto-detect current index if not provided
const effectiveCurrentIndex = currentIndex !== undefined
? currentIndex
: sections.findIndex(s => frame >= s.startFrame && frame <= s.endFrame);
// Calculate progress within current section
const currentSection = sections[effectiveCurrentIndex];
const sectionProgress = currentSection
? interpolate(
frame,
[currentSection.startFrame, currentSection.endFrame],
[0, 1],
{ extrapolateLeft: 'clamp', extrapolateRight: 'clamp' }
)
: 0;
// Calculate overall progress
const totalFrames = sections.length > 0
? sections[sections.length - 1].endFrame - sections[0].startFrame
: 1;
const overallProgress = sections.length > 0
? interpolate(
frame,
[sections[0].startFrame, sections[sections.length - 1].endFrame],
[0, 100],
{ extrapolateLeft: 'clamp', extrapolateRight: 'clamp' }
)
: 0;
// Position styles
const getPositionStyle = (): React.CSSProperties => {
const baseStyle: React.CSSProperties = {
position: 'absolute',
zIndex: 100,
};
switch (position) {
case 'top':
return { ...baseStyle, top: sizeConfig.padding, left: sizeConfig.padding, right: sizeConfig.padding };
case 'bottom':
return { ...baseStyle, bottom: sizeConfig.padding, left: sizeConfig.padding, right: sizeConfig.padding };
case 'left':
return { ...baseStyle, left: sizeConfig.padding, top: sizeConfig.padding, bottom: sizeConfig.padding };
case 'right':
return { ...baseStyle, right: sizeConfig.padding, top: sizeConfig.padding, bottom: sizeConfig.padding };
}
};
const containerStyle: React.CSSProperties = {
...getPositionStyle(),
display: 'flex',
flexDirection: position === 'left' || position === 'right' ? 'column' : 'row',
alignItems: 'center',
justifyContent: 'center',
gap: sizeConfig.padding,
};
// Render based on style
const renderBar = () => {
const barStyle: React.CSSProperties = {
width: position === 'left' || position === 'right' ? `${sizeConfig.height}px` : '100%',
height: position === 'left' || position === 'right' ? '100%' : `${sizeConfig.height}px`,
backgroundColor: inactiveColor,
borderRadius: sizeConfig.height,
position: 'relative',
overflow: 'hidden',
};
const fillStyle: React.CSSProperties = {
position: 'absolute',
top: 0,
left: 0,
width: position === 'left' || position === 'right' ? '100%' : `${overallProgress}%`,
height: position === 'left' || position === 'right' ? `${overallProgress}%` : '100%',
backgroundColor: activeColor,
transition: animated ? 'width 0.3s ease, height 0.3s ease' : 'none',
boxShadow: `0 0 10px ${activeColor}`,
};
return (
<div style={barStyle}>
<div style={fillStyle} />
</div>
);
};
const renderDots = () => {
return (
<>
{sections.map((section, index) => {
const isActive = index === effectiveCurrentIndex;
const isPast = index < effectiveCurrentIndex;
const dotStyle: React.CSSProperties = {
width: sizeConfig.dotSize,
height: sizeConfig.dotSize,
borderRadius: '50%',
backgroundColor: isActive || isPast ? activeColor : inactiveColor,
transition: animated ? 'background-color 0.3s ease, transform 0.3s ease' : 'none',
transform: isActive ? 'scale(1.3)' : 'scale(1)',
boxShadow: isActive ? `0 0 12px ${activeColor}` : 'none',
cursor: 'pointer',
};
return (
<div key={section.id} style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 4 }}>
<div style={dotStyle} />
{showLabels && (
<span
style={{
fontSize: sizeConfig.fontSize,
color: isActive ? activeColor : inactiveColor,
fontWeight: isActive ? 700 : 400,
transition: animated ? 'color 0.3s ease' : 'none',
}}
>
{section.name}
</span>
)}
</div>
);
})}
</>
);
};
const renderMinimal = () => {
const minimalStyle: React.CSSProperties = {
fontSize: sizeConfig.fontSize,
color: activeColor,
fontWeight: 600,
fontFamily: 'monospace',
};
return (
<div style={minimalStyle}>
{effectiveCurrentIndex + 1} / {sections.length}
</div>
);
};
return (
<div style={containerStyle}>
{style === 'bar' && renderBar()}
{style === 'dots' && renderDots()}
{style === 'minimal' && renderMinimal()}
</div>
);
};
/**
* Utility function to create sections from scene data
*/
export const createSections = (
scenes: Array<{ id: string; name: string; startFrame: number; durationFrames: number }>
): Section[] => {
return scenes.map(scene => ({
id: scene.id,
name: scene.name,
startFrame: scene.startFrame,
endFrame: scene.startFrame + scene.durationFrames,
}));
};
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 |