滑动叠卡与 Coverflow
叠卡模式下前卡随手指倾斜,拖过 96pt 或快速轻扫即甩出,后卡依次补位。Coverflow 模式下侧卡以透视朝观者弯成凹弧,每拖 160pt 翻一页,两端有橡皮筋回弹。
灵感来自 @liaquiqui 在 X 上发布的设计由 Now In Code 从零重建
import { Coverflow } from "./components";
export function Example() {
const progress = useSharedValue(0);
…
export function Example() {
const progress = useSharedValue(0);
…
Agent 提示词
Add the Now In Code component "swipe-card-stack-and-coverflow" to this project. The full source is attached at the end of this prompt. Put the files under components/swipe-card-stack-and-coverflow/, 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
- 依赖
- Expo SDK 54+
- 权限
- Pro
- 更新于
- 2026年10月26日
- 许可证
- 无限商业项目
- 原始设计
- @liaquiqui(X)
你是设计者吗? 请求我们修改或下架此作品.
CLI 与 MCP 服务器 即将推出
在终端添加作品,或让智能体自行获取。在此之前,用“复制提示词”也能做到。 文档
功能说明
两个卡片钱包原型,分别展示在两部手机上。在堆叠版本中,多种颜色的支付卡一张压着一张,只露出后面三张卡的细边。拖动最上层的卡片时,它会跟随手指并略微倾斜;快速甩出时,它会带着额外的旋转飞出左边缘,然后回到牌堆底部。当最上层卡片移动时,后面的卡片也向前移动,第四层的边缘淡入。在封面流版本中,卡片水平排列,中间一张较大,其余卡片向后转动并缩小。拖动可以翻页,拉过任一端时会像橡皮筋一样回弹。卡面显示芯片、卡号行和持卡人姓名。
实现方式
共享的 JavaScript 核心保存卡片几何、拖动和甩出的物理模型,以及脚本化的演示。React Native 文件导出堆叠组件、封面流组件和卡面组件,使用 react-native-svg 和普通变换来渲染。堆叠使用每层约 1 减去 0.077 的缩放,甩出则遵循指数逼近屏幕外某点的曲线。拖动使用 React Native 自带的触摸处理。时间来自 requestAnimationFrame 循环。没有使用物理引擎或 Reanimated。
适用场景
- 支付卡或会员卡的钱包
- 用于浏览优惠、票券或已保存项目的可滑动堆叠
- 中间项目应当突出显示的水平选择器
依赖
react-native-svgreact-native标签
3D 旋转卡片卡片堆叠拖拽金融钱包渐变浅色会员卡极简物理模拟转场拟物3D弹簧滑动手势