软边圆形揭示的 Stories
圆角故事卡展示三张照片,分段进度条每 3 秒前进;点左右侧,新图以羽化圆形扫入,旧标题糊掉、新标题对焦。React Native 用 MaskedView 加 SVG。
灵感来自 @cabralorenzo 在 X 上发布的设计由 Now In Code 从零重建
import { Stories } from "./components";
export function Example() {
const progress = useSharedValue(0);
…
export function Example() {
const progress = useSharedValue(0);
…
Agent 提示词
Add the Now In Code component "stories-with-soft-radial-reveal" to this project. The full source is attached at the end of this prompt. Put the files under components/stories-with-soft-radial-reveal/, 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、Web
- 依赖
- Expo SDK 54+
- 权限
- Pro
- 更新于
- 2026年11月20日
- 许可证
- 无限商业项目
- 原始设计
- @cabralorenzo(X)
你是设计者吗? 请求我们修改或下架此作品.
CLI 与 MCP 服务器 即将推出
在终端添加作品,或让智能体自行获取。在此之前,用“复制提示词”也能做到。 文档
功能说明
一张圆角小故事卡片,内含三张全幅图片、顶部的分段进度条、一个日期标签和靠近底部的两行说明文字。每个故事运行几秒钟,其分段逐渐填满,然后自动前进。点按左侧返回,点按右侧前进。下一张图片通过一个带柔边的圆形揭示效果出现,从卡片侧边以外的一点开始,扫过并覆盖整张卡片。说明文字模糊淡出,新的说明文字在图片播放完毕前从模糊中清晰呈现。
实现方式
共享 JavaScript 核心中的一个纯函数,根据点击事件列表和时钟,计算当前故事、进度、揭示参数和说明文字状态。揭示效果是一个 MaskedView,其蒙版是 SVG 径向渐变,内半径、外半径和最低不透明度都来自核心。底部的柔和模糊由三层叠放的 MaskedView 和 LinearGradient 加在 BlurView 上构成。说明文字的模糊切换是清晰的 Text 与只带文字阴影的幽灵 Text 之间的交叉淡化。requestAnimationFrame 循环推进时间,三张照片为生成的图像。
适用场景
- 社交、旅行或产品导览内容的故事或精选集查看器
- 任何希望在幻灯片之间使用柔和圆形擦除效果的图片轮播
- 在摄影图片上使用渐进模糊、保证说明文字清晰可读的卡片
依赖
@react-native-masked-view/masked-viewexpo-blurexpo-linear-gradientreact-native-svgreact-native标签
模糊过渡卡片轮播交叉淡化进度条揭示社交文字动画