域扭曲弥散渐变 Shader 卡片
五张竖长圆角卡片排在横向吸附滚动栏中,每张衬线标题下是持续动画的 Shader 背景。四张为单 pass 噪声 Shader,一张用多 pass 模糊 metaball 色团。网页用 WebGL,React Native 用 expo-gl。
灵感来自 X 上的一条帖子由 Now In Code 从零重建
import { Shader } from "./components";
export function Example() {
const progress = useSharedValue(0);
…
export function Example() {
const progress = useSharedValue(0);
…
Agent 提示词
Add the Now In Code component "domain-warped-diffuse-gradient-shader-cards" to this project. The full source is attached at the end of this prompt. Put the files under components/domain-warped-diffuse-gradient-shader-cards/, 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 服务器 即将推出
在终端添加作品,或让智能体自行获取。在此之前,用“复制提示词”也能做到。 文档
功能说明
一排五张高大的深色日程卡片,用于深度工作、家庭晚餐、放松、睡眠和平静早晨等专注模式。每张卡片有标题、时间范围、三点菜单,以及可选的继续标签。卡片背景是缓慢移动的扩散色场:蓝灰色丝绸带发光纹理、洋红与紫色的竖向辉光、深靛色的细丝、黎明式的混色,以及带细颗粒感的一组模糊发光斑点。整排卡片可以横向滚动并逐张吸附。
实现方式
每张卡片拥有一个由 expo-gl 提供的 GLView,在 requestAnimationFrame 循环中运行原生 WebGL 片段着色器。大多数背景是单通道着色器,先用分形噪声扭曲坐标,再通过色彩渐变和暗角映射结果。斑点卡片是多通道管线:先用 metaball 着色器渲染到纹理,重复一次小模糊,最后一通道加入噪声驱动的扭曲、饱和度提升和逐帧抖动。卡片在 FlatList 中布局并支持吸附。
适用场景
- 需要各自独立环境背景的日程、专注模式或日常流程卡片
- 静态渐变显得单调的主视觉或引导页背景
- 在文字后面放置活动色场的播放列表或心情磁贴
依赖
expo-glreact-native标签
按钮卡片深色流体光效辉光渐变健康健身极简习惯效率内容阅读着色器