边缘透镜渐变轮播
三屏:圆形渐变窗口竖向跳动、靠近卡片边缘拉成彗尾,半透明玻璃丝带持续翻卷,导出轮播两端有固定透镜边缘。颗粒渐变均用 SkSL 生成,运行于 CanvasKit 与 Skia。
灵感来自 @basit_designs 在 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 "edge-lens-gradient-carousel" to this project. The full source is attached at the end of this prompt. Put the files under components/edge-lens-gradient-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月18日
- 许可证
- 无限商业项目
- 原始设计
- @basit_designs(X)
你是设计者吗? 请求我们修改或下架此作品.
CLI 与 MCP 服务器 即将推出
在终端添加作品,或让智能体自行获取。在此之前,用“复制提示词”也能做到。 文档
功能说明
来自同一个素材浏览应用流程的三个手机界面:首页列表、合集详情和导出成功页面。只有三个区域在运动。在首页上,第一张卡片右侧的三个圆形渐变窗口会上下瞬移。当它们接近卡片的上边缘或下边缘时,会拉伸成彗星状的尾巴,并带有青色色散边缘。第二张卡片中,半透明的玻璃丝带持续折叠。最后一个界面中,渐变卡片轮播横向滑动,在每一端,卡片向外弯曲,并带有虹彩边缘。详情界面是静态的程序化渐变背景。其余都是常规浅色主题界面:卡片、图标和深色按钮。
实现方式
共享核心文件保存时间线、布局、四个 SkSL 着色器(壁纸、水平透镜、垂直透镜、详情背景)、丝带网格,以及一个基于小型适配器接口编写的渲染器。一个适配器面向浏览器的 CanvasKit,另一个面向 React Native Skia。每一帧,轮播或传送带布局被记录为 Skia picture,转为 picture shader,并由透镜着色器作为子节点采样,透镜会在边缘处分离颜色通道。丝带是 vertices 网格。在 React Native 中,动画画布在 JS 线程上记录 picture,并通过 Reanimated shared value 传递,因此 React 无需重新渲染。
适用场景
- 用渐变卡片预览配色的素材、壁纸或调色板库
- 边缘项目应呈现透镜扭曲效果的轮播
- 带有移动玻璃丝带的导出或成功页面
依赖
@shopify/react-native-skiareact-native-reanimatedreact-native-svg标签
卡片轮播色散流体渐变颗粒质感首页浅色液态玻璃着色器