毛玻璃折页翻页
大图卡每 3 秒右半边绕中缝透视折过去;折起的页面是毛玻璃,透出身后的图片,模糊与压暗在折缝处几乎为零、向自由边加重。可拖动、轻扫或用方向键。WebGL 与 Skia 共用着色器。
灵感来自 @sumitXbravo 在 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 "frosted-glass-page-fold-flip" to this project. The full source is attached at the end of this prompt. Put the files under components/frosted-glass-page-fold-flip/, 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年10月28日
- 许可证
- 无限商业项目
- 原始设计
- @sumitXbravo(X)
你是设计者吗? 请求我们修改或下架此作品.
CLI 与 MCP 服务器 即将推出
在终端添加作品,或让智能体自行获取。在此之前,用“复制提示词”也能做到。 文档
功能说明
一个旅行风格的首页,包括大幅照片卡片、问候语、两个玻璃圆形按钮、标题、日期行、一组好友头像,以及带加号按钮的玻璃标签栏。卡片像翻页一样折叠。向左拖动会翻到下一张图片,向右拖动则返回,超出两端时会有阻力。页面掀起时会变成磨砂玻璃,模糊其下的图像并略微变暗,同时在它后面露出一张新照片。在翻页途中抓住页面,会从当前角度继续。超过翻页阈值或速度足够快时完成翻页,否则弹回。若不操作,屏幕会自动播放并循环。
实现方式
一个片段着色器绘制卡片。它判断每个像素是否位于投影后的页面内;若是,则对自由边缘上显示的图像应用可变模糊和变暗,否则输出卡片本身。五张卡片图片以子纹理的形式保持加载,由 uniform 选择,因此翻页时从不切换纹理。在 React Native 中,着色器运行于 Skia 画布,Reanimated 的帧回调在 UI 线程上推进共享控制器。Gesture Handler 的平移手势把抓取、拖动和释放调用传给该控制器。周围的界面使用 View、react-native-svg 图标,玻璃按钮使用 expo-linear-gradient。
适用场景
- 下一项会覆盖在当前项上翻过来的卡片或相册浏览器
- 带有主视觉卡片的旅行、回忆或图库首页
- 通过磨砂玻璃展示下一页的任何翻页器
依赖
@shopify/react-native-skiareact-native-reanimatedreact-native-gesture-handlerreact-native-svgexpo-linear-gradientreact-native标签
3D 旋转头像模糊过渡按钮卡片情感陪伴拖拽灵动岛翻转光效辉光渐变首页图标浅色液态玻璃极简形变社交弹簧状态切换滑动手势标签栏出行旅行