1import{c as g,u as i,s as n,b as y,a as r}from"./helpers-CxDxNF8W.js";var p=` 2precision highp float; 3 4uniform vec2 u_resolution; 5uniform float u_time; 6uniform float u_speed; 7uniform float u_size; 8uniform vec2 u_position; 9uniform vec3 u_baseColor; 10uniform vec3 u_accent; 11uniform vec3 u_highlight; 12uniform float u_vignetteStrength; 13uniform float u_vignetteMin; 14uniform float u_vignetteRange; 15 16vec3 mod289(vec3 x) { 17 return x - floor(x * (1.0 / 289.0)) * 289.0; 18} 19 20vec4 mod289(vec4 x) { 21 return x - floor(x * (1.0 / 289.0)) * 289.0; 22} 23 24vec4 permute(vec4 x) { 25 return mod289(((x * 34.0) + 1.0) * x); 26} 27 28vec4 taylorInvSqrt(vec4 r) { 29 return 1.79284291400159 - 0.85373472095314 * r; 30} 31 32float snoise(vec3 v) { 33 const vec2 C = vec2(1.0 / 6.0, 1.0 / 3.0); 34 const vec4 D = vec4(0.0, 0.5, 1.0, 2.0); 35 36 vec3 i = floor(v + dot(v, C.yyy)); 37 vec3 x0 = v - i + dot(i, C.xxx); 38 39 vec3 g = step(x0.yzx, x0.xyz); 40 vec3 l = 1.0 - g; 41 vec3 i1 = min(g.xyz, l.zxy); 42 vec3 i2 = max(g.xyz, l.zxy); 43 44 vec3 x1 = x0 - i1 + C.xxx; 45 vec3 x2 = x0 - i2 + C.yyy; 46 vec3 x3 = x0 - D.yyy; 47 48 i = mod289(i); 49 vec4 p = permute(permute(permute( 50 i.z + vec4(0.0, i1.z, i2.z, 1.0)) 51 + i.y + vec4(0.0, i1.y, i2.y, 1.0)) 52 + i.x + vec4(0.0, i1.x, i2.x, 1.0)); 53 54 float n_ = 0.142857142857; 55 vec3 ns = n_ * D.wyz - D.xzx; 56 57 vec4 j = p - 49.0 * floor(p * ns.z * ns.z); 58 59 vec4 x_ = floor(j * ns.z); 60 vec4 y_ = floor(j - 7.0 * x_); 61 62 vec4 x = x_ * ns.x + ns.yyyy; 63 vec4 y = y_ * ns.x + ns.yyyy; 64 vec4 h = 1.0 - abs(x) - abs(y); 65 66 vec4 b0 = vec4(x.xy, y.xy); 67 vec4 b1 = vec4(x.zw, y.zw); 68 69 vec4 s0 = floor(b0) * 2.0 + 1.0; 70 vec4 s1 = floor(b1) * 2.0 + 1.0; 71 vec4 sh = -step(h, vec4(0.0)); 72 73 vec4 a0 = b0.xzyw + s0.xzyw * sh.xxyy; 74 vec4 a1 = b1.xzyw + s1.xzyw * sh.zzww; 75 76 vec3 p0 = vec3(a0.xy, h.x); 77 vec3 p1 = vec3(a0.zw, h.y); 78 vec3 p2 = vec3(a1.xy, h.z); 79 vec3 p3 = vec3(a1.zw, h.w); 80 81 vec4 norm = taylorInvSqrt(vec4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3))); 82 p0 *= norm.x; 83 p1 *= norm.y; 84 p2 *= norm.z; 85 p3 *= norm.w; 86 87 vec4 m = max(0.6 - vec4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), 0.0); 88 m = m * m; 89 return 42.0 * dot(m * m, vec4(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3))); 90} 91 92float fbm3d(vec3 x, const int iterations) { 93 float value = 0.0; 94 float amplitude = 0.5; 95 vec3 shift = vec3(100.0); 96 97 for (int i = 0; i < 32; i++) { 98 if (i < iterations) { 99 value += amplitude * snoise(x); 100 x = x * 2.0 + shift; 101 amplitude *= 0.5; 102 } 103 } 104 105 return value; 106} 107 108void main() { 109 float animTime = u_time * u_speed * 0.2; 110 vec2 offset = u_position * u_resolution.xy; 111 vec2 uv = (gl_FragCoord.xy - 0.5 * u_resolution.xy + offset) / u_resolution.y; 112 vec2 st = vec2(length(uv) / u_size, atan(uv.y, uv.x)); 113 114 st.y += st.x * 1.1; 115 116 float x = fbm3d(vec3(sin(st.y), cos(st.y), pow(st.x, 0.3) + animTime * 0.1), 3); 117 float y = fbm3d(vec3(cos(1.0 - st.y), sin(1.0 - st.y), pow(st.x, 0.5) + animTime * 0.1), 4); 118 119 float r = fbm3d(vec3(x, y, st.x + animTime * 0.3), 5); 120 r = fbm3d(vec3(r - x, r - y, r + animTime * 0.3), 6); 121 122 float tone = (r + st.x * 5.0) / 6.0; 123 vec3 ringShape = vec3( 124 smoothstep(0.3, 0.4, tone), 125 smoothstep(0.4, 0.55, tone), 126 smoothstep(0.2, 0.55, tone) 127 ); 128 float ringLuma = dot(ringShape, vec3(0.299, 0.587, 0.114)); 129 float pinkLuma = dot(u_accent, vec3(0.299, 0.587, 0.114)); 130 vec3 pinkChroma = u_accent / max(pinkLuma, 1e-3); 131 vec3 ringColor = mix(pinkChroma * ringLuma, u_highlight, smoothstep(0.55, 0.92, ringLuma)); 132 133 float ringMask = smoothstep(0.28, 0.38, tone) * (1.0 - smoothstep(0.5, 0.66, tone)); 134 float outerFade = 1.0 - smoothstep(1.4, 2.8, length(uv)); 135 vec3 color = mix(u_baseColor, ringColor, ringMask * outerFade); 136 137 vec2 vignetteUv = (gl_FragCoord.xy - 0.5 * u_resolution.xy) / min(u_resolution.x, u_resolution.y); 138 float vignette = 1.0 - dot(vignetteUv * u_vignetteStrength, vignetteUv * u_vignetteStrength); 139 color *= u_vignetteMin + vignette * u_vignetteRange; 140 141 142 gl_FragColor = vec4(color, 1.0); 143} 144`;function f(e,o,h,c,_,{config:a}={}){const{primary:x,secondary:u,background:m}=c,t=g(e,o),{animation:l,hole:s,vignette:v}=a;return t.speed=i(e,o,"u_speed"),t.size=i(e,o,"u_size"),t.position=i(e,o,"u_position"),t.baseColor=i(e,o,"u_baseColor"),t.accent=i(e,o,"u_accent"),t.highlight=i(e,o,"u_highlight"),t.vignetteStrength=i(e,o,"u_vignetteStrength"),t.vignetteMin=i(e,o,"u_vignetteMin"),t.vignetteRange=i(e,o,"u_vignetteRange"),n(e,t.speed,l.speed),n(e,t.size,s.size),y(e,t.position,s.position),r(e,t.baseColor,m),r(e,t.accent,x),r(e,t.highlight,u),n(e,t.vignetteStrength,v.strength),n(e,t.vignetteMin,v.minBrightness),n(e,t.vignetteRange,v.range),t}export{p as default,f as setupVoidUniforms};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.