Docs/Fondos

Reaction Diffusion

MIT

A 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';
2
3export default function Demo() {
4 return (
5 <ShaderReactionDiffusion
6 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

PropTipoPor defectoDescripción
preset'coral' | 'mitosis' | 'spots' | 'maze' | 'worms' | 'fingerprints' | 'holes' | 'solitons' | 'bubbles' | 'waves' | 'flowers' | 'custom'"coral"Pattern
feednumber0.0545Feed
killnumber0.062Kill
diffusionRationumber0.5Diffusion Ratio
featureSizenumber3Feature Size
speednumber6Speed
brushSizenumber0.04Brush Size
brushStrengthnumber0.6Brush Strength
colorCstring"#38bdf8"Wall Color
colorBstring"#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.