PageSourceSearch

https://palacesoft.ovh/_next/static/chunks/2768.0aef2569db48584f.js

js palacesoft.ovh collected 2026-10-06 12:53:13 UTC 6,624 bytes, 156 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2768],{20470:(e,o,t)=>{t.d(o,{l:()=>a});var i=t(35122);class a extends i.V{constructor(e,{attributes:o={}}={}){Object.assign(o,{position:{size:2,data:new Float32Array([-1,-1,3,-1,-1,3])},uv:{size:2,data:new Float32Array([0,0,2,0,0,2])}}),super(e,o)}}},92768:(e,o,t)=>{t.r(o),t.d(o,{default:()=>s});var i=t(48380),a=t(55265),n=t(20470),c=t(76470),l=t(98518),r=t(8618),v=t(3184);function s({hue:e=0,backgroundColor:o="transparent"}){let t=(0,v.useRef)(null),u=o||"transparent",d=`
2    precision highp float;
3    attribute vec2 position;
4    attribute vec2 uv;
5    varying vec2 vUv;
6    void main() {
7      vUv = uv;
8      gl_Position = vec4(position, 0.0, 1.0);
9    }
10  `,f=`
11    precision highp float;
12
13    uniform float iTime;
14    uniform vec3 iResolution;
15    uniform float hue;
16    uniform float hover;
17    uniform float rot;
18    uniform float hoverIntensity;
19    varying vec2 vUv;
20
21    vec3 rgb2yiq(vec3 c) {
22      float y = dot(c, vec3(0.299, 0.587, 0.114));
23      float i = dot(c, vec3(0.596, -0.274, -0.322));
24      float q = dot(c, vec3(0.211, -0.523, 0.312));
25      return vec3(y, i, q);
26    }
27    
28    vec3 yiq2rgb(vec3 c) {
29      float r = c.x + 0.956 * c.y + 0.621 * c.z;
30      float g = c.x - 0.272 * c.y - 0.647 * c.z;
31      float b = c.x - 1.106 * c.y + 1.703 * c.z;
32      return vec3(r, g, b);
33    }
34    
35    vec3 adjustHue(vec3 color, float hueDeg) {
36      float hueRad = hueDeg * 3.14159265 / 180.0;
37      vec3 yiq = rgb2yiq(color);
38      float cosA = cos(hueRad);
39      float sinA = sin(hueRad);
40      float i = yiq.y * cosA - yiq.z * sinA;
41      float q = yiq.y * sinA + yiq.z * cosA;
42      yiq.y = i;
43      yiq.z = q;
44      return yiq2rgb(yiq);
45    }
46    
47    vec3 hash33(vec3 p3) {
48      p3 = fract(p3 * vec3(0.1031, 0.11369, 0.13787));
49      p3 += dot(p3, p3.yxz + 19.19);
50      return -1.0 + 2.0 * fract(vec3(
51        p3.x + p3.y,
52        p3.x + p3.z,
53        p3.y + p3.z
54      ) * p3.zyx);
55    }
56    
57    float snoise3(vec3 p) {
58      const float K1 = 0.333333333;
59      const float K2 = 0.166666667;
60      vec3 i = floor(p + (p.x + p.y + p.z) * K1);
61      vec3 d0 = p - (i - (i.x + i.y + i.z) * K2);
62      vec3 e = step(vec3(0.0), d0 - d0.yzx);
63      vec3 i1 = e * (1.0 - e.zxy);
64      vec3 i2 = 1.0 - e.zxy * (1.0 - e);
65      vec3 d1 = d0 - (i1 - K2);
66      vec3 d2 = d0 - (i2 - K1);
67      vec3 d3 = d0 - 0.5;
68      vec4 h = max(0.6 - vec4(
69        dot(d0, d0),
70        dot(d1, d1),
71        dot(d2, d2),
72        dot(d3, d3)
73      ), 0.0);
74      vec4 n = h * h * h * h * vec4(
75        dot(d0, hash33(i)),
76        dot(d1, hash33(i + i1)),
77        dot(d2, hash33(i + i2)),
78        dot(d3, hash33(i + 1.0))
79      );
80      return dot(vec4(31.316), n);
81    }
82    
83    vec4 extractAlpha(vec3 colorIn) {
84      float a = max(max(colorIn.r, colorIn.g), colorIn.b);
85      return vec4(colorIn.rgb / (a + 1e-5), a);
86    }
87    
88    const vec3 baseColor1 = vec3(0.611765, 0.262745, 0.996078);
89    const vec3 baseColor2 = vec3(0.298039, 0.760784, 0.913725);
90    const vec3 baseColor3 = vec3(0.062745, 0.078431, 0.600000);
91    const float innerRadius = 0.6;
92    const float noiseScale = 0.65;
93    
94    float light1(float intensity, float attenuation, float dist) {
95      return intensity / (1.0 + dist * attenuation);
96    }
97    
98    float light2(float intensity, float attenuation, float dist) {
99      return intensity / (1.0 + dist * dist * attenuation);
100    }
101    
102    vec4 draw(vec2 uv) {
103      vec3 color1 = adjustHue(baseColor1, hue);
104      vec3 color2 = adjustHue(baseColor2, hue);
105      vec3 color3 = adjustHue(baseColor3, hue);
106      
107      float ang = atan(uv.y, uv.x);
108      float len = length(uv);
109      float invLen = len > 0.0 ? 1.0 / len : 0.0;
110      
111      float n0 = snoise3(vec3(uv * noiseScale, iTime * 0.5)) * 0.5 + 0.5;
112      float r0 = mix(mix(innerRadius, 1.0, 0.4), mix(innerRadius, 1.0, 0.6), n0);
113      float d0 = distance(uv, (r0 * invLen) * uv);
114      float v0 = light1(1.0, 10.0, d0);
115      v0 *= smoothstep(r0 * 1.05, r0, len);
116      float cl = cos(ang + iTime * 2.0) * 0.5 + 0.5;
117      
118      float a = iTime * -1.0;
119      vec2 pos = vec2(cos(a), sin(a)) * r0;
120      float d = distance(uv, pos);
121      float v1 = light2(1.5, 5.0, d);
122      v1 *= light1(1.0, 50.0, d0);
123      
124      float v2 = smoothstep(1.0, mix(innerRadius, 1.0, n0 * 0.5), len);
125      float v3 = smoothstep(innerRadius, mix(innerRadius, 1.0, 0.5), len);
126      
127      vec3 col = mix(color1, color2, cl);
128      col = mix(color3, col, v0);
129      col = (col + v1) * v2 * v3;
130      col = clamp(col, 0.0, 1.0);
131      
132      return extractAlpha(col);
133    }
134    
135    vec4 mainImage(vec2 fragCoord) {
136      vec2 center = iResolution.xy * 0.5;
137      float size = min(iResolution.x, iResolution.y);
138      vec2 uv = (fragCoord - center) / size * 2.0;
139      
140      float angle = rot;
141      float s = sin(angle);
142      float c = cos(angle);
143      uv = vec2(c * uv.x - s * uv.y, s * uv.x + c * uv.y);
144      
145      uv.x += hover * hoverIntensity * 0.1 * sin(uv.y * 10.0 + iTime);
146      uv.y += hover * hoverIntensity * 0.1 * sin(uv.x * 10.0 + iTime);
147      
148      return draw(uv);
149    }
150    
151    void main() {
152      vec2 fragCoord = vUv * iResolution.xy;
153      vec4 col = mainImage(fragCoord);
154      gl_FragColor = vec4(col.rgb * col.a, col.a);
155    }
156  `;return(0,v.useEffect)(()=>{let o,i=t.current;if(!i)return;let v=new a.A({alpha:!0,premultipliedAlpha:!1}),s=v.gl;s.clearColor(0,0,0,0),i.appendChild(s.canvas);let u=new n.l(s),h=new c.B(s,{vertex:d,fragment:f,uniforms:{iTime:{value:0},iResolution:{value:new l.e(s.canvas.width,s.canvas.height,s.canvas.width/s.canvas.height)},hue:{value:e},hover:{value:0},rot:{value:0},hoverIntensity:{value:0}}}),y=new r.e(s,{geometry:u,program:h});function m(){if(!i)return;let e=window.devicePixelRatio||1,o=i.clientWidth,t=i.clientHeight;v.setSize(o*e,t*e),s.canvas.style.width=o+"px",s.canvas.style.height=t+"px",h.uniforms.iResolution.value.set(s.canvas.width,s.canvas.height,s.canvas.width/s.canvas.height)}window.addEventListener("resize",m);let p=null;"u">typeof ResizeObserver&&(p=new ResizeObserver(()=>m())).observe(i),m();let g=t=>{o=requestAnimationFrame(g),h.uniforms.iTime.value=.001*t,h.uniforms.hue.value=e,h.uniforms.hoverIntensity.value=0,h.uniforms.hover.value=0,h.uniforms.rot.value=0,v.render({scene:y})};return o=requestAnimationFrame(g),()=>{cancelAnimationFrame(o),window.removeEventListener("resize",m),p?.disconnect(),i.removeChild(s.canvas),s.getExtension("WEBGL_lose_context")?.loseContext()}},[e,0,!1,!1,o,u]),(0,i.jsx)("div",{ref:t,className:"h-full w-full",style:{backgroundColor:u}})}}}]);

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.