六种卡片滚动形变效果
六张数据卡的循环轮播在移动时形变:Stretch、Bulge、Drum、碎片 Shatter、化尘 Thanos 或 RGB 分离的 Glitch。可拖动或滚动,卡片弹簧吸附,标签交叉切换效果。网页用 WebGL2,React Native 用 Skia。
灵感来自 @sucodeee 在 X 上发布的设计由 Now In Code 从零重建
import { Piece } from "./components";
export function Example() {
const progress = useSharedValue(0);
…
export function Example() {
const progress = useSharedValue(0);
…
Agent 提示词
Add the Now In Code component "six-deforming-card-scroll-effects" to this project. The full source is attached at the end of this prompt. Put the files under components/six-deforming-card-scroll-effects/, install the listed dependencies with `npx expo install`, and render it on a route I can open. Keep the timing and easing values documented in the source comments. Replace the sample copy and artwork with content from my app, or leave placeholders and list what I still need to supply. === Source files are attached here for paid plans ===
Pro 作品。提示词包含完整源码。开始使用
详情
- 平台
- iOS、Android、Web
- 依赖
- Expo SDK 54+
- 权限
- Pro
- 更新于
- 2026年9月28日
- 许可证
- 无限商业项目
- 原始设计
- @sucodeee(X)
你是设计者吗? 请求我们修改或下架此作品.
CLI 与 MCP 服务器 即将推出
在终端添加作品,或让智能体自行获取。在此之前,用“复制提示词”也能做到。 文档
功能说明
一个卡片轮播,在同一组六张插画卡片上依次切换六种滚动效果。一种效果会在卡片移动时拉伸它,一种会把它打碎成碎片,一种会把它溶解成漂移的粒子,一种添加故障撕裂,一种把卡片包裹在旋转的鼓面上,还有一种让中央卡片鼓起。拖动可以在卡片之间切换,当前效果同时作用于离开的卡片和到达的卡片,并以约四分之三秒的时间稳定下来。布局中,舞台下方有一个标签栏。
实现方式
所有几何都在共享核心中于 CPU 上计算,并以绘制列表的形式交给 Skia:变形网格通过 vertices 图元绘制,粒子通过图集绘制。着色器只负责采样类效果,即溶解阈值、故障、模糊和色散分离,并以 SkSL 运行时效果编写。requestAnimationFrame 循环将每一帧记录为 Picture,拖动由 PanResponder 处理。Reanimated 也被导入用于共享值,轮播位置遵循临界阻尼弹簧。
适用场景
- 每次过渡都需要有物理感的图库或故事卡片轮播
- 让条目瓦解消失的删除或关闭手势
- 可用于任何卡片的可复用网格和粒子变形来源
依赖
@shopify/react-native-skiareact-native-reanimatedreact-native标签
卡片轮播深色设计工具拖拽流体渐变品牌营销极简形变霓虹科技视差粒子状态切换滑动手势标签页