日记提示卡片轮播
左右滑动编号提示卡,居中的卡片增高,问题和正文淡入,两侧卡片缩回只显示数字。一个小型共享物理 core 负责拖动、吸附和分页圆点,用 react-native-svg 绘制。
灵感来自 @mobbin 在 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 "journal-prompt-scroll-carousel" to this project. The full source is attached at the end of this prompt. Put the files under components/journal-prompt-scroll-carousel/, 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 月 24 日
- 许可证
- 无限商业项目
- 原始设计
- @mobbin(X)
你是设计者吗? 请求我们修改或下架此作品.
CLI 与 MCP 服务器 即将推出
在终端添加作品,或让智能体自行获取。在此之前,用“复制提示词”也能做到。 文档
功能说明
浅灰色的日记界面,左上是圆形返回按钮,两行标题混用衬线体与粗体无衬线体,下方是白色圆角提示卡片的水平轮播。居中的卡片比相邻卡片更高,显示一个大号衬线数字、粗体问题和灰色段落;两侧的卡片只显示数字。下方是七个分页点,然后是黑色药丸按钮,以及一个悬浮的白色五项标签栏。拖动轮播会吸附到最近的卡片。快速轻扫会移动一张卡片,两端则以橡皮筋效果回弹。离开的卡片淡出,进入的卡片使文字展开到位。
实现方式
共享核心保存尺寸测量和运动模型。卡片高度随距中心的距离缩小,宽度保持固定;吸附遵循临界阻尼弹簧,不会过冲。requestAnimationFrame 循环推进模型,PanResponder 读取拖动和释放速度。卡片、文字、分页点和标签栏都是普通视图,图标使用 react-native-svg。衬线字体使用系统衬线体,因此不需要附带额外字体。
适用场景
- 日记或健康应用中的每日提示、语录或小贴士
- 从多个选项中选一个的选择器,聚焦的卡片会展示更多细节
- 每周主题或课程选择器,只有一个清晰的行动按钮
依赖
react-native-svgreact-native标签
卡片轮播交叉淡化日记写作浅色极简滚动驱动