Aurora Flow
componentry/aurora-flowFreeComponent
A procedural atmospheric hero background with layered flowing color, diffused aurora light, and subtle interaction.
Live preview
live · rendered by the registry
Rendered by componentry on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://componentry.dev/r/aurora-flow.jsonSource
1"use client";23import * as React from "react";4import { cn } from "@/lib/utils";5import { WebGLErrorBoundary } from "./webgl-error-boundary";67const VERTEX_SHADER = `8attribute vec2 position;910void main() {11 gl_Position = vec4(position, 0.0, 1.0);12}13`;1415const FRAGMENT_SHADER = `16precision highp float;1718uniform vec2 u_res;19uniform vec2 u_pointer;20uniform vec2 u_flowDirection;21uniform float u_time;22uniform float u_speed;23uniform float u_animationSpeed;24uniform float u_intensity;25uniform float u_opacity;26uniform float u_blur;27uniform float u_contrast;28uniform float u_brightness;29uniform float u_layers;30uniform float u_flowScale;31uniform float u_flowStrength;32uniform float u_pointerStrength;33uniform float u_scroll;34uniform float u_parallaxStrength;35uniform float u_grainOpacity;36uniform float u_noiseOpacity;37uniform float u_noiseScale;38uniform float u_lighting;39uniform float u_lightingIntensity;40uniform float u_lightingRadius;41uniform float u_lightingSpeed;42uniform float u_ambientGlow;43uniform float u_ambientOpacity;44uniform float u_vignette;45uniform vec3 u_color0;46uniform vec3 u_color1;47uniform vec3 u_color2;48uniform vec3 u_color3;49uniform vec3 u_color4;5051float hash(vec2 p) {52 return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);53}5455float valueNoise(vec2 p) {56 vec2 i = floor(p);57 vec2 f = fract(p);58 vec2 u = f * f * (3.0 - 2.0 * f);5960 float a = hash(i);61 float b = hash(i + vec2(1.0, 0.0));62 float c = hash(i + vec2(0.0, 1.0));63 float d = hash(i + vec2(1.0, 1.0));6465 return mix(mix(a, b, u.x), mix(c, d, u.x), u.y);66}6768mat2 rotate2d(float angle) {69 float s = sin(angle);70 float c = cos(angle);71 return mat2(c, -s, s, c);72}7374float fbm(vec2 p) {75 float value = 0.0;76 float amplitude = 0.52;77 mat2 turn = mat2(0.84, 0.54, -0.54, 0.84);7879 for (int i = 0; i < 7; i++) {80 float enabled = step(float(i) + 0.5, u_layers);81 value += amplitude * valueNoise(p) * enabled;82 p = turn * p * 2.03 + 0.17;83 amplitude *= 0.5;84 }8586 return value;87}8889vec3 grade(vec3 color, float contrast, float brightness) {90 color = (color - 0.5) * contrast + 0.5;91 return color * brightness;92}9394void main() {95 vec2 uv = gl_FragCoord.xy / u_res;96 float aspect = u_res.x / max(u_res.y, 1.0);97 vec2 p = (uv - 0.5) * vec2(aspect, 1.0);9899 float t = u_time * 0.075 * u_speed * u_animationSpeed;100 vec2 direction = normalize(u_flowDirection + vec2(0.0001));101 vec2 crossDirection = vec2(-direction.y, direction.x);102103 vec2 pointer = (u_pointer - 0.5) * vec2(aspect, 1.0);104// … truncated
More from componentry
All 59 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Animated Gradientanimated-gradient | componentry | Components | Free | no deps | |
| ASCII Effectascii-effect | componentry | Components | Free | no deps | |
| auth-modalauth-modal | componentry | Components | Free | no deps | |
| border-beamborder-beam | componentry | Components | Free | no deps | |
| circuit-boardcircuit-board | componentry | Components | Free | no deps | |
| closing-plasmaclosing-plasma | componentry | Components | Free | no deps | |
| collection-surfercollection-surfer | componentry | Components | Free | no deps | |
| Command Menucommand-menu | componentry | Components | Free | no deps |
