Morphing Blob
nyxui/morphing-blobFreeComponent
A morphing blob that that provide several effects.
Live preview
live · rendered by the registry
Rendered by shadcn/ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://nyxui.com/r/morphing-blob.jsonSource
1"use client";2import React, { useMemo, useRef, Suspense, useState, useEffect } from "react";3import { Canvas, useFrame, useThree } from "@react-three/fiber";4import {5 EffectComposer,6 Bloom,7 ChromaticAberration,8} from "@react-three/postprocessing";9import { Environment } from "@react-three/drei";10import * as THREE from "three";1112/* -------------------------- SHADERS ---------------------------- */1314const vertexShader = /* glsl */ `15 uniform float uTime;16 uniform float uComplexity;17 uniform float uSpeed;18 uniform vec2 uPointer;19 uniform float uInfluence;2021 varying vec3 vNormal;22 varying vec3 vPosition;23 varying vec3 vWorldPosition;2425 /* Simplex noise helpers ........................................ */26 vec3 mod289(vec3 x){return x-floor(x*(1./289.))*289.;}27 vec4 mod289(vec4 x){return x-floor(x*(1./289.))*289.;}28 vec4 permute(vec4 x){return mod289(((x*34.)+1.)*x);}29 vec4 taylorInvSqrt(vec4 r){return 1.79284291400159-0.85373472095314*r;}3031 float snoise(vec3 v){32 const vec2 C = vec2(1./6., 1./3.);33 const vec4 D = vec4(0.,.5,1.,2.);3435 vec3 i = floor(v + dot(v, C.yyy));36 vec3 x0 = v - i + dot(i, C.xxx);37 vec3 g = step(x0.yzx, x0.xyz);38 vec3 l = 1. - g;39 vec3 i1 = min(g.xyz, l.zxy);40 vec3 i2 = max(g.xyz, l.zxy);41 vec3 x1 = x0 - i1 + C.xxx;42 vec3 x2 = x0 - i2 + C.yyy;43 vec3 x3 = x0 - D.yyy;4445 i = mod289(i);46 vec4 p = permute( permute( permute(47 i.z + vec4(0., i1.z, i2.z, 1.))48 + i.y + vec4(0., i1.y, i2.y, 1.))49 + i.x + vec4(0., i1.x, i2.x, 1.));5051 float n_ = 1./7.;52 vec3 ns = n_ * D.wyz - D.xzx;5354 vec4 j = p - 49. * floor(p * ns.z * ns.z);55 vec4 x_ = floor(j * ns.z);56 vec4 y_ = floor(j - 7. * x_);5758 vec4 x = x_ * ns.x + ns.yyyy;59 vec4 y = y_ * ns.x + ns.yyyy;60 vec4 h = 1. - abs(x) - abs(y);6162 vec4 b0 = vec4(x.xy, y.xy);63 vec4 b1 = vec4(x.zw, y.zw);6465 vec4 s0 = floor(b0)*2.+1.;66 vec4 s1 = floor(b1)*2.+1.;67 vec4 sh = -step(h, vec4(0.));6869 vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy;70 vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww;7172 vec3 p0 = vec3(a0.xy,h.x);73 vec3 p1 = vec3(a0.zw,h.y);74 vec3 p2 = vec3(a1.xy,h.z);75 vec3 p3 = vec3(a1.zw,h.w);7677 vec4 norm = taylorInvSqrt(vec4(78 dot(p0,p0), dot(p1,p1), dot(p2,p2), dot(p3,p3)));79 p0 *= norm.x; p1 *= norm.y; p2 *= norm.z; p3*=norm.w;8081 vec4 m = max(0.6 - vec4(82 dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.);83 m = m*m;84 return 42. * dot(m*m, vec4(85// … truncated
What it pulls in
npm packages
Files it writes
More from shadcn/ui
All 68 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| 3D Layered Card3d-layered-card | shadcn/ui | Components | Free | 1 dep | |
| Animated Code Blockanimated-code-block | shadcn/ui | Components | Free | 3 deps | |
| Animated Grainy Backgroundanimated-grainy-bg | shadcn/ui | Components | Free | 1 dep | |
| Animated Textanimated-text | shadcn/ui | Components | Free | 1 dep | |
| Apple Glass Effectapple-glass-effect | shadcn/ui | Components | Free | 1 dep | |
| Bubble Backgroundbubble-background | shadcn/ui | Components | Free | no deps | |
| Custom Cursorcustom-cursor | shadcn/ui | Components | Free | 1 dep | |
| Cyberpunk Cardcyberpunk-card | shadcn/ui | Components | Free | no deps |
