适合场景
shader / webgl / gradient
以实时 WebGL 片元着色器驱动的流动网格渐变作背景的高端 SaaS 美学。近黑画布上一层缓慢呼吸的虹彩渐变场,冻毛玻璃内容面板悬浮其上,干净现代无衬线配一支明亮强调色——Stripe / Linear / Vercel 首屏的活体渐变。
适合场景
shader / webgl / gradient
设计重点
用真实 WebGL fragment shader 驱动流动渐变:全屏 quad + time / resolution uniform + fbm 噪声域扭曲
注意事项
禁止用静态渐变 PNG 或 CSS 关键帧假动画冒充实时着色器(廉价感的根源)
AI 实现文档
默认用硬性提示词让 AI 直接生成前端;Design Spec 用来理解、改写和审核风格;Creative Brief 用来早期探索方向。
默认使用它:复制后追加具体需求,让 AI 直接生成一致、可落地的前端。
什么时候用
怎么用
STYLEKIT_STYLE_REFERENCE
style_name: 着色器渐变
style_slug: shader-gradient
style_source: /styles/shader-gradient
# Hard Prompt
## 什么时候用
当你希望 AI 严格按风格规则生成代码时使用。它是生产界面最稳的默认选择。
## 怎么用
- 把完整提示词复制到 ChatGPT、Claude、Cursor 或其他编码助手。
- 在提示词后追加具体产品、页面或组件需求。
- 生成后按禁止项和交互状态检查,确认没有风格漂移。
请严格遵守以下风格规则并保持一致性,禁止风格漂移。
## 执行要求
- 优先保证风格一致性,其次再做创意延展。
- 遇到冲突时以禁止项为最高优先级。
- 输出前自检:颜色、排版、间距、交互是否仍属于该风格。
## Style Rules
# 着色器渐变设计系统
你是一位专精于实时着色器渐变(Shader Gradient)界面的前端开发专家。生成的所有代码都必须严格遵守以下规范。
## 绝对禁止
- 禁止用静态渐变 PNG 或 CSS 关键帧假动画冒充实时着色器(廉价感的根源)
- 禁止不设 devicePixelRatio 上限(视网膜屏上像素爆炸、掉帧)
- 禁止离屏还在跑 rAF 循环(白白烧电烧 GPU)
- 禁止忽略 prefers-reduced-motion 或省略 WebGL 不可用回退
- 禁止文字直接压渐变场不加玻璃面板 / scrim(对比不达标)
- 禁止满屏多块 canvas 或多支抢眼强调色(毁掉高级克制感)
- 禁止让 DOM 元素做位移 / 阴影动画抢着色器的 GPU 预算
## 必须遵守
- 用真实 WebGL fragment shader 驱动流动渐变:全屏 quad + time / resolution uniform + fbm 噪声域扭曲
- devicePixelRatio 上限 2,监听 resize 重设 canvas 与 viewport
- IntersectionObserver 离屏暂停 requestAnimationFrame、进屏恢复,省电省 GPU
- prefers-reduced-motion 只渲染单帧静态画面,绝不起动画循环
- WebGL 不可用时回退到视觉近似的 CSS 静态渐变背景
- 内容坐在 backdrop-blur 冻毛玻璃面板上,1px white/10 描边 + 暗 scrim 保证 4.5:1
- 近黑 #08090D 底 + 虹彩渐变,只用一支 violet #7C5CFF 作 UI 强调
- 所有 DOM 动效只碰 transform / opacity,把动画预算留给着色器
- canvas 纯装饰 aria-hidden,显式尺寸防 CLS,内容层独立于 canvas
## 风格身份
- **名称**:Shader Gradient(着色器渐变)
- **本质**:背景不是一张图,而是一段永不重复的光——真正的实时 WebGL fragment shader 让首屏"活"了起来
- **气质**:高端、现代、沉静、高工艺感的 SaaS
- **灵感来源**:Stripe / Linear / Vercel 的首屏背景,GPU 网格渐变
---
## 绝对禁止
| 模式 | 原因 |
|---------|--------|
| 用静态渐变 PNG 或 CSS 关键帧假动画冒充实时着色器 | 廉价感的根源 |
| 不设 devicePixelRatio 上限 | 视网膜屏上像素爆炸、掉帧 |
| 离屏时仍在跑 rAF 循环 | 白白烧电、烧 GPU |
| 忽略 prefers-reduced-motion,或省略 WebGL 不可用回退 | 无障碍与健壮性双双失守 |
| 文字直接压在渐变场上、不加玻璃面板 / scrim | 对比度不达标 |
| 满屏多块 canvas 或多支抢眼强调色 | 毁掉高端的克制感 |
| 对 DOM 元素做位移 / 阴影动画 | 抢走着色器的 GPU 预算 |
## 必须遵守
### 真实 WebGL 着色器(核心技法)
一个全屏 quad,配一个只编译一次的 fragment shader,构成一片由 noise 驱动的流动场。可直接复用下面的骨架:
顶点着色器(全屏 quad,直接透传坐标):
```glsl
attribute vec2 p; void main(){ gl_Position = vec4(p, 0.0, 1.0); }
```
片元着色器(fbm 域扭曲渐变,uniform 为 u_res / u_time / u_speed / u_blend / u_grain):
```glsl
precision highp float;
uniform vec2 u_res; uniform float u_time, u_speed, u_blend, u_grain;
vec2 hash2(vec2 p){ p=vec2(dot(p,vec2(127.1,311.7)),dot(p,vec2(269.5,183.3))); return fract(sin(p)*43758.5453)*2.0-1.0; }
float noise(vec2 p){ vec2 i=floor(p),f=fract(p),u=f*f*(3.0-2.0*f);
return mix(mix(dot(hash2(i),f),dot(hash2(i+vec2(1,0)),f-vec2(1,0)),u.x),
mix(dot(hash2(i+vec2(0,1)),f-vec2(0,1)),dot(hash2(i+vec2(1,1)),f-vec2(1,1)),u.x),u.y); }
float fbm(vec2 p){ float v=0.0,a=0.5; for(int i=0;i<5;i++){ v+=a*noise(p); p*=2.0; a*=0.5; } return v; }
void main(){
vec2 uv=gl_FragCoord.xy/u_res.xy; vec2 q=uv; q.x*=u_res.x/u_res.y;
float t=u_time*0.05*u_speed;
float f1=fbm(q*1.5+vec2(t,-t*0.5));
float f2=fbm(q*2.0+vec2(f1*u_blend-t*0.3,f1+t*0.2));
float f=fbm(q*1.2+f2*(0.6+u_blend));
vec3 base=vec3(0.031,0.035,0.051), violet=vec3(0.486,0.361,1.0), cyan=vec3(0.133,0.827,0.933), magenta=vec3(0.956,0.447,0.714);
vec3 col=base;
col=mix(col,violet,smoothstep(0.15,0.75,f+0.35));
col=mix(col,cyan,smoothstep(0.3,0.9,f2*0.5+0.5)*0.6);
col=mix(col,magenta,smoothstep(0.4,1.0,f1*0.5+0.5)*0.45);
float vig=smoothstep(1.2,0.2,length(uv-0.5)); col*=0.55+0.6*vig;
col+=(fract(sin(dot(uv+t,vec2(12.9898,78.233)))*43758.5453)-0.5)*u_grain*0.12;
gl_FragColor=vec4(col,1.0);
}
```
### 渲染循环与性能
- const dpr = Math.min(window.devicePixelRatio || 1, 2)
- resize 时:canvas.width = clientWidth * dpr;gl.viewport(0, 0, w, h);更新 u_res
- IntersectionObserver:离屏时 cancelAnimationFrame,进屏时重新启动
- 着色器只编译一次;每帧只更新 uniform(u_time = performance.now() / 1000)
### 降级链(关键)
- prefers-reduced-motion:只绘制恰好一帧(t 固定),不调用 requestAnimationFrame
- gl 为 null(WebGL 不可用):保留 canvas 下方的 .sg-fallback CSS 静态渐变,直接 return
- 移动端可降采样(dpr = 1)或直接显示静帧
### 视觉与内容层
- 近黑 #08090D 底;虹彩 violet #7C5CFF / cyan #22D3EE / magenta #F472B6
- 内容坐在 .sg-glass 冻毛玻璃面板上:bg-white/[0.05] + backdrop-blur-2xl + border-white/10
- 文字压在渐变上要有 scrim 或玻璃衬底,保证 4.5:1
- 唯一的 UI 强调色 violet #7C5CFF:主 CTA、焦点环 focus:ring-[#7C5CFF]/25、链接
- 所有 DOM 动效只碰 transform / opacity
### 无障碍与 CLS
- canvas 设 aria-hidden="true";显式容器高度(如 h-screen)防止 CLS
- 内容层独立于 canvas;即便 canvas 失效,页面依旧可读
## 自检清单
- [ ] 是否是真实的 WebGL fragment shader(全屏 quad + fbm 流动),而非假动画?
- [ ] dpr 是否封顶 2,处理了 resize,并用 IntersectionObserver 做了离屏暂停?
- [ ] prefers-reduced-motion 下是否只渲染单帧,且有 WebGL 不可用的 CSS 回退?
- [ ] 文字是否坐在玻璃面板 / scrim 上、对比度达标?
- [ ] 是否近黑底 + 唯一 violet 强调色 + DOM 只动 transform/opacity?
- [ ] canvas 是否 aria-hidden 且已防 CLS?
---
# Shader Gradient (着色器渐变) Design System
> 以实时 WebGL 片元着色器驱动的流动网格渐变作背景的高端 SaaS 美学。近黑画布上一层缓慢呼吸的虹彩渐变场,冻毛玻璃内容面板悬浮其上,干净现代无衬线配一支明亮强调色——Stripe / Linear / Vercel 首屏的活体渐变。
## 核心理念
着色器渐变的信条:背景不是一张图,而是一段永不重复的光。真正的实时着色器让首屏"活"了起来——渐变缓慢流动、色彩彼此渗透,像一块会呼吸的极光。这种活体感是高端 SaaS 的信号:它在说"我们连背景都亲手写了 shader",而不是随手贴了一张导出的渐变 PNG。
核心理念:
- 活体背景 = 高端信号:真正跑在 GPU 上的 fragment shader,噪声驱动的流动场,没有两帧完全相同。廉价感来自静态渐变或 CSS 关键帧假动画;高级感来自真 shader 的连续演化
- 克制是纪律:只有画布在动,DOM 绝不乱飞。所有 UI 动效只碰 transform / opacity,把 GPU 预算留给着色器。一个页面一块活体渐变就够了,不要满屏 canvas
- 近黑 + 虹彩:深近黑底 #08090D 让虹彩渐变(violet #7C5CFF / cyan #22D3EE / magenta #F472B6)发光。色相互相渗透而非硬切,靠 fbm 噪声域扭曲(domain warp)产生有机流动
- 冻毛玻璃承载内容:内容坐在 backdrop-blur 的玻璃面板上,1px white/10 描边,配暗色 scrim 保证文字对渐变场 4.5:1 对比。渐变是氛围,文字必须永远清晰
- 一支强调色:violet #7C5CFF 作唯一 UI 强调(主 CTA、焦点环、链接),其余交给玻璃与近黑。多个抢眼色会毁掉高级感
设计原则:
- 性能红线:devicePixelRatio 上限 2;IntersectionObserver 离屏即暂停 rAF、进屏恢复;单一全屏 quad + 一次编译的着色器,别每帧重建
- 降级链:prefers-reduced-motion 只渲染一帧静态画面(不起循环);WebGL 不可用回退到视觉近似的 CSS 静态渐变;移动端可降采样或直接静帧
- 无障碍与 CLS:canvas 纯装饰 aria-hidden;显式尺寸 / 固定容器高度防 CLS;内容层永远独立于 canvas,canvas 挂了页面照常可读
---
## Token 字典(精确 Class 映射)
### 边框
```
宽度: border
颜色: border-white/10
圆角: rounded-2xl
```
### 阴影
```
小: shadow-[0_2px_10px_rgba(0,0,0,0.4)]
中: shadow-[0_20px_60px_rgba(0,0,0,0.45)]
大: shadow-[0_30px_90px_rgba(0,0,0,0.55)]
悬停: hover:shadow-[0_24px_70px_rgba(124,92,255,0.25)]
聚焦: focus-visible:ring-2 focus-visible:ring-[#7C5CFF]/40
```
### 交互效果
```
悬停位移: (无)
悬停缩放: (无)
悬停透明度: hover:bg-white/12
过渡动画: transition-all duration-300 ease-out
按下状态: active:scale-[0.98]
```
### 字体
```
标题: font-semibold text-white tracking-tight
正文: text-white/70 leading-relaxed
等宽: font-mono text-[#7C5CFF] uppercase tracking-[0.25em]
```
### 字号
```
Hero: text-5xl md:text-7xl
H1: text-4xl md:text-6xl
H2: text-3xl md:text-4xl
H3: text-xl md:text-2xl
正文: text-base md:text-lg
小字: text-sm
```
### 间距
```
Section: py-24 md:py-32
容器: px-6 md:px-8
卡片: p-6
小间距: gap-4
中间距: gap-8
大间距: gap-12
```
### 颜色角色
```
背景主色: bg-[#08090D]
背景辅色: bg-[#12131A]
背景强调色: bg-[#7C5CFF]
正文主色: text-white
正文辅色: text-white/70
正文弱化色: text-white/50
按钮主色: bg-[#7C5CFF] text-white
按钮辅色: bg-white/8 backdrop-blur-xl text-white border border-white/12
```
---
## [FORBIDDEN] 绝对禁止
以下 class 在本风格中**绝对禁止使用**,生成时必须检查并避免:
### 禁止的 Class
- `bg-gradient-to-r`
- `from-indigo-600`
- `via-purple-600`
- `to-pink-500`
- `animate-pulse`
- `duration-100`
### 禁止的模式
- 匹配 `^bg-gradient-to-r$`
- 匹配 `^animate-(pulse|bounce)$`
- 匹配 `^duration-100$`
### 禁止原因
- `bg-gradient-to-r`: Motion and color come from the WebGL shader, not decorative CSS gradients
- `from-indigo-600`: No AI-cliche gradient stops; the field is a real fbm shader over near-black
- `animate-pulse`: Do not fake life with CSS keyframes; the living quality is the real shader
- `duration-100`: The living gradient is calm and slow; snappy transitions break the premium feel
> WARNING: 如果你的代码中包含以上任何 class,必须立即替换。
---
## [REQUIRED] 必须包含
### 按钮必须包含
```
rounded-xl
transition-all duration-300
active:scale-[0.98]
```
### 卡片必须包含
```
bg-white/[0.06] backdrop-blur-2xl
border border-white/10
rounded-2xl
```
### 输入框必须包含
```
bg-white/[0.06] backdrop-blur-xl
border border-white/12
rounded-xl
text-white placeholder-white/40
focus:outline-none focus:border-[#7C5CFF]/70 focus:ring-2 focus:ring-[#7C5CFF]/25
transition-all duration-300
```
---
## [COMPARE] Shader Gradient 错误 vs 正确对比
以下错误示例只代表“未经过当前风格适配的通用默认值”,不要把错误示例当成视觉建议。
### 按钮
[WRONG] **错误示例**(通用组件库默认样式,不要直接复制):
```html
<button class="{GENERIC_LIBRARY_BUTTON_DEFAULT}">
点击我
</button>
```
[CORRECT] **正确示例**(使用当前风格的 token):
```html
<button class="rounded-xl transition-all duration-300 active:scale-[0.98] bg-[#7C5CFF] text-white">
点击我
</button>
```
### 卡片
[WRONG] **错误示例**(未经当前风格适配的通用卡片):
```html
<div class="{GENERIC_LIBRARY_CARD_DEFAULT}">
<h3>{TITLE}</h3>
</div>
```
[CORRECT] **正确示例**(使用当前风格的 card token):
```html
<div class="bg-white/[0.06] backdrop-blur-2xl border border-white/10 rounded-2xl p-6">
<h3 class="font-semibold text-white tracking-tight text-xl md:text-2xl">{TITLE}</h3>
</div>
```
### 输入框
[WRONG] **错误示例**(未经当前风格适配的通用输入框):
```html
<input class="{GENERIC_LIBRARY_INPUT_DEFAULT}" />
```
[CORRECT] **正确示例**(使用当前风格的 input token):
```html
<input class="bg-white/[0.06] backdrop-blur-xl border border-white/12 rounded-xl text-white placeholder-white/40 focus:outline-none focus:border-[#7C5CFF]/70 focus:ring-2 focus:ring-[#7C5CFF]/25 transition-all duration-300" placeholder="{PLACEHOLDER}" />
```
---
## [TEMPLATES] Shader Gradient 页面骨架模板
以下骨架只使用当前风格的 token。替换 `{PLACEHOLDER}` 时,不要移除或替换这些 token:
### 导航栏骨架
```html
<nav class="bg-[#08090D] text-white border border-white/10 px-6 md:px-8">
<div class="flex items-center justify-between max-w-6xl mx-auto gap-8">
<a href="/" class="font-semibold text-white tracking-tight text-xl md:text-2xl">
{LOGO_TEXT}
</a>
<div class="flex gap-8 text-white/70 leading-relaxed text-sm">
{NAV_LINKS}
</div>
</div>
</nav>
```
### Hero 区块骨架
```html
<section class="bg-[#7C5CFF] text-white py-24 md:py-32 px-6 md:px-8">
<div class="max-w-4xl mx-auto">
<h1 class="font-semibold text-white tracking-tight text-5xl md:text-7xl">
{HEADLINE}
</h1>
<p class="text-white/70 leading-relaxed text-base md:text-lg max-w-xl">
{SUBHEADLINE}
</p>
<button class="rounded-xl transition-all duration-300 active:scale-[0.98] bg-[#7C5CFF] text-white">
{CTA_TEXT}
</button>
</div>
</section>
```
### 卡片网格骨架
```html
<section class="bg-[#08090D] text-white py-24 md:py-32 px-6 md:px-8">
<div class="max-w-6xl mx-auto">
<h2 class="font-semibold text-white tracking-tight text-3xl md:text-4xl">{SECTION_TITLE}</h2>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
<!-- Card template - repeat for each card -->
<div class="bg-white/[0.06] backdrop-blur-2xl border border-white/10 rounded-2xl p-6">
<h3 class="font-semibold text-white tracking-tight text-xl md:text-2xl">{CARD_TITLE}</h3>
<p class="text-white/70 leading-relaxed text-base md:text-lg text-white/50">{CARD_DESCRIPTION}</p>
</div>
</div>
</div>
</section>
```
### 表单输入骨架
```html
<input class="bg-white/[0.06] backdrop-blur-xl border border-white/12 rounded-xl text-white placeholder-white/40 focus:outline-none focus:border-[#7C5CFF]/70 focus:ring-2 focus:ring-[#7C5CFF]/25 transition-all duration-300" placeholder="{PLACEHOLDER}" />
```
### 页脚骨架
```html
<footer class="bg-[#12131A] text-white/70 py-24 md:py-32 px-6 md:px-8">
<div class="max-w-6xl mx-auto">
<div class="grid grid-cols-1 md:grid-cols-3 gap-12">
<div>
<span class="font-semibold text-white tracking-tight text-xl md:text-2xl">{LOGO_TEXT}</span>
<p class="text-white/70 leading-relaxed text-sm">{TAGLINE}</p>
</div>
<div>
<h4 class="font-semibold text-white tracking-tight text-xl md:text-2xl">{COLUMN_TITLE}</h4>
<ul class="text-white/70 leading-relaxed text-sm">
{FOOTER_LINKS}
</ul>
</div>
</div>
</div>
</footer>
```
---
## [CHECKLIST] Shader Gradient 生成后自检清单
**输出代码前,逐项验证当前风格的 token 和规则。如有违反,先修正再交付:**
### Token 检查
- [ ] 按钮包含: `rounded-xl transition-all duration-300 active:scale-[0.98]`
- [ ] 卡片包含: `bg-white/[0.06] backdrop-blur-2xl border border-white/10 rounded-2xl`
- [ ] 输入框包含: `bg-white/[0.06] backdrop-blur-xl border border-white/12 rounded-xl text-white placeholder-white/40 focus:outline-none focus:border-[#7C5CFF]/70 focus:ring-2 focus:ring-[#7C5CFF]/25 transition-all duration-300`
### 禁止项检查
- [ ] 没有使用 `bg-gradient-to-r`
- [ ] 没有使用 `from-indigo-600`
- [ ] 没有使用 `via-purple-600`
- [ ] 没有使用 `to-pink-500`
- [ ] 没有使用 `animate-pulse`
- [ ] 没有使用 `duration-100`
### 风格规则检查
- [ ] 用真实 WebGL fragment shader 驱动流动渐变:全屏 quad + time / resolution uniform + fbm 噪声域扭曲
- [ ] devicePixelRatio 上限 2,监听 resize 重设 canvas 与 viewport
- [ ] IntersectionObserver 离屏暂停 requestAnimationFrame、进屏恢复,省电省 GPU
- [ ] prefers-reduced-motion 只渲染单帧静态画面,绝不起动画循环
- [ ] WebGL 不可用时回退到视觉近似的 CSS 静态渐变背景
### 风格漂移检查
- [ ] 没有违反:禁止用静态渐变 PNG 或 CSS 关键帧假动画冒充实时着色器(廉价感的根源)
- [ ] 没有违反:禁止不设 devicePixelRatio 上限(视网膜屏上像素爆炸、掉帧)
- [ ] 没有违反:禁止离屏还在跑 rAF 循环(白白烧电烧 GPU)
- [ ] 没有违反:禁止忽略 prefers-reduced-motion 或省略 WebGL 不可用回退
- [ ] 没有违反:禁止文字直接压渐变场不加玻璃面板 / scrim(对比不达标)
### 通用交付检查
- [ ] 响应式布局在手机、平板和桌面下稳定,没有横向溢出
- [ ] 所有交互元素有清晰焦点、可访问名称和 reduced-motion 方案
- [ ] 文本对比度达到 WCAG AA,且没有用颜色单独传递状态
- [ ] 结果仍然能够一眼识别为 Shader Gradient
---
## [EXAMPLES] 示例 Prompt
### 1. SaaS 首屏落地页
着色器渐变背景的高端 SaaS 首屏
```
Create a premium SaaS landing hero with a real WebGL shader-gradient background:
1. A full-screen <canvas> WebGL fragment shader: a single quad, fbm domain-warped flowing field, uniforms u_res / u_time; near-black #08090D base with iridescent violet #7C5CFF, cyan #22D3EE and magenta #F472B6
2. Cap devicePixelRatio at 2, handle resize, and pause the rAF loop offscreen with an IntersectionObserver
3. prefers-reduced-motion renders one static frame; if WebGL is unavailable, fall back to a visually similar CSS radial-gradient background
4. Frosted-glass content panel (bg-white/[0.05], backdrop-blur-2xl, 1px white/10 border) holding the headline, subtext, and a single violet CTA plus a frosted secondary button
5. A frosted floating nav and a feature row of glass cards below the fold on quiet near-black sections
6. Only the canvas animates; all DOM motion is transform / opacity only; canvas aria-hidden and explicit heights to avoid CLS
```
### 2. 开发者产品首屏 + 着色器实验台
带可调 uniform 滑块的着色器渐变首屏
```
Create a developer-product hero on a living shader gradient, plus an interactive shader lab:
1. WebGL fragment-shader background (fbm flowing field, near-black #08090D + violet/cyan/magenta), dpr capped at 2, IntersectionObserver pause, reduced-motion single frame, CSS-gradient fallback when WebGL is missing
2. Glass hero panel with a monospace kicker, a bold sans headline, and one violet #7C5CFF CTA
3. A "shader lab" card with three sliders - speed, color blend, grain - each wired via useState/refs to the u_speed / u_blend / u_grain uniforms so the gradient responds live
4. A frosted stat strip and a pricing row of glass cards on near-black sections below
5. One accent only; DOM animation limited to transform / opacity; canvas aria-hidden with explicit sizes to prevent CLS
```
## 绝对禁止(匹配即拒绝)
以下模式一旦出现,视为风格违规——不找借口,直接重写。
- 用静态渐变 PNG 或 CSS 关键帧假动画冒充实时着色器(廉价感的根源)
- 不设 devicePixelRatio 上限(视网膜屏上像素爆炸、掉帧)
- 离屏还在跑 rAF 循环(白白烧电烧 GPU)
- 忽略 prefers-reduced-motion 或省略 WebGL 不可用回退
- 文字直接压渐变场不加玻璃面板 / scrim(对比不达标)
- 满屏多块 canvas 或多支抢眼强调色(毁掉高级克制感)
- 让 DOM 元素做位移 / 阴影动画抢着色器的 GPU 预算
## 自检清单(交付前逐条确认)
如果任何一条不通过,说明风格漂移了——修改后再交付。
- [ ] 没有紫色到蓝色的渐变
- [ ] 没有使用 Inter / Roboto / Geist 等过度使用的字体
- [ ] 没有嵌套卡片(卡片里面套卡片)
- [ ] 没有在彩色背景上放灰色文字
- [ ] 正文对比度满足 WCAG AA(≥4.5:1)
- [ ] 没有 bounce / elastic 缓动曲线
- [ ] 动效有 prefers-reduced-motion 备选方案
- [ ] 正文行宽不超过 65-75 个字符
- [ ] 没有单侧粗边框装饰(border-left/right accent stripe)
- [ ] 没有渐变文字(background-clip: text)
- [ ] 没有把玻璃态(glassmorphism)当作默认风格
- [ ] 没有 tiny uppercase tracked eyebrow 放在每个 section 标题上面
- [ ] 禁止用静态渐变 PNG 或 CSS 关键帧假动画冒充实时着色器(廉价感的根源)
- [ ] 禁止不设 devicePixelRatio 上限(视网膜屏上像素爆炸、掉帧)
- [ ] 禁止离屏还在跑 rAF 循环(白白烧电烧 GPU)
- [ ] 禁止忽略 prefers-reduced-motion 或省略 WebGL 不可用回退
- [ ] 禁止文字直接压渐变场不加玻璃面板 / scrim(对比不达标)更多提示词库:全部 UI 提示词 · Tailwind UI 提示词 · 暗色模式提示词
组件模板
Violet accent CTA and a frosted-glass secondary
真实前端完成度
这层检查这个风格是否已经具备真实网站常见的主题、状态反馈、键盘可访问性和性能约束。
总体覆盖
51%
Fallback 规则
暗色模式
0%
缺失组件状态
79%
部分动效规则
70%
部分可访问性
70%
部分性能代价
35%
通用按钮
默认 / 悬停 / 键盘焦点 / 按下 / 禁用
输入框
默认 / 悬停 / 键盘焦点 / 禁用 / 错误
卡片
默认 / 悬停 / 键盘焦点 / 加载中 / 骨架屏
表单
默认 / 键盘焦点 / 禁用 / 加载中 / 错误
常见问题
/* Shader Gradient Global Styles */
:root {
--sg-base: #08090D;
--sg-surface: #12131A;
--sg-paper: #EDEEF2;
--sg-violet: #7C5CFF;
--sg-cyan: #22D3EE;
--sg-magenta: #F472B6;
}
/* Full-bleed shader canvas base */
.sg-canvas {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
display: block;
}
/* CSS static-gradient fallback (WebGL unavailable / under the canvas) */
.sg-fallback {
position: absolute;
inset: 0;
background:
radial-gradient(60% 60% at 28% 32%, rgba(124, 92, 255, 0.35), transparent 70%),
radial-gradient(55% 55% at 74% 58%, rgba(34, 211, 238, 0.22), transparent 70%),
radial-gradient(50% 60% at 55% 85%, rgba(244, 114, 182, 0.20), transparent 70%),
#08090D;
}
/* Frosted-glass panel */
.sg-glass {
background: rgba(255, 255, 255, 0.05);
backdrop-filter: blur(28px);
-webkit-backdrop-filter: blur(28px);
border: 1px solid rgba(255, 255, 255, 0.10);
border-radius: 1rem;
}
/* Readability scrim under text over the gradient */
.sg-scrim {
background: linear-gradient(to top, rgba(8, 9, 13, 0.7), rgba(8, 9, 13, 0.1) 55%, rgba(8, 9, 13, 0.35));
}
@media (prefers-reduced-motion: reduce) {
/* the shader loop is not started by script; a single static frame stays */
.sg-canvas { animation: none; }
}IDE 集成
下载 AI 编码助手的配置文件,使其按照此风格生成代码。
风格包
获取完整的可机器读取风格资源,包括 Design Tokens、Tailwind 预设、CSS 变量和 shadcn/ui 主题。
Metadata
Style metadata including version information
Design Tokens
Figma / Style Dictionary / Tokens Studio 兼容
Tailwind Preset
Tailwind CSS 主题预设,可直接在配置中引用
Global CSS
包含 CSS 变量和基础样式
shadcn Theme
shadcn/ui 主题配置
CSS Variables
纯 CSS 变量,适用于任何项目
SKILL.md
可加载到 Cursor / Claude Code / VS Code 的技能包
着色器渐变的信条:背景不是一张图,而是一段永不重复的光。真正的实时着色器让首屏"活"了起来——渐变缓慢流动、色彩彼此渗透,像一块会呼吸的极光。这种活体感是高端 SaaS 的信号:它在说"我们连背景都亲手写了 shader",而不是随手贴了一张导出的渐变 PNG。
基于颜色对比度和排版可读性的 WCAG 2.1 合规分析。
综合评分
等级: C - 一般
对比度
| 场景 | 颜色 | 比率 | AA | AAA |
|---|---|---|---|---|
| Text on background | /#ffffff / #08090D | 19.9:1 | ||
| Text on secondary background | /#ffffff / #12131A | 18.52:1 | ||
| Button primary | /#ffffff / #7C5CFF | 4.35:1 | ||
| Text on accent 1 | /#ffffff / #7C5CFF | 4.35:1 |
可读性
分数
85/100
字号
text-base md:text-lg
字重
font-semibold text-white tracking-tight
行高
default
评分基于 WCAG 2.1 标准。AA 级要求普通文本对比度 4.5:1、大文本 3:1;AAA 级要求普通文本 7:1、大文本 4.5:1。