Shader Gradient
着色器渐变
stylekitMITSaaS / B2B · saasGlassmorphism · glassmorphismGradient · gradientProfessional · professionalLight · lightMedium · mediumBlue · blueMedium · mediumSerif · serifLanding · landing
以实时 WebGL 片元着色器驱动的流动网格渐变作背景的高端 SaaS 美学。近黑画布上一层缓慢呼吸的虹彩渐变场,冻毛玻璃内容面板悬浮其上,干净现代无衬线配一支明亮强调色——Stripe / Linear / Vercel 首屏的活体渐变。
NNorthwind
Product · PricingSpecimen
Make the work feel finished
One interface, dressed in this style. Compare type, color, radius, and density.
128
Active
4.8
Score
12ms
Edge
Attribution
"Shader Gradient" from https://github.com/AnxForever/stylekit (MIT). © AnxForever. api/styles/shader-gradient @ bfa7da909e86.
https://github.com/AnxForever/stylekit · api/styles/shader-gradient · bfa7da909e86 · © AnxForever
Do
- 用真实 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,把动画预算留给着色器
Don't
- 禁止用静态渐变 PNG 或 CSS 关键帧假动画冒充实时着色器(廉价感的根源)
- 禁止不设 devicePixelRatio 上限(视网膜屏上像素爆炸、掉帧)
- 禁止离屏还在跑 rAF 循环(白白烧电烧 GPU)
- 禁止忽略 prefers-reduced-motion 或省略 WebGL 不可用回退
- 禁止文字直接压渐变场不加玻璃面板 / scrim(对比不达标)
- 禁止满屏多块 canvas 或多支抢眼强调色(毁掉高级克制感)
- 禁止让 DOM 元素做位移 / 阴影动画抢着色器的 GPU 预算
Prompt
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 --- "Shader Gradient" from https://github.com/AnxForever/stylekit (MIT). © AnxForever. api/styles/shader-gradient @ bfa7da909e86. powered by Styledex — https://styledex.dev
Tokens
DTCG
{
"$schema": "https://www.designtokens.org/schemas/2025.10/format.json",
"$description": "Shader Gradient. \"Shader Gradient\" from https://github.com/AnxForever/stylekit (MIT). © AnxForever. api/styles/shader-gradient @ bfa7da909e86.",
"$extensions": {
"dev.styledex": {
"id": "stylekit-shader-gradient",
"license": "MIT",
"attribution": "\"Shader Gradient\" from https://github.com/AnxForever/stylekit (MIT). © AnxForever. api/styles/shader-gradient @ bfa7da909e86.",
"banner": "powered by Styledex — https://styledex.dev"
}
},
"color": {
"background": {
"$type": "color",
"$value": "#08090d"
},
"foreground": {
"$type": "color",
"$value": "#ffffff"
},
"card": {
"$type": "color",
"$value": "#08090d"
},
"card-foreground": {
"$type": "color",
"$value": "#ffffff"
},
"primary": {
"$type": "color",
"$value": "#08090d"
},
"primary-foreground": {
"$type": "color",
"$value": "#fafaf9"
},
"secondary": {
"$type": "color",
"$value": "#edeef2"
},
"secondary-foreground": {
"$type": "color",
"$value": "#ffffff"
},
"accent": {
"$type": "color",
"$value": "#7c5cff"
},
"accent-foreground": {
"$type": "color",
"$value": "#fafaf9"
},
"muted": {
"$type": "color",
"$value": "#17181c"
},
"muted-foreground": {
"$type": "color",
"$value": "#a6a6a6"
},
"border": {
"$type": "color",
"$value": "#2b2b2f"
},
"destructive": {
"$type": "color",
"$value": "#dc2626"
},
"ring": {
"$type": "color",
"$value": "#08090d"
}
},
"font": {
"sans": {
"$type": "fontFamily",
"$value": [
"ui-sans-serif",
"system-ui",
"sans-serif"
]
},
"serif": {
"$type": "fontFamily",
"$value": [
"ui-serif",
"Georgia",
"serif"
]
},
"mono": {
"$type": "fontFamily",
"$value": [
"ui-monospace",
"SFMono-Regular",
"Menlo",
"monospace"
]
}
},
"radius": {
"base": {
"$type": "dimension",
"$value": "0.5rem"
}
},
"spacing": {
"base": {
"$type": "dimension",
"$value": "1rem"
}
},
"shadow": {
"base": {
"$type": "shadow",
"$value": "0 20px 60px rgba(0,0,0,0.45)"
}
}
}
CSS
/* powered by Styledex — https://styledex.dev */
/* "Shader Gradient" from https://github.com/AnxForever/stylekit (MIT). © AnxForever. api/styles/shader-gradient @ bfa7da909e86. */
:root {
--background: #08090d;
--foreground: #ffffff;
--card: #08090d;
--card-foreground: #ffffff;
--primary: #08090d;
--primary-foreground: #fafaf9;
--secondary: #edeef2;
--secondary-foreground: #ffffff;
--accent: #7c5cff;
--accent-foreground: #fafaf9;
--muted: #17181c;
--muted-foreground: #a6a6a6;
--border: #2b2b2f;
--destructive: #dc2626;
--ring: #08090d;
--radius: 0.5rem;
--font-sans: ui-sans-serif, system-ui, sans-serif;
--font-serif: ui-serif, Georgia, serif;
--font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
--spacing: 1rem;
--shadow: 0 20px 60px rgba(0,0,0,0.45);
}
Tailwind
/* powered by Styledex — https://styledex.dev */
/* "Shader Gradient" from https://github.com/AnxForever/stylekit (MIT). © AnxForever. api/styles/shader-gradient @ bfa7da909e86. */
/** Tailwind theme extend for Shader Gradient (stylekit-shader-gradient) */
module.exports = {
"theme": {
"extend": {
"colors": {
"background": "#08090d",
"foreground": "#ffffff",
"card": "#08090d",
"primary": "#08090d",
"primary-foreground": "#fafaf9",
"secondary": "#edeef2",
"accent": "#7c5cff",
"muted": "#17181c",
"border": "#2b2b2f",
"destructive": "#dc2626",
"ring": "#08090d"
},
"borderRadius": {
"lg": "0.5rem"
},
"fontFamily": {
"sans": [
"ui-sans-serif",
"system-ui",
"sans-serif"
],
"serif": [
"ui-serif",
"Georgia",
"serif"
],
"mono": [
"ui-monospace",
"SFMono-Regular",
"Menlo",
"monospace"
]
},
"boxShadow": {
"styledex": "0 20px 60px rgba(0,0,0,0.45)"
}
}
}
};
shadcn
/* powered by Styledex — https://styledex.dev */
/* "Shader Gradient" from https://github.com/AnxForever/stylekit (MIT). © AnxForever. api/styles/shader-gradient @ bfa7da909e86. */
@layer base {
:root {
--background: #08090d;
--foreground: #ffffff;
--card: #08090d;
--card-foreground: #ffffff;
--primary: #08090d;
--primary-foreground: #fafaf9;
--secondary: #edeef2;
--secondary-foreground: #ffffff;
--accent: #7c5cff;
--accent-foreground: #fafaf9;
--muted: #17181c;
--muted-foreground: #a6a6a6;
--border: #2b2b2f;
--destructive: #dc2626;
--ring: #08090d;
--radius: 0.5rem;
--font-sans: ui-sans-serif, system-ui, sans-serif;
--font-serif: ui-serif, Georgia, serif;
--font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
--spacing: 1rem;
--shadow: 0 20px 60px rgba(0,0,0,0.45);
}
}