可拖转的卡片球与鱼眼卡片墙
方案一把 44 张物件卡片铺成可惯性拖转的球,点卡片弹到中央展开详情。方案二是隔行错开的竖卡无限墙,经凸透镜式映射,中央放大、边缘压暗变糊。
灵感来自 @atlasformac 在 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 "draggable-card-sphere-and-fisheye-card" to this project. The full source is attached at the end of this prompt. Put the files under components/draggable-card-sphere-and-fisheye-card/, 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年11月17日
- 许可证
- 无限商业项目
- 原始设计
- @atlasformac(X)
你是设计者吗? 请求我们修改或下架此作品.
CLI 与 MCP 服务器 即将推出
在终端添加作品,或让智能体自行获取。在此之前,用“复制提示词”也能做到。 文档
功能说明
深色欢迎页,上方是三行标题、一行辅助文字和一个灰色药丸按钮,下方是可交互的图片画廊。球体版本中,44 张圆角卡片排列在球面上,始终正面朝向观众,后方的卡片被间隙遮挡而变暗。单指可以自由旋转,松手后保留惯性。点击卡片会弹到中央,成为按原始宽高比显示的详情卡,三行说明文字淡入,其他卡片散开并淡出。再次点击会让它回到原位,球体也从中心重新聚拢。鱼眼版本是无尽的错列高卡片墙,经凸透镜映射,因此中心大而清晰,边缘则被压扁、变暗并模糊。
实现方式
除 React Native 核心外没有原生模块:使用普通的 View、Image、Text 和 Pressable,拖动则用 PanResponder。共享核心投影卡片,并在 requestAnimationFrame 循环中逐帧计算变换。React Native 无法模糊 View,因此模糊是根据卡片的模糊程度,在两张预先模糊的图片精灵之间交叉淡化来模拟的。文本对齐在竖屏时为左对齐,宽屏时为居中。
适用场景
- 注册前展示已保存内容的欢迎页或引导页
- 带点击放大详情视图的画廊或灵感板
- 无需原生依赖即可构建的产品或作品集浏览器
依赖
react-native标签
3D 旋转模糊过渡卡片深色拖拽展开收起网格极简引导页物理模拟