重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
accordions-dropdowns by dylantarre/animation-principles
npx skills add https://github.com/dylantarre/animation-principles --skill accordions-dropdowns运用迪士尼的 12 条动画原则来实现展开/折叠元素,以获得流畅且信息丰富的显示效果。
内容在折叠时可以轻微压缩,在展开时可以拉伸。触发标题可以在点击反馈时被挤压。
在展开之前,标题会短暂下压。V 形图标在内容显示之前开始旋转。这有助于建立预期。
展开的部分应清晰可见。可以考虑调暗其他手风琴项。活动标题保持高亮。
定义清晰的状态:折叠、展开中、已展开、折叠中。使用姿态对应法来实现可控、可逆的动画。
容器首先展开,内容在 50-100 毫秒后淡入。V 形图标的旋转可以稍微过冲然后回弹。这能创造深度感。
展开:ease-out(快速开始,平滑结束)。折叠:ease-in(缓慢开始,快速结束)。cubic-bezier(0.4, 0, 0.2, 1) 效果很好。
V 形图标的旋转应沿弧线缓动。内容项可以沿轻微的弧线路径进入,而不是直线向下。
当内容显示时(主要动作),V 形图标旋转(次要动作),同级手风琴项可能折叠(第三级动作)。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
重要的显示可以使用更戏剧化的时间控制。常见问题手风琴可以有更干脆利落的动画。与内容的重要性相匹配。
保持一致的标题高度。在高度动画期间,内容不应抖动。使用适当的高度控制技术。
流畅的手风琴动画感觉精致。卡顿的高度动画感觉有缺陷。正确的展开/折叠值得进行技术投入。
.accordion-content {
display: grid;
grid-template-rows: 0fr;
transition: grid-template-rows 300ms ease-out;
}
.accordion-content.open {
grid-template-rows: 1fr;
}
.accordion-inner {
overflow: hidden;
}
.accordion-chevron {
transition: transform 250ms ease-out;
}
.accordion-header[aria-expanded="true"] .accordion-chevron {
transform: rotate(180deg);
}
/* 替代方案:动画化 max-height */
.dropdown-content {
max-height: 0;
overflow: hidden;
transition: max-height 300ms ease-out;
}
.dropdown-content.open {
max-height: 500px; /* 大于内容高度 */
}
grid-template-rows: 平滑的高度变化max-height: 更简单但精度较低transform: 旋转 V 形图标opacity: 内容淡入淡出overflow: 在过渡期间隐藏每周安装量
52
代码仓库
GitHub 星标数
20
首次出现
2026 年 1 月 24 日
安全审计
安装于
codex45
gemini-cli42
opencode42
cursor40
github-copilot39
amp34
Apply Disney's 12 principles to expand/collapse elements for smooth, informative reveals.
Content can slightly compress as it collapses, stretch as it expands. Trigger header can squash on click feedback.
Before expanding, header briefly depresses. Chevron starts rotation before content reveals. Builds expectation.
Expanded section should be clearly visible. Consider dimming other accordion items. Active header stays highlighted.
Define clear states: collapsed, expanding, expanded, collapsing. Pose-to-pose for controlled, reversible animations.
Container expands first, content fades in 50-100ms later. Chevron rotation can overshoot and settle. Creates depth.
Expand: ease-out (fast start, smooth finish). Collapse: ease-in (slow start, fast finish). cubic-bezier(0.4, 0, 0.2, 1) works well.
Chevron rotation should ease through the arc. Content items can enter with slight arc paths rather than straight down.
While content reveals (primary), chevron rotates (secondary), sibling accordions may collapse (tertiary).
Important reveals can use more dramatic timing. FAQ accordions can have snappier animations. Match content importance.
Maintain consistent header heights. Content should not jitter during height animation. Use proper height techniques.
Smooth accordions feel polished. Janky height animations feel broken. Proper expand/collapse is worth the technical investment.
.accordion-content {
display: grid;
grid-template-rows: 0fr;
transition: grid-template-rows 300ms ease-out;
}
.accordion-content.open {
grid-template-rows: 1fr;
}
.accordion-inner {
overflow: hidden;
}
.accordion-chevron {
transition: transform 250ms ease-out;
}
.accordion-header[aria-expanded="true"] .accordion-chevron {
transform: rotate(180deg);
}
/* Alternative: animate max-height */
.dropdown-content {
max-height: 0;
overflow: hidden;
transition: max-height 300ms ease-out;
}
.dropdown-content.open {
max-height: 500px; /* larger than content */
}
grid-template-rows: smooth heightmax-height: simpler but less precisetransform: rotate chevronsopacity: content fadeoverflow: hidden during transitionWeekly Installs
52
Repository
GitHub Stars
20
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex45
gemini-cli42
opencode42
cursor40
github-copilot39
amp34
React视图过渡API使用指南:实现原生浏览器动画与状态管理
9,100 周安装
免费YouTube下载工具yt-dlp使用指南:离线下载视频、提取字幕、获取元数据
172 周安装
Keap CRM 集成指南:使用 Membrane CLI 实现营销自动化和客户关系管理
174 周安装
Readme生成器 - DevOps自动化工具,一键生成生产就绪的README文档
173 周安装
Next.js React Redux TypeScript 开发规范与最佳实践指南 - 构建可维护应用
177 周安装
基础设施监控指南:Prometheus+Grafana配置,实现系统性能与告警管理
175 周安装
数据研究智能体:复杂数据分析、模式识别与机器学习建模专家
172 周安装