mcpField
R
react-animation

react-animation

github.com/notedit创意与媒体340181 次安装34 周前更新
代码仓库

关于 react-animation

为制作 Remotion 视频合成提供设计指南,按视觉风格整理精选 React 动画组件。帮助视频创作者选择效果,并将动画调整为确定性的逐帧渲染。

主要功能

  1. 01按视觉风格分类的组件
  2. 02文字、背景与特效动画
  3. 03Remotion 逐帧动画模式
  4. 04用于确定性输出的种子随机数
  5. 05风格组合建议

适用场景

  1. 01设计奢侈品牌视频
  2. 02制作科技或游戏宣传合成
  3. 03将时间驱动效果改为 Remotion 渲染

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/notedit/happy-skills --skill react-animation

安装后在 Claude Code 中输入/react-animation确认已加载。

附带文件AESTHETIC_ANALYSIS.mdrules/adaptation-patterns.md

详细介绍

适用场景

创建需要精致美观视觉效果的 Remotion 视频合成时,使用此技能。组件经过精心挑选,旨在打造出色的动态图形,并按视觉风格分类。

安装

npx shadcn@latest add https://reactbits.dev/r/<Component>-TS-CSS

🎨 美学类别

按视觉风格整理的组件。避免在一个视频中混用超过 2 种风格。


1. 优雅柔和(优雅柔和)

流畅、富有电影感、精致。最适合奢侈品牌和情感叙事。

文本
组件安装美学
BlurTextnpx shadcn add https://reactbits.dev/r/BlurText-TS-CSS从模糊到清晰的电影感揭示效果
背景
组件安装美学
Auroranpx shadcn add https://reactbits.dev/r/Aurora-TS-CSS流动的极光
Silknpx shadcn add https://reactbits.dev/r/Silk-TS-CSS极简织物波纹
Grainientnpx shadcn add https://reactbits.dev/r/Grainient-TS-CSS带颗粒感的艺术渐变
特效
组件安装美学
Ribbonsnpx shadcn add https://reactbits.dev/r/Ribbons-TS-CSS流动的丝带
ShapeBlurnpx shadcn add https://reactbits.dev/r/ShapeBlur-TS-CSS柔和的抽象几何图形

使用模式:

const ElegantScene: React.FC = () => {
  const frame = useCurrentFrame();
  const { fps } = useVideoConfig();
  
  return (
    <AbsoluteFill>
      <Aurora time={frame / fps} colorStops={['#3A29FF', '#FF94B4', '#FF3232']} />
      <BlurText text="Elegant Title" startFrame={15} />
    </AbsoluteFill>
  );
};

2. 现代科技(现代科技)

前沿、动感、未来感。最适合科技产品、初创公司和创新主题。

文本
组件安装美学
GlitchTextnpx shadcn add https://reactbits.dev/r/GlitchText-TS-CSS数字故障伪影
GradientTextnpx shadcn add https://reactbits.dev/r/GradientText-TS-CSS流动的渐变扫光
背景
组件安装美学禁用鼠标交互
Iridescencenpx shadcn add https://reactbits.dev/r/Iridescence-TS-CSS彩虹油膜mouseReact={false}
LiquidChromenpx shadcn add https://reactbits.dev/r/LiquidChrome-TS-CSS液态金属表面interactive={false}
Particlesnpx shadcn add https://reactbits.dev/r/Particles-TS-CSS漂浮的数据点moveParticlesOnHover={false}
特效
组件安装美学
MetaBallsnpx shadcn add https://reactbits.dev/r/MetaBalls-TS-CSS有机液体融合
Antigravitynpx shadcn add https://reactbits.dev/r/Antigravity-TS-CSS空灵粒子场

使用模式:

const TechScene: React.FC = () => (
  <AbsoluteFill style={{ background: '#000' }}>
    <Iridescence mouseReact={false} color={[0.3, 0.1, 0.8]} speed={1} />
    <GlitchText speed={0.5} enableShadows enableOnHover={false}>
      FUTURE IS NOW
    </GlitchText>
  </AbsoluteFill>
);

3. 奢华高端(奢华高端)

金属质感、精致、雅致。最适合奢侈品、金融和高端服务。

文本
组件安装美学
ShinyTextnpx shadcn add https://reactbits.dev/r/ShinyText-TS-CSS金属光泽扫过效果
背景
组件安装美学
Silknpx shadcn add https://reactbits.dev/r/Silk-TS-CSS高级织物纹理
特效
组件安装美学
StarBordernpx shadcn add https://reactbits.dev/r/StarBorder-TS-CSS动态渐变边框

使用模式:

const LuxuryScene: React.FC = () => (
  <AbsoluteFill style={{ background: '#0a0a0a' }}>
    <Silk speed={0.5} color="#1a1a2e" />
    <StarBorder color="#gold" speed="4s">
      <ShinyText text="PREMIUM" color="#c9b037" shineColor="#fff" />
    </StarBorder>
  </AbsoluteFill>
);

4. 复古像素(复古像素)

怀旧、数字、低保真。最适合游戏、复古科技和蒸汽波美学。

文本
组件安装美学
TextTypenpx shadcn add https://reactbits.dev/r/TextType-TS-CSS终端打字机效果
DecryptedTextnpx shadcn add https://reactbits.dev/r/DecryptedText-TS-CSS数据解密效果
转场
组件安装美学
PixelTransitionnpx shadcn add https://reactbits.dev/r/PixelTransition-TS-CSS像素网格溶解效果
背景
组件安装风格
LetterGlitchnpx shadcn add https://reactbits.dev/r/LetterGlitch-TS-CSS矩阵代码雨
Dithernpx shadcn add https://reactbits.dev/r/Dither-TS-CSS复古抖动效果
FaultyTerminalnpx shadcn add https://reactbits.dev/r/FaultyTerminal-TS-CSSCRT 显示器效果

使用模式:

const RetroScene: React.FC = () => (
  <AbsoluteFill style={{ background: '#000' }}>
    <LetterGlitch glitchSpeed={100} glitchColors={['#0f0', '#00ff41']} />
    <GlitchText>SYSTEM OVERRIDE</GlitchText>
  </AbsoluteFill>
);

5. 能量与戏剧性(能量戏剧)

高冲击力、动态、强劲。最适合动作、体育和公告场景。

背景
组件安装风格禁用鼠标交互
Lightningnpx shadcn add https://reactbits.dev/r/Lightning-TS-CSS电闪雷鸣无
Beamsnpx shadcn add https://reactbits.dev/r/Beams-TS-CSS体积光柱无
LightRaysnpx shadcn add https://reactbits.dev/r/LightRays-TS-CSS戏剧性上帝光followMouse={false}

使用模式:

const DramaticScene: React.FC = () => (
  <AbsoluteFill>
    <Lightning hue={45} intensity={0.8} speed={2} />
    <BlurText text="THUNDER STRIKE" />
  </AbsoluteFill>
);

6. 抽象与艺术(抽象艺术)

实验性、艺术感、独特。最适合创意项目和音乐视频。

文本
组件安装风格
DecryptedTextnpx shadcn add https://reactbits.dev/r/DecryptedText-TS-CSS神秘解码效果
背景
组件安装风格禁用鼠标交互
Plasmanpx shadcn add https://reactbits.dev/r/Plasma-TS-CSS有机流动色彩mouseInteractive={false}
Prismnpx shadcn add https://reactbits.dev/r/Prism-TS-CSS光线折射animationType='rotate'

7. 实用工具(通用工具)

增强任意场景。

叠加层
组件安装用途
Noisenpx shadcn add https://reactbits.dev/r/Noise-TS-CSS胶片颗粒纹理叠加层

使用模式:

const SceneWithGrain: React.FC = () => {
  const frame = useCurrentFrame();
  const { width, height } = useVideoConfig();
  const canvasRef = useRef<HTMLCanvasElement>(null);
  
  useEffect(() => {
    const ctx = canvasRef.current?.getContext('2d');
    if (!ctx || frame % 2 !== 0) return;
    
    const imageData = ctx.createImageData(width, height);
    for (let i = 0; i < imageData.data.length; i += 4) {
      const seed = frame * 100000 + i / 4;
      const val = Math.floor((Math.sin(seed) * 10000 % 1) * 255);
      imageData.data[i] = imageData.data[i + 1] = imageData.data[i + 2] = val;
      imageData.data[i + 3] = 15;
    }
    ctx.putImageData(imageData, 0, 0);
  }, [frame]);
  
  return (
    <>
      <YourScene />
      <canvas ref={canvasRef} style={{ position: 'absolute', inset: 0, pointerEvents: 'none' }} />
    </>
  );
};

🔧 核心适配模式

基于帧的动画

将所有基于时间驱动的动画替换为 useCurrentFrame():

import { useCurrentFrame, useVideoConfig, interpolate, Easing } from 'remotion';

// Before: time accumulation
// After: deterministic from frame
const frame = useCurrentFrame();
const { fps } = useVideoConfig();
const progress = interpolate(frame, [0, 30], [0, 1], {
  easing: Easing.out(Easing.cubic),
  extrapolateLeft: 'clamp',
  extrapolateRight: 'clamp',
});
带种子的随机性

确保渲染结果确定:

function seededRandom(seed: number): number {
  const x = Math.sin(seed) * 10000;
  return x - Math.floor(x);
}

const rand = seededRandom(frame * 1000 + index);
着色器 Uniform

用于 WebGL/OGL 组件:

// Time uniform
uniforms.iTime.value = frame / fps;

// Scripted mouse path (optional)
uniforms.iMouse.value.set(
  0.5 + 0.3 * Math.sin(frame / fps),
  0.5 + 0.2 * Math.cos(frame / fps * 0.7)
);

⚠️ 风格一致性指南

应该:

  • ✅ 混搭优雅与奢华风格(BlurText + ShinyText + Silk)
  • ✅ 混搭现代与复古风格(GlitchText + LetterGlitch)
  • ✅ 在任意场景中使用 Noise 叠加层
  • ✅ 文本突出时,保持背景低调

不应该:

  • ❌ 混搭优雅与复古风格(BlurText + PixelTransition)
  • ❌ 混搭奢华与故障风格(ShinyText + GlitchText)
  • ❌ 将 Lightning 与复杂的文本动画搭配使用
  • ❌ 同时使用超过 2 种背景效果

📦 完整组件列表(精选 35 个)

文本(6)

BlurText、GlitchText、GradientText、ShinyText、DecryptedText、TextType

背景(18)

Aurora、Silk、Grainient、Lightning、Iridescence、LiquidChrome、Particles、Galaxy、Plasma、LetterGlitch、Beams、LightRays、Dither、FaultyTerminal、DarkVeil、PixelSnow、Balatro、Prism

效果(10)

MetaBalls、Ribbons、ShapeBlur、Antigravity、StarBorder、PixelTransition

实用工具(1)

Noise


❌ 已移除的组件

移除原因:

  • 美学价值较低:SplitText、FadeContent、AnimatedContent
  • 风格重叠:ElectricBorder(可由 GlitchText 替代)、Orb(可由 Iridescence 替代)
  • 美学风格过时:Hyperspeed、Cubes、Squares
  • 适用场景狭窄:CircularText、RotatingText、TrueFocus
  • 功能性大于美学性:Counter、Stepper、Carousel(UI 组件)

🎬 Recommended Combinations

Project TypeTextBackgroundEffectMood
Luxury BrandShinyTextSilkStarBorderPremium
Tech StartupGradientTextIridescence-Innovative
Creative StudioBlurTextAuroraRibbonsArtistic
GamingGlitchTextLetterGlitchPixelTransitionEdgy
DocumentaryBlurTextGrainientNoiseCinematic
Event PromoDecryptedTextLightning-Energetic

评论

支持 Markdown