带里程碑标尺的跑步记录
毛玻璃标尺每 10km 一格,松手后回弹到当前距离。卡片逐帧计数距离、配速和时间,路线自行描绘;第二屏有弧形仪表和可在地区间平移的地图卡。
灵感来自 @sujon_co 在 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 "running-tracker-with-milestone-ruler" to this project. The full source is attached at the end of this prompt. Put the files under components/running-tracker-with-milestone-ruler/, 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月22日
- 许可证
- 无限商业项目
- 原始设计
- @sujon_co(X)
你是设计者吗? 请求我们修改或下架此作品.
CLI 与 MCP 服务器 即将推出
在终端添加作品,或让智能体自行获取。在此之前,用“复制提示词”也能做到。 文档
功能说明
一个两屏的跑步记录应用。首页有头像、一条水平距离标尺(标有“Now”和 300 公里外的“Next goal”标签)、最近一次跑步的卡片,以及位于标签栏上方的两张小统计卡片。标尺可拖动,靠近各标签的刻度会变长并改变颜色,读数跟随移动,松手后缓缓回弹。记录页有标题、搜索栏、时间筛选器、血氧仪表、速度卡片、里程碑地图卡片,以及心率和卡路里卡片。数字会逐步计数,跑步路线会逐步绘制,里程碑卡片依次经历四个状态:地图平移到十字准星,气泡模糊地淡出再淡入,数字滚动更新。
实现方式
核心模块保存常量、时间线表,以及标尺、仪表和地图的几何数据;场景模块将其转换为显示列表,在 SVG 图层与玻璃图层之间交替。React Native 组件使用 react-native-svg 绘图,用 expo-blur 为标尺提供玻璃效果,用 PanResponder 处理拖动,并通过 expo-google-fonts 加载字体。地图以固定比例使用墨卡托投影。仪表和标尺是手工绘制的,没有使用图表包。
适用场景
- 带有距离目标和历史记录的健身或跑步应用
- 用于选择或预览目标值的可拖动标尺
- 用十字准星在各个成就之间跳转的地图卡片
依赖
@expo-google-fonts/urbanistexpo-blurreact-native-svgreact-native标签
卡片图表拖拽健康健身液态玻璃地图数字滚动路径描绘进度条标签栏