Motion.dev:高性能 Web 动画 - Openclaw Skills
作者:互联网
2026-04-10
什么是 Motion.dev 动画库?
Motion.dev 代表了下一代动画库,是 Framer Motion 的演进版本。此技能提供了构建流体、高性能 Web 动画所需工具的全面访问,且体积仅为 2.3kb。通过将其纳入您的 Openclaw Skills 工具包,您将获得使用硬件加速技术为 HTML、SVG 和 JavaScript 对象制作动画的能力,确保在所有设备上提供流畅的用户体验。
该技能涵盖了多功能的 Motion API,简化了弹簧物理和手势检测等复杂任务。无论您是在构建 React 应用还是使用原生 JavaScript,此文档都能确保您以专业级的精度实现从基础过渡到复杂的滚动触发时间线的所有内容。
下载入口:https://github.com/openclaw/skills/tree/main/skills/leonaaardob/lb-motion-skill
安装与下载
1. ClawHub CLI
从源直接安装技能的最快方式。
npx clawhub@latest install lb-motion-skill
2. 手动安装
将技能文件夹复制到以下位置之一
全局模式~/.openclaw/skills/
工作区
/skills/
优先级:工作区 > 本地 > 内置
3. 提示词安装
将此提示词复制到 OpenClaw 即可自动安装。
请帮我使用 Clawhub 安装 lb-motion-skill。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。
Motion.dev 动画库 应用场景
- 在 React、Vue 或原生 JavaScript 应用中实现生产级动画。
- 为落地页创建响应式的、滚动关联或滚动触发的视觉效果。
- 开发基于手势的交互,包括拖拽、悬停、点击和按压状态。
- 将现有的 Framer Motion 实现迁移到性能更强的 Motion.dev 引擎。
- 通过利用硬件加速的运动序列优化 Web 应用性能。
- 通过 Openclaw Skills 访问文档,确定最佳动画方法,例如 animate 函数或框架特定组件。
- 使用 CSS 选择器或直接元素引用定位特定的 DOM 元素。
- 定义动画的关键帧属性,如缩放、旋转或透明度。
- 配置过渡设置,包括时长、缓动或弹簧物理参数(劲度、阻尼)。
- 执行动画逻辑或将其链接到外部触发器,如滚动位置或用户手势。
Motion.dev 动画库 配置指南
要将此技能集成到您的项目中,请使用您偏好的包管理器安装核心库:
npm install motion
对于 React 特定的实现,请确保从正确的入口点导入 motion 组件:
import { motion } from "motion/react"
Motion.dev 动画库 数据架构与分类体系
该技能通过以下主要接口组织动画逻辑和配置:
| API 方法 | 目标 | 主要用途 |
|---|---|---|
animate() |
元素 / 对象 | 具有完全控制权的直接命令式动画 |
|
React/Vue 组件 | UI 框架的声明式动画语法 |
scroll() |
视口/容器 | 将动画进度链接到滚动偏移量 |
stagger() |
元素数组 | 协调多个子元素之间的时间分配 |
name: motion
version: 1.0.0
description: Complete Motion.dev documentation - modern animation library for React, JavaScript, and Vue (formerly Framer Motion)
author: Leonardo Balland
tags:
- motion
- animation
- react
- javascript
- vue
- framer-motion
- transitions
- gestures
- scroll
- spring
- keyframes
read_when:
- Working with Motion animations or Framer Motion
- Implementing animations in React, Vue, or vanilla JavaScript
- Creating scroll-linked or scroll-triggered animations
- Building gesture-based interactions
- Optimizing animation performance
- Migrating from Framer Motion to Motion
Motion.dev Documentation
Motion is a modern animation library for React, JavaScript, and Vue. It's the evolution of Framer Motion, offering:
- Tiny size: Just 2.3kb for the mini HTML/SVG version
- High performance: Hardware-accelerated animations
- Flexible: Animate HTML, SVG, WebGL, and JavaScript objects
- Easy to use: Intuitive API with smart defaults
- Spring physics: Natural, kinetic animations
- Scroll animations: Link values to scroll position
- Gestures: Drag, hover, tap, and more
Quick Reference
Installation
npm install motion
Basic Animation
import { animate } from "motion"
// Animate elements
animate(".box", { rotate: 360, scale: 1.2 })
// Spring animation
animate(element, { x: 100 }, { type: "spring", stiffness: 300 })
// Stagger multiple elements
animate("li", { opacity: 1 }, { delay: stagger(0.1) })
React
import { motion } from "motion/react"
Scroll Animations
import { scroll } from "motion"
scroll(animate(".box", { scale: [1, 2, 1] }))
Documentation Structure
quick-start.md- Installation and first animation- More docs to be added...
When to Use This Skill
Use this skill when:
- Implementing animations in web applications
- Optimizing animation performance
- Creating scroll-based effects
- Building interactive UI with gestures
- Migrating from Framer Motion to Motion
External Resources
- Official site: https://motion.dev
- GitHub: https://github.com/motiondivision/motion
- Examples: https://motion.dev/examples
相关推荐
专题
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
最新数据
相关文章
阿里云大模型服务平台百炼新人免费额度如何申请?申请与使用免费额度教程及常见问题解答
办公 AI 工具 OpenClaw 部署 Windows 系统一站式教程
Qwen3.6 正式发布!阿里云百炼同步开启“AI大模型节省计划”超值优惠
【新手零难度操作 】OpenClaw 2.6.4 安装误区规避与快速使用指南(包含最新版安装包)
OpenClaw 2.6.4 可视化部署 打造个人 AI 数字员工(包含最新版安装包)
【小白友好!】OpenClaw 2.6.4 本地 AI 智能体快速搭建教程(内有安装包)
零基础部署 OpenClaw v2.6.2,Windows 系统完整教程
【适合新手的】零基础部署 OpenClaw 自动化工具教程
开发者们的第一台自主进化的“爱马仕”来了
极简部署 OpenClaw 2.6.2 本地 AI 智能体快速启用(含最新版安装包)
AI精选
