Reaction Diffusion
MITA living Gray-Scott reaction-diffusion pattern that fills the layer and blooms wherever you drag the cursor
Cargando shader…
Ajústalo
0.0545
0.062
0.5
3
6
0.04
0.6
Instalación
Terminal
npx shadcn@latest add https://<tu-dominio>/r/shader-reaction-diffusion.json
Crea components/bastard/ShaderReactionDiffusion.tsx e instala shaders. Más opciones
Uso
Demo.tsx
1import ShaderReactionDiffusion from '@/components/bastard/ShaderReactionDiffusion';23export default function Demo() {4 return (5 <ShaderReactionDiffusion6 preset="coral"7 feed={0.0545}8 kill={0.062}9 diffusionRatio={0.5}10 featureSize={3}11 speed={6}12 brushSize={0.04}13 brushStrength={0.6}14 colorC="#38bdf8"15 colorB="#e2f5ff"16 />17 );18}
Props
| Prop | Tipo | Por defecto | Descripción |
|---|---|---|---|
| preset | 'coral' | 'mitosis' | 'spots' | 'maze' | 'worms' | 'fingerprints' | 'holes' | 'solitons' | 'bubbles' | 'waves' | 'flowers' | 'custom' | "coral" | Pattern |
| feed | number | 0.0545 | Feed |
| kill | number | 0.062 | Kill |
| diffusionRatio | number | 0.5 | Diffusion Ratio |
| featureSize | number | 3 | Feature Size |
| speed | number | 6 | Speed |
| brushSize | number | 0.04 | Brush Size |
| brushStrength | number | 0.6 | Brush Strength |
| colorC | string | "#38bdf8" | Wall Color |
| colorB | string | "#e2f5ff" | Cell Color |
Aquí aparecen las props ajustables. El componente acepta más: revisa el código fuente.
Créditos
Basado en Reaction Diffusion · Shaders.com, adaptado para BSTRD UI.Licencia: MIT. Puedes usarlo, modificarlo y venderlo, conservando el aviso de copyright que va dentro del archivo.