斜纹分段条统计卡
靛蓝到淡紫渐变的卡片,大号「7 in 10」,70/30 比例条左段为 45° 斜纹胶囊、右段为实心蓝,下面是带百分比的图例和三位客户头像。比例条自左填充,其余内容依次淡入。使用 SVG,共用 core。
灵感来自 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 "hatched-split-bar-stat-card" to this project. The full source is attached at the end of this prompt. Put the files under components/hatched-split-bar-stat-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 作品。提示词包含完整源码。开始使用
详情
你是设计者吗? 请求我们修改或下架此作品.
CLI 与 MCP 服务器 即将推出
在终端添加作品,或让智能体自行获取。在此之前,用“复制提示词”也能做到。 文档
功能说明
面向教练或面试类产品的深靛蓝到淡紫色统计卡片。小标题下方是大号的“7 in 10”数字和一行说明文字。下方是一条两段式比例条,按 70/30 分割:左段是白色斜线阴影,右段是纯色的淡蓝色。随后是带彩色圆点和粗体百分比的图例行、一条细分隔线,以及底部一行三个圆形客户头像及其占比。挂载时,比例条从左到右填充,纯色段比斜线段稍晚开始;图例、分隔线和底部一行依次淡入并上升几个像素。
实现方式
纯 JavaScript 核心保存布局、适配后的背景和斜纹几何,并提供一条根据时间 t 返回状态的开场时间轴。组件用 react-native-svg 绘制渐变背景、裁剪后的比例条段和斜纹,文字和头像则用普通 Text 与 Image 视图。requestAnimationFrame 循环把时间送入核心,因此没有使用 Reanimated。斜纹是显式的条纹路径,而不是 SVG 图案。背景由一个线性渐变加两处径向光晕组成。
适用场景
- 教练、面试或调研应用中的会话或通话分析
- 突出一个核心比例并在下方展示细分的内容,例如题型或套餐构成
- 需要带图例的分割比例条的深色仪表盘摘要
依赖
react-native-svgexpo-fontreact-native标签
数据分析头像卡片图表工作协作交叉淡化深色数据填充教育学习渐变数字进度条错峰入场