Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问许可证需确认审计通过

creating-reanimated-animations创建复活动画

Agent Skill

用于辅助视频生成、动画合成、脚本化剪辑或 Remotion 等视频项目开发。它适合让 Agent 组织镜头、生成素材说明、维护合成代码或排查渲染问题。使用时需要确认分辨率、时长、素材路径和导出格式;涉及外部素材、人物肖像或商业发布时,应先核对版权授权和内容审核要求。

总安装

5,750

周安装

247

GitHub Stars

6

下载量

2,016
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:creating-reanimated-animations(创建复活动画)
来源仓库:https://github.com/estevg/skills
仓库路径:skills/creating-reanimated-animations
安装命令:
npx skills add https://github.com/estevg/skills --skill creating-reanimated-animations
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/estevg/skills --skill creating-reanimated-animations

简介

creating-reanimated-animations 用于生成高性能 React Native Reanimated 动画代码,支持 v3 与 v4 版本。

  • 可自动检测项目架构并配置 Babel 插件与依赖项。
  • 适用于移动端 UI 动效开发,需确认目标平台与架构兼容性。
  • 涉及外部素材或商业发布时应核实版权授权与内容审核边界。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

React Native Reanimated Code Generator

Generate performant animation code using React Native Reanimated. Supports both v3 and v4.

Version Detection

Check the project's package.json to determine the version:

  • v4 (New Architecture only): requires react-native-worklets as separate dependency
  • v3 (supports Legacy and New Architecture): single package install

Setup

Reanimated v4 (latest)

npm install react-native-reanimated react-native-worklets

Babel plugin: 'react-native-worklets/plugin' (must be last in plugins list). For Expo: no Babel config needed. Run npx expo prebuild after install.

Reanimated v3

npm install react-native-reanimated

Babel plugin: 'react-native-reanimated/plugin' (must be last in plugins list).

Core Pattern

Every animation follows three steps:

import Animated, { useSharedValue, useAnimatedStyle, withTiming } from 'react-native-reanimated';

function Component() {
  // 1. Create shared value (lives on UI thread)
  const offset = useSharedValue(0);

  // 2. Bind to style
  const animatedStyle = useAnimatedStyle(() => ({
    transform: [{ translateX: offset.value }],
  }));

  // 3. Trigger animation
  const handlePress = () => {
    offset.value = withTiming(200, { duration: 500 });
  };

  return (
    <Animated.View style={[styles.box, animatedStyle]}>
      <Pressable onPress={handlePress}><Text>Move</Text></Pressable>
    </Animated.View>
  );
}

Animation Selection

User wantsFunctionKey params
Smooth fixed-duration transitionwithTiming(to, {duration, easing})Default: 300ms, Easing.inOut(Easing.quad)
Natural bouncy feelwithSpring(to, {mass, damping, stiffness})Default: mass=1, damping=10, stiffness=100
Momentum after flingwithDecay({velocity, clamp})Needs initial velocity from gesture
Clamp spring rangewithClamp({min, max}, withSpring(to))v4: limits spring overshoot
Loop/pulse/shakewithRepeat(anim, reps, reverse)reps=0 for infinite (v4), reps=-1 (v3)
Multi-step choreographywithSequence(anim1, anim2,...)Runs in order
Delayed startwithDelay(ms, anim)Delays any animation

Spring tuning: lower damping (5–8) = more bounce, higher stiffness (150–200) = snappier, higher mass (2–3) = heavier.

Quick Patterns

Fade

const opacity = useSharedValue(0);
const style = useAnimatedStyle(() => ({ opacity: opacity.value }));
// Show: opacity.value = withTiming(1);
// Hide: opacity.value = withTiming(0);

Slide from side

const translateX = useSharedValue(-SCREEN_WIDTH);
const style = useAnimatedStyle(() => ({
  transform: [{ translateX: translateX.value }],
}));
// Enter: translateX.value = withSpring(0);

Scale on press

const scale = useSharedValue(1);
const style = useAnimatedStyle(() => ({
  transform: [{ scale: scale.value }],
}));
// In:  scale.value = withSpring(0.95);
// Out: scale.value = withSpring(1);

Interpolation

import { interpolate, Extrapolation } from 'react-native-reanimated';

const style = useAnimatedStyle(() => ({
  opacity: interpolate(scrollY.value, [0, 100], [1, 0], Extrapolation.CLAMP),
  transform: [{
    scale: interpolate(scrollY.value, [0, 100], [1, 0.8], Extrapolation.CLAMP),
  }],
}));

Scroll-linked animation

const scrollY = useSharedValue(0);
const scrollHandler = useAnimatedScrollHandler({
  onScroll: (event) => { scrollY.value = event.contentOffset.y; },
});
<Animated.ScrollView onScroll={scrollHandler}>{children}</Animated.ScrollView>

Or simpler with useScrollOffset (v4) / useScrollViewOffset (v3):

const ref = useAnimatedRef<Animated.ScrollView>();
const scrollOffset = useScrollOffset(ref); // auto-tracks scroll position
<Animated.ScrollView ref={ref}>{children}</Animated.ScrollView>

Layout Animations (Mount/Unmount)

Built-in presets — no shared values needed:

import Animated, { FadeIn, SlideInRight, SlideOutLeft } from 'react-native-reanimated';

<Animated.View entering={FadeIn.duration(400).delay(100)} exiting={SlideOutLeft.duration(300)}>
  {content}
</Animated.View>

Presets: FadeIn/Out, SlideIn/OutLeft/Right/Up/Down, ZoomIn/Out, BounceIn/Out, FlipInEasyX/Y, LightSpeedIn/Out, PinwheelIn/Out, RollIn/Out, RotateIn/Out, StretchIn/Out.

Modifiers: .duration(ms), .delay(ms), .springify(), .damping(n), .stiffness(n), .randomDelay(), .reduceMotion(), .withCallback().

Layout Transitions (position/size changes)

Animate when component position or size changes:

import { LinearTransition, SequencedTransition } from 'react-native-reanimated';

<Animated.View layout={LinearTransition.springify().damping(15)} />

Transitions: LinearTransition, SequencedTransition, FadingTransition, JumpingTransition, CurvedTransition, EntryExitTransition.

Keyframe Animations (complex entering/exiting)

import { Keyframe } from 'react-native-reanimated';

const enteringAnimation = new Keyframe({
  0: { opacity: 0, transform: [{ translateY: -50 }] },
  50: { opacity: 0.5, transform: [{ translateY: -25 }], easing: Easing.out(Easing.quad) },
  100: { opacity: 1, transform: [{ translateY: 0 }] },
}).duration(500);

<Animated.View entering={enteringAnimation}>{content}</Animated.View>

For custom animations, layout transitions, and list animations, read references/layout-animations.md.

CSS Animations (v4 only)

Declarative CSS-like animations using style props directly:

<Animated.View style={{
  animationName: {
    from: { opacity: 0, transform: [{ translateY: -20 }] },
    to: { opacity: 1, transform: [{ translateY: 0 }] },
  },
  animationDuration: '500ms',
  animationTimingFunction: 'ease-out',
}} />

Supported props: animationName, animationDuration, animationDelay, animationIterationCount, animationDirection, animationFillMode, animationPlayState, animationTimingFunction.

CSS Transitions (v4 only)

Automatic transitions when style values change:

<Animated.View style={{
  width: isExpanded ? 200 : 100,
  transitionProperty: 'width',
  transitionDuration: '300ms',
  transitionTimingFunction: 'ease-in-out',
}} />

Multiple properties: transitionProperty: ['width', 'opacity', 'transform'] with matching transitionDuration: ['300ms', '200ms', '500ms'].

For detailed CSS animations/transitions reference (keyframes, timing functions, examples), read references/css-animations-detailed.md.

Shared Element Transitions (Experimental)

Animate components between screens during navigation:

// Screen A
<Animated.Image sharedTransitionTag={`photo-${id}`} source={...} />

// Screen B (same tag)
<Animated.Image sharedTransitionTag={`photo-${id}`} source={...} />

Requires @react-navigation/native-stack and feature flag. For setup and customization, read references/shared-element-transitions.md.

Gesture Integration

For drag, pinch, fling, and other gesture-driven animations, read references/gesture-patterns.md.

Requires: react-native-gesture-handler + <GestureHandlerRootView> at app root.

Full API Reference

For complete hook signatures, animation parameters, v3↔v4 differences, and advanced APIs, read references/api-reference.md.

Worklets & Advanced APIs

For understanding worklets, 'worklet' directive, runOnJS/runOnUI, useAnimatedReaction, useFrameCallback, measure, dispatchCommand, and performance tips, read references/worklets-advanced.md.

Real-World Component Patterns

For full implementations of accordion, bottom sheet, flip card, and FAB, read references/component-patterns.md.

Testing, Colors & Supported Properties

For testing animations with Jest, animating colors with interpolateColor, and the full list of animatable properties by platform, read references/testing-and-properties.md.

Rules

  • Always use Animated.View/Text/Image/ScrollView/FlatList — never animate plain RN components
  • v4: use runOnJS/runOnUI (re-exported), or import scheduleOnRN/scheduleOnUI from react-native-worklets
  • v3: use runOnJS(fn)() for heavy JS-thread logic
  • Always use Extrapolation.CLAMP with interpolate unless you explicitly want extrapolation
  • Combine: withSequence(withTiming(1.2, {duration: 100}), withSpring(1))
  • Use useReducedMotion() to respect accessibility settings
  • Test on real devices — simulator performance differs significantly
  • v4: useAnimatedKeyboard is deprecated → use react-native-keyboard-controller

Based on react-native-reanimated by Software Mansion (MIT License)

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.85%
按下载量换算703

Claude

33.92%
按下载量换算684

Cursor

19.78%
按下载量换算399

Gemini CLI

8.97%
按下载量换算181

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills