Token导航 LogoToken导航TokenDH.com
AI 工具需要联网github未标认证来源可访问clear审计通过

swiftui-animationswiftui animation 视频

Agent Skill

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

总安装

10,241

周安装

431

GitHub Stars

125

下载量

3,586
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/jamesrochabrun/skills --skill swiftui-animation

简介

适用于 iOS 和 macOS 的高级 SwiftUI 动画、过渡、匹配的几何效果以及 Metal 着色器集成。

  • 涵盖用于精心策划的多步骤序列的动画曲线、弹簧、关键帧动画师和相位动画师
  • 包括内置过渡(淡入淡出、滑动、缩放、移动)和定向进入/退出效果的非对称过渡
  • 为英雄动画和平滑的视图过渡提供匹配的几何效果模式
  • 支持 GPU 加速的 Metal 着色器效果,包括颜色处理、像素失真和图层效果 (iOS 17+)
  • 包括运动设计原则、可访问性指南、特定于平台的注意事项和性能优化策略

SKILL.md

SwiftUI Animation Expert

Expert guidance for implementing advanced SwiftUI animations and Metal shader integration. Covers animation curves, springs, transitions, matched geometry effects, PhaseAnimator, KeyframeAnimator, and GPU-accelerated shader effects.

When to Use This Skill

  • Understanding motion design principles and when to use animation
  • Making animations accessible and platform-appropriate
  • Implementing animations in SwiftUI (springs, easing, keyframes)
  • Creating view transitions (fade, slide, scale, custom)
  • Building hero animations with matchedGeometryEffect
  • Adding GPU-accelerated effects with Metal shaders
  • Optimizing animation performance
  • Creating multi-phase orchestrated animations

Quick Reference

Animation Basics

// Explicit animation (preferred)
withAnimation(.spring(response: 0.4, dampingFraction: 0.75)) {
    isExpanded.toggle()
}

// iOS 17+ spring presets
withAnimation(.snappy) { ... }  // Fast, small bounce
withAnimation(.smooth) { ... }  // Gentle, no bounce
withAnimation(.bouncy) { ... }  // More bounce

Common Transitions

// Basic
.transition(.opacity)
.transition(.scale)
.transition(.slide)
.transition(.move(edge: .bottom))

// Combined
.transition(.move(edge: .trailing).combined(with: .opacity))

// Asymmetric
.transition(.asymmetric(
    insertion: .move(edge: .bottom),
    removal: .opacity
))

Matched Geometry Effect

@Namespace var namespace

// Source view
ThumbnailView()
    .matchedGeometryEffect(id: "hero", in: namespace)

// Destination view
DetailView()
    .matchedGeometryEffect(id: "hero", in: namespace)

Metal Shader Effects (iOS 17+)

// Color manipulation
.colorEffect(ShaderLibrary.invert())

// Pixel displacement
.distortionEffect(
    ShaderLibrary.wave(.float(time)),
    maxSampleOffset: CGSize(width: 20, height: 20)
)

// Full layer access
.layerEffect(ShaderLibrary.blur(.float(radius)), maxSampleOffset: .zero)

Reference Materials

Detailed documentation is available in references/:

  • motion-guidelines.md - HIG Motion design principles

- Purpose-driven motion philosophy - Accessibility requirements - Platform-specific considerations (iOS, visionOS, watchOS) - Animation anti-patterns to avoid

  • animations.md - Complete animation API guide

- Implicit vs explicit animations - Spring parameters and presets - Animation modifiers (speed, delay, repeat) - PhaseAnimator for multi-step sequences - KeyframeAnimator for property-specific timelines - Custom animatable properties

  • transitions.md - View transition guide

- Built-in transitions (opacity, scale, slide, move) - Combined and asymmetric transitions - Matched geometry effect implementation - Hero animation patterns - Content transitions (iOS 17+) - Custom transition creation

  • metal-shaders.md - GPU shader integration

- SwiftUI shader modifiers (colorEffect, distortionEffect, layerEffect) - Writing Metal shader functions - Embedding MTKView with UIViewRepresentable - Cross-platform Metal integration (iOS/macOS) - Performance considerations

Common Patterns

Expandable Card

struct ExpandableCard: View {
    @State private var isExpanded = false

    var body: some View {
        VStack {
            RoundedRectangle(cornerRadius: isExpanded ? 20 : 12)
                .fill(.blue)
                .frame(
                    width: isExpanded ? 300 : 150,
                    height: isExpanded ? 400 : 100
                )
        }
        .onTapGesture {
            withAnimation(.spring(response: 0.35, dampingFraction: 0.75)) {
                isExpanded.toggle()
            }
        }
    }
}

List Item Appearance

ForEach(Array(items.enumerated()), id: \.element.id) { index, item in
    ItemRow(item: item)
        .transition(.asymmetric(
            insertion: .move(edge: .trailing).combined(with: .opacity),
            removal: .move(edge: .leading).combined(with: .opacity)
        ))
        .animation(.spring().delay(Double(index) * 0.05), value: items)
}

Pulsing Indicator

Circle()
    .fill(.blue)
    .frame(width: 20, height: 20)
    .scaleEffect(isPulsing ? 1.2 : 1.0)
    .opacity(isPulsing ? 0.6 : 1.0)
    .onAppear {
        withAnimation(.easeInOut(duration: 1.0).repeatForever(autoreverses: true)) {
            isPulsing = true
        }
    }

Best Practices

  1. Motion should be purposeful - Don't add animation for its own sake; support the experience without overshadowing it
  2. Make motion optional - Supplement with haptics and audio; never use motion as the only way to communicate
  3. Aim for brevity - Brief, precise animations feel lightweight and convey information effectively
  4. Prefer explicit animations - Use withAnimation over .animation() modifier for clarity
  5. Use spring animations - They feel more natural and iOS-native
  6. Start with .spring(response: 0.35, dampingFraction: 0.8) - Good default for most interactions
  7. Keep animations under 400ms - Longer feels sluggish
  8. Let people cancel motion - Don't force users to wait for animations to complete
  9. Test on device - Simulator animation timing differs
  10. Profile shader performance - GPU time matters for complex effects

Troubleshooting

Animation not working

  • Ensure state change is wrapped in withAnimation
  • Check that the property is animatable
  • Verify the view is actually changing

Matched geometry jumps

  • Both views must use the same ID and namespace
  • Use explicit withAnimation when toggling
  • Check zIndex for proper layering

Shader not appearing

  • Verify .metal file is added to target
  • Check shader function signature matches expected format
  • Ensure maxSampleOffset is set correctly for distortion effects

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

补充不同宿主或平台的使用分布数据

能力 5

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

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

平台分布

Claude Code

29.23%
按下载量换算1,048

Codex

20.61%
按下载量换算739

Gemini CLI

19.31%
按下载量换算692

OpenCode

12.92%
按下载量换算463

Cursor

8.8%
按下载量换算316

Antigravity

3.38%
按下载量换算121

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills