1import{M as V,o as F,c as $,a as p,_ as T,q as B,n as L,u as D,h as q,d as I,I as G,e as j}from"./index-CG7S1Sc9.js";var U={exports:{}},z;function P(){return z||(z=1,(function(_){function f(h,o,a,b){Object.defineProperty(h,o,{get:a,set:b,enumerable:!0,configurable:!0})}f(_.exports,"Gradient",()=>O),f(_.exports,"MiniGl",()=>w);class C{constructor(o,a,b,y=!1){const l=this,R=document.location.search.toLowerCase().indexOf("debug=webgl")!==-1;l.canvas=o,l.gl=l.canvas.getContext("webgl",{antialias:!0}),l.meshes=[];const s=l.gl;a&&b&&this.setSize(a,b),l.lastDebugMsg,l.debug=y&&R?function(i){const r=new Date;r-l.lastDebugMsg>1e3&&console.log("---"),console.log(r.toLocaleTimeString()+Array(Math.max(0,32-i.length)).join(" ")+i+": ",...Array.from(arguments).slice(1)),l.lastDebugMsg=r}:()=>{},Object.defineProperties(l,{Material:{enumerable:!1,value:class{constructor(i,r,e={}){const t=this;function c(S,v){const m=s.createShader(S);return s.shaderSource(m,v),s.compileShader(m),s.getShaderParameter(m,s.COMPILE_STATUS)||console.error(s.getShaderInfoLog(m)),l.debug("Material.compileShaderSource",{source:v}),m}function d(S,v){return Object.entries(S).map(([m,x])=>x.getDeclaration(m,v)).join(` 2`)}t.uniforms=e,t.uniformInstances=[];const u=` 3 precision highp float; 4 `;t.vertexSource=` 5 ${u} 6 attribute vec4 position; 7 attribute vec2 uv; 8 attribute vec2 uvNorm; 9 ${d(l.commonUniforms,"vertex")} 10 ${d(e,"vertex")} 11 ${i} 12 `,t.Source=` 13 ${u} 14 ${d(l.commonUniforms,"fragment")} 15 ${d(e,"fragment")} 16 ${r} 17 `,t.vertexShader=c(s.VERTEX_SHADER,t.vertexSource),t.fragmentShader=c(s.FRAGMENT_SHADER,t.Source),t.program=s.createProgram(),s.attachShader(t.program,t.vertexShader),s.attachShader(t.program,t.fragmentShader),s.linkProgram(t.program),s.getProgramParameter(t.program,s.LINK_STATUS)||console.error(s.getProgramInfoLog(t.program)),s.useProgram(t.program),t.attachUniforms(void 0,l.commonUniforms),t.attachUniforms(void 0,t.uniforms)}attachUniforms(i,r){const e=this;i===void 0?Object.entries(r).forEach(([t,c])=>{e.attachUniforms(t,c)}):r.type=="array"?r.value.forEach((t,c)=>e.attachUniforms(`${i}[${c}]`,t)):r.type=="struct"?Object.entries(r.value).forEach(([t,c])=>e.attachUniforms(`${i}.${t}`,c)):(l.debug("Material.attachUniforms",{name:i,uniform:r}),e.uniformInstances.push({uniform:r,location:s.getUniformLocation(e.program,i)}))}}},Uniform:{enumerable:!1,value:class{constructor(i){this.type="float",Object.assign(this,i),this.typeFn={float:"1f",int:"1i",vec2:"2fv",vec3:"3fv",vec4:"4fv",mat4:"Matrix4fv"}[this.type]||"1f",this.update()}update(i){this.value!==void 0&&s[`uniform${this.typeFn}`](i,this.typeFn.indexOf("Matrix")===0?this.transpose:this.value,this.typeFn.indexOf("Matrix")===0?this.value:null)}getDeclaration(i,r,e){const t=this;if(t.excludeFrom!==r){if(t.type==="array")return t.value[0].getDeclaration(i,r,t.value.length)+` 18const int ${i}_length = ${t.value.length};`;if(t.type==="struct"){let c=i.replace("u_","");return c=c.charAt(0).toUpperCase()+c.slice(1),`uniform struct ${c} 19 { 20`+Object.entries(t.value).map(([d,u])=>u.getDeclaration(d,r).replace(/^uniform/,"")).join("")+` 21} ${i}${e>0?`[${e}]`:""};`}return`uniform ${t.type} ${i}${e>0?`[${e}]`:""};`}}}},PlaneGeometry:{enumerable:!1,value:class{constructor(i,r,e,t,c){s.createBuffer(),this.attributes={position:new l.Attribute({target:s.ARRAY_BUFFER,size:3}),uv:new l.Attribute({target:s.ARRAY_BUFFER,size:2}),uvNorm:new l.Attribute({target:s.ARRAY_BUFFER,size:2}),index:new l.Attribute({target:s.ELEMENT_ARRAY_BUFFER,size:3,type:s.UNSIGNED_SHORT})},this.setTopology(e,t),this.setSize(i,r,c)}setTopology(i=1,r=1){const e=this;e.xSegCount=i,e.ySegCount=r,e.vertexCount=(e.xSegCount+1)*(e.ySegCount+1),e.quadCount=e.xSegCount*e.ySegCount*2,e.attributes.uv.values=new Float32Array(2*e.vertexCount),e.attributes.uvNorm.values=new Float32Array(2*e.vertexCount),e.attributes.index.values=new Uint16Array(3*e.quadCount);for(let t=0;t<=e.ySegCount;t++)for(let c=0;c<=e.xSegCount;c++){const d=t*(e.xSegCount+1)+c;if(e.attributes.uv.values[2*d]=c/e.xSegCount,e.attributes.uv.values[2*d+1]=1-t/e.ySegCount,e.attributes.uvNorm.values[2*d]=c/e.xSegCount*2-1,e.attributes.uvNorm.values[2*d+1]=1-t/e.ySegCount*2,c<e.xSegCount&&t<e.ySegCount){const u=t*e.xSegCount+c;e.attributes.index.values[6*u]=d,e.attributes.index.values[6*u+1]=d+1+e.xSegCount,e.attributes.index.values[6*u+2]=d+1,e.attributes.index.values[6*u+3]=d+1,e.attributes.index.values[6*u+4]=d+1+e.xSegCount,e.attributes.index.values[6*u+5]=d+2+e.xSegCount}}
21e.attributes.uv.update(),e.attributes.uvNorm.update(),e.attributes.index.update(),l.debug("Geometry.setTopology",{uv:e.attributes.uv,uvNorm:e.attributes.uvNorm,index:e.attributes.index})}setSize(i=1,r=1,e="xz"){const t=this;t.width=i,t.height=r,t.orientation=e,t.attributes.position.values&&t.attributes.position.values.length===3*t.vertexCount||(t.attributes.position.values=new Float32Array(3*t.vertexCount));const c=i/-2,d=r/-2,u=i/t.xSegCount,S=r/t.ySegCount;for(let v=0;v<=t.ySegCount;v++){const m=d+v*S;for(let x=0;x<=t.xSegCount;x++){const N=c+x*u,A=v*(t.xSegCount+1)+x;t.attributes.position.values[3*A+"xyz".indexOf(e[0])]=N,t.attributes.position.values[3*A+"xyz".indexOf(e[1])]=-m}}t.attributes.position.update(),l.debug("Geometry.setSize",{position:t.attributes.position})}}},Mesh:{enumerable:!1,value:class{constructor(i,r){const e=this;e.geometry=i,e.material=r,e.wireframe=!1,e.attributeInstances=[],Object.entries(e.geometry.attributes).forEach(([t,c])=>{e.attributeInstances.push({attribute:c,location:c.attach(t,e.material.program)})}),l.meshes.push(e),l.debug("Mesh.constructor",{mesh:e})}draw(){s.useProgram(this.material.program),this.material.uniformInstances.forEach(({uniform:i,location:r})=>i.update(r)),this.attributeInstances.forEach(({attribute:i,location:r})=>i.use(r)),s.drawElements(this.wireframe?s.LINES:s.TRIANGLES,this.geometry.attributes.index.values.length,s.UNSIGNED_SHORT,0)}remove(){l.meshes=l.meshes.filter(i=>i!=this)}}},Attribute:{enumerable:!1,value:class{constructor(i){this.type=s.FLOAT,this.normalized=!1,this.buffer=s.createBuffer(),Object.assign(this,i),this.update()}update(){this.values!==void 0&&(s.bindBuffer(this.target,this.buffer),s.bufferData(this.target,this.values,s.STATIC_DRAW))}attach(i,r){const e=s.getAttribLocation(r,i);return this.target===s.ARRAY_BUFFER&&(s.enableVertexAttribArray(e),s.vertexAttribPointer(e,this.size,this.type,this.normalized,0,0)),e}use(i){s.bindBuffer(this.target,this.buffer),this.target===s.ARRAY_BUFFER&&(s.enableVertexAttribArray(i),s.vertexAttribPointer(i,this.size,this.type,this.normalized,0,0))}}}});const M=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];l.commonUniforms={projectionMatrix:new l.Uniform({type:"mat4",value:M}),modelViewMatrix:new l.Uniform({type:"mat4",value:M}),resolution:new l.Uniform({type:"vec2",value:[1,1]}),aspectRatio:new l.Uniform({type:"float",value:1})}}setSize(o=640,a=480){this.width=o,this.height=a,this.canvas.width=o,this.canvas.height=a,this.gl.viewport(0,0,o,a),this.commonUniforms.resolution.value=[o,a],this.commonUniforms.aspectRatio.value=o/a,this.debug("MiniGL.setSize",{width:o,height:a})}setOrthographicCamera(o=0,a=0,b=0,y=-2e3,l=2e3){this.commonUniforms.projectionMatrix.value=[2/this.width,0,0,0,0,2/this.height,0,0,0,0,2/(y-l),0,o,a,b,1],this.debug("setOrthographicCamera",this.commonUniforms.projectionMatrix.value)}render(){this.gl.clearColor(0,0,0,0),this.gl.clearDepth(1),this.meshes.forEach(o=>o.draw())}}var w=C;function g(h){return[(h>>16&255)/255,(h>>8&255)/255,(255&h)/255]}["SCREEN","LINEAR_LIGHT"].reduce((h,o,a)=>Object.assign(h,{[o]:a}),{});function n(h,o,a){return o in h?Object.defineProperty(h,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):h[o]=a,h}class E{constructor(...o){n(this,"el",void 0),n(this,"cssVarRetries",0),n(this,"maxCssVarRetries",200),n(this,"angle",0),n(this,"isLoadedClass",!1),n(this,"isScrolling",!1),n(this,"scrollingTimeout",void 0),n(this,"scrollingRefreshDelay",200),n(this,"isIntersecting",!1),n(this,"shaderFiles",void 0),n(this,"vertexShader",void 0),n(this,"sectionColors",void 0),n(this,"computedCanvasStyle",void 0),n(this,"conf",void 0),n(this,"uniforms",void 0),n(this,"t",1253106),n(this,"last",0),n(this,"width",void 0),n(this,"minWidth",1111),n(this,"height",600),n(this,"xSegCount",void 0),n(this,"ySegCount",void 0),n(this,"mesh",void 0),n(this,"material",void 0),n(this,"geometry",void 0),n(this,"minigl",void 0),n(this,"scrollObserver",void 0),n(this,"amp",320),n(this,"seed",5),n(this,"freqX",14e-5),n(this,"freqY",29e-5),n(this,"freqDelta",1e-5),n(this,"activeColors",[1,1,1,1]),n(this,"isMetaKey",!1),n(this,"isGradientLegendVisible",!1),n(this,"isMouseDown",!1),n(this,"handleScroll",()=>{clearTimeout(this.scrollingTimeout),this.scrollingTimeout=setTimeout(this.handleScrollEnd,this.scrollingRefreshDelay),this.isGradientLegendVisible&&this.hideGradientLegend(),this.conf.playing&&(this.isScrolling=!0,this.paussetInitialProperty())}),n(this,"handleScrollEnd",()=>{this.isScrolling=!1,this.isIntersecting&&this.play()}),n(this,"resize",()=>{this.width=window.innerWidth,this.minigl.setSize(this.width,this.height),this.minigl.setOrthogra
21phicCamera(),this.xSegCount=Math.ceil(this.width*this.conf.density[0]),this.ySegCount=Math.ceil(this.height*this.conf.density[1]),this.mesh.geometry.setTopology(this.xSegCount,this.ySegCount),this.mesh.geometry.setSize(this.width,this.height),this.mesh.material.uniforms.u_shadow_power.value=this.width<600?5:6}),n(this,"handleMouseDown",a=>{this.isGradientLegendVisible&&(this.isMetaKey=a.metaKey,this.isMouseDown=!0,this.conf.playing===!1&&requestAnimationFrame(this.animate))}),n(this,"handleMouseUp",()=>{this.isMouseDown=!1}),n(this,"animate",a=>{if(!this.shouldSkipFrame(a)||this.isMouseDown){if(this.t+=Math.min(a-this.last,1e3/15),this.last=a,this.isMouseDown){let b=160;this.isMetaKey&&(b=-160),this.t+=b}this.mesh.material.uniforms.u_time.value=this.t,this.minigl.render()}if(this.last!==0&&this.isStatic)return this.minigl.render(),void this.disconnect();(this.conf.playing||this.isMouseDown)&&requestAnimationFrame(this.animate)}),n(this,"addIsLoadedClass",()=>{!this.isLoadedClass&&(this.isLoadedClass=!0,this.el.classList.add("isLoaded"),setTimeout(()=>{this.el.parentElement.classList.add("isLoaded")},3e3))}),n(this,"pause",()=>{this.conf.playing=!1}),n(this,"play",()=>{requestAnimationFrame(this.animate),this.conf.playing=!0}),n(this,"initGradient",a=>(this.el=document.querySelector(a),this.connect(),this))}async connect(){this.shaderFiles={vertex:`varying vec3 v_color; 22 23void main() { 24 float time = u_time * u_global.noiseSpeed; 25 26 vec2 noiseCoord = resolution * uvNorm * u_global.noiseFreq; 27 28 vec2 st = 1. - uvNorm.xy; 29 30 // 31 // Tilting the plane 32 // 33 34 // Front-to-back tilt 35 float tilt = resolution.y / 2.0 * uvNorm.y; 36 37 // Left-to-right angle 38 float incline = resolution.x * uvNorm.x / 2.0 * u_vertDeform.incline; 39 40 // Up-down shift to offset incline 41 float offset = resolution.x / 2.0 * u_vertDeform.incline * mix(u_vertDeform.offsetBottom, u_vertDeform.offsetTop, uv.y); 42 43 // 44 // Vertex noise 45 // 46 47 float noise = snoise(vec3( 48 noiseCoord.x * u_vertDeform.noiseFreq.x + time * u_vertDeform.noiseFlow, 49 noiseCoord.y * u_vertDeform.noiseFreq.y, 50 time * u_vertDeform.noiseSpeed + u_vertDeform.noiseSeed 51 )) * u_vertDeform.noiseAmp; 52 53 // Fade noise to zero at edges 54 noise *= 1.0 - pow(abs(uvNorm.y), 2.0); 55 56 // Clamp to 0 57 noise = max(0.0, noise); 58 59 vec3 pos = vec3( 60 position.x, 61 position.y + tilt + incline + noise - offset, 62 position.z 63 ); 64 65 // 66 // Vertex color, to be passed to fragment shader 67 // 68 69 if (u_active_colors[0] == 1.) { 70 v_color = u_baseColor; 71 } 72 73 for (int i = 0; i < u_waveLayers_length; i++) { 74 if (u_active_colors[i + 1] == 1.) { 75 WaveLayers layer = u_waveLayers[i]; 76 77 float noise = smoothstep( 78 layer.noiseFloor, 79 layer.noiseCeil, 80 snoise(vec3( 81 noiseCoord.x * layer.noiseFreq.x + time * layer.noiseFlow, 82 noiseCoord.y * layer.noiseFreq.y, 83 time * layer.noiseSpeed + layer.noiseSeed 84 )) / 2.0 + 0.5 85 ); 86 87 v_color = blendNormal(v_color, layer.color, pow(noise, 4.)); 88 } 89 } 90 91 // 92 // Finish 93 // 94 95 gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0); 96}`,noise:`// 97// Description : Array and textureless GLSL 2D/3D/4D simplex 98// noise functions. 99// Author : Ian McEwan, Ashima Arts. 100// Maintainer : stegu 101// Lastmod : 20110822 (ijm) 102// License : Copyright (C) 2011 Ashima Arts. All rights reserved. 103// Distributed under the MIT License. See LICENSE file. 104// https://github.com/ashima/webgl-noise 105// https://github.com/stegu/webgl-noise 106// 107 108vec3 mod289(vec3 x) { 109 return x - floor(x * (1.0 / 289.0)) * 289.0; 110} 111 112vec4 mod289(vec4 x) { 113 return x - floor(x * (1.0 / 289.0)) * 289.0; 114} 115 116vec4 permute(vec4 x) { 117 return mod289(((x*34.0)+1.0)*x); 118} 119 120vec4 taylorInvSqrt(vec4 r) 121{ 122 return 1.79284291400159 - 0.85373472095314 * r; 123} 124 125float snoise(vec3 v) 126{ 127 const vec2 C = vec2(1.0/6.0, 1.0/3.0) ; 128 const vec4 D = vec4(0.0, 0.5, 1.0, 2.0); 129 130// First corner 131 vec3 i = floor(v + dot(v, C.yyy) ); 132 vec3 x0 = v - i + dot(i, C.xxx) ; 133 134// Other corners 135 vec3 g = step(x0.yzx, x0.xyz); 136 vec3 l = 1.0 - g; 137 vec3 i1 = min( g.xyz, l.zxy ); 138 vec3 i2 = max( g.xyz, l.zxy ); 139 140 // x0 = x0 - 0.0 + 0.0 * C.xxx; 141 // x1 = x0 - i1 + 1.0 * C.xxx; 142 // x2 = x0 - i2 + 2.0 * C.xxx; 143 // x3 = x0 - 1.0 + 3.0 * C.xxx; 144 vec3 x1 = x0 - i1 + C.xxx; 145 vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y 146 vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y 147 148// Permutations 149 i = mod289(i); 150 vec4 p = permute( permute( permute( 151 i.z + vec4(0.0, i1.z, i2.z, 1.0 )) 152 + i.y + vec4(0.0, i1.y, i2.y, 1.0 )) 153 + i.x + vec4(0.0, i1.x, i2.x, 1.0 )); 154 155// Gradients: 7x7 points over a square, mapped onto an octahedron. 156// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294) 157 float n_ = 0.142857142857; // 1.0/7.0 158 vec3 ns = n_ * D.wyz - D.xzx; 159 160 vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7) 161 162 vec4 x_ = floor(j * ns.z); 163 vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N) 164 165 vec4 x = x_ *ns.x + ns.yyyy; 166 vec4 y = y_ *ns.x + ns.yyyy; 167 vec4 h = 1.0 - abs(x) - abs(y); 168 169 vec4 b0 = vec4( x.xy, y.xy ); 170 vec4 b1 = vec4( x.zw, y.zw ); 171
172 //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0; 173 //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0; 174 vec4 s0 = floor(b0)*2.0 + 1.0; 175 vec4 s1 = floor(b1)*2.0 + 1.0; 176 vec4 sh = -step(h, vec4(0.0)); 177 178 vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ; 179 vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ; 180 181 vec3 p0 = vec3(a0.xy,h.x); 182 vec3 p1 = vec3(a0.zw,h.y); 183 vec3 p2 = vec3(a1.xy,h.z); 184 vec3 p3 = vec3(a1.zw,h.w); 185 186//Normalise gradients 187 vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3))); 188 p0 *= norm.x; 189 p1 *= norm.y; 190 p2 *= norm.z; 191 p3 *= norm.w; 192 193// Mix final noise value 194 vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0); 195 m = m * m; 196 return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1), 197 dot(p2,x2), dot(p3,x3) ) ); 198}`,blend:`// 199// https://github.com/jamieowen/glsl-blend 200// 201 202// Normal 203 204vec3 blendNormal(vec3 base, vec3 blend) { 205 return blend; 206} 207 208vec3 blendNormal(vec3 base, vec3 blend, float opacity) { 209 return (blendNormal(base, blend) * opacity + base * (1.0 - opacity)); 210} 211 212// Screen 213 214float blendScreen(float base, float blend) { 215 return 1.0-((1.0-base)*(1.0-blend)); 216} 217 218vec3 blendScreen(vec3 base, vec3 blend) { 219 return vec3(blendScreen(base.r,blend.r),blendScreen(base.g,blend.g),blendScreen(base.b,blend.b)); 220} 221 222vec3 blendScreen(vec3 base, vec3 blend, float opacity) { 223 return (blendScreen(base, blend) * opacity + base * (1.0 - opacity)); 224} 225 226// Multiply 227 228vec3 blendMultiply(vec3 base, vec3 blend) { 229 return base*blend; 230} 231 232vec3 blendMultiply(vec3 base, vec3 blend, float opacity) { 233 return (blendMultiply(base, blend) * opacity + base * (1.0 - opacity)); 234} 235 236// Overlay 237 238float blendOverlay(float base, float blend) { 239 return base<0.5?(2.0*base*blend):(1.0-2.0*(1.0-base)*(1.0-blend)); 240} 241 242vec3 blendOverlay(vec3 base, vec3 blend) { 243 return vec3(blendOverlay(base.r,blend.r),blendOverlay(base.g,blend.g),blendOverlay(base.b,blend.b)); 244} 245 246vec3 blendOverlay(vec3 base, vec3 blend, float opacity) { 247 return (blendOverlay(base, blend) * opacity + base * (1.0 - opacity)); 248} 249 250// Hard light 251 252vec3 blendHardLight(vec3 base, vec3 blend) { 253 return blendOverlay(blend,base); 254} 255 256vec3 blendHardLight(vec3 base, vec3 blend, float opacity) { 257 return (blendHardLight(base, blend) * opacity + base * (1.0 - opacity)); 258} 259 260// Soft light 261 262float blendSoftLight(float base, float blend) { 263 return (blend<0.5)?(2.0*base*blend+base*base*(1.0-2.0*blend)):(sqrt(base)*(2.0*blend-1.0)+2.0*base*(1.0-blend)); 264} 265 266vec3 blendSoftLight(vec3 base, vec3 blend) { 267 return vec3(blendSoftLight(base.r,blend.r),blendSoftLight(base.g,blend.g),blendSoftLight(base.b,blend.b)); 268} 269 270vec3 blendSoftLight(vec3 base, vec3 blend, float opacity) { 271 return (blendSoftLight(base, blend) * opacity + base * (1.0 - opacity)); 272} 273 274// Color dodge 275 276float blendColorDodge(float base, float blend) { 277 return (blend==1.0)?blend:min(base/(1.0-blend),1.0); 278} 279 280vec3 blendColorDodge(vec3 base, vec3 blend) { 281 return vec3(blendColorDodge(base.r,blend.r),blendColorDodge(base.g,blend.g),blendColorDodge(base.b,blend.b)); 282} 283 284vec3 blendColorDodge(vec3 base, vec3 blend, float opacity) { 285 return (blendColorDodge(base, blend) * opacity + base * (1.0 - opacity)); 286} 287 288// Color burn 289 290float blendColorBurn(float base, float blend) { 291 return (blend==0.0)?blend:max((1.0-((1.0-base)/blend)),0.0); 292} 293 294vec3 blendColorBurn(vec3 base, vec3 blend) { 295 return vec3(blendColorBurn(base.r,blend.r),blendColorBurn(base.g,blend.g),blendColorBurn(base.b,blend.b)); 296} 297 298vec3 blendColorBurn(vec3 base, vec3 blend, float opacity) { 299 return (blendColorBurn(base, blend) * opacity + base * (1.0 - opacity)); 300} 301 302// Vivid Light 303 304float blendVividLight(float base, float blend) { 305 return (blend<0.5)?blendColorBurn(base,(2.0*blend)):blendColorDodge(base,(2.0*(blend-0.5))); 306} 307 308vec3 blendVividLight(vec3 base, vec3 blend) { 309 return vec3(blendVividLight(base.r,blend.r),blendVividLight(base.g,blend.g),blendVividLight(base.b,blend.b)); 310} 311 312vec3 blendVividLight(vec3 base, vec3 blend, float opacity) { 313 return (blendVividLight(base, blend) * opacity + base * (1.0 - opacity)); 314} 315 316// Lighten 317 318float blendLighten(float base, float blend) { 319 return max(blend,base); 320} 321 322vec3 blendLighten(vec3 base, vec3 blend) { 323 return vec3(blendLighten(base.r,blend.r),blendLighten(base.g,blend.g),blendLighten(base.b,blend.b)); 324} 325 326vec3 blendLighten(vec3 base, vec3 blend, float opacity) { 327 return (blendLighten(base, blend) * opacity + base * (1.0 - opacity)); 328} 329 330// Linear burn 331 332float blendLinearBurn(float base, float blend) {
333 // Note : Same implementation as BlendSubtractf 334 return max(base+blend-1.0,0.0); 335} 336 337vec3 blendLinearBurn(vec3 base, vec3 blend) { 338 // Note : Same implementation as BlendSubtract 339 return max(base+blend-vec3(1.0),vec3(0.0)); 340} 341 342vec3 blendLinearBurn(vec3 base, vec3 blend, float opacity) { 343 return (blendLinearBurn(base, blend) * opacity + base * (1.0 - opacity)); 344} 345 346// Linear dodge 347 348float blendLinearDodge(float base, float blend) { 349 // Note : Same implementation as BlendAddf 350 return min(base+blend,1.0); 351} 352 353vec3 blendLinearDodge(vec3 base, vec3 blend) { 354 // Note : Same implementation as BlendAdd 355 return min(base+blend,vec3(1.0)); 356} 357 358vec3 blendLinearDodge(vec3 base, vec3 blend, float opacity) { 359 return (blendLinearDodge(base, blend) * opacity + base * (1.0 - opacity)); 360} 361 362// Linear light 363 364float blendLinearLight(float base, float blend) { 365 return blend<0.5?blendLinearBurn(base,(2.0*blend)):blendLinearDodge(base,(2.0*(blend-0.5))); 366} 367 368vec3 blendLinearLight(vec3 base, vec3 blend) { 369 return vec3(blendLinearLight(base.r,blend.r),blendLinearLight(base.g,blend.g),blendLinearLight(base.b,blend.b)); 370} 371 372vec3 blendLinearLight(vec3 base, vec3 blend, float opacity) { 373 return (blendLinearLight(base, blend) * opacity + base * (1.0 - opacity)); 374}`,fragment:`varying vec3 v_color; 375 376void main() { 377 vec3 color = v_color; 378 if (u_darken_top == 1.0) { 379 vec2 st = gl_FragCoord.xy/resolution.xy; 380 color.g -= pow(st.y + sin(-12.0) * st.x, u_shadow_power) * 0.4; 381 } 382 gl_FragColor = vec4(color, 1.0); 383}`},this.conf={presetName:"",wireframe:!1,density:[.06,.16],zoom:1,rotation:0,playing:!0},document.querySelectorAll("canvas").length<1?console.log("DID NOT LOAD HERO STRIPE CANVAS"):(this.minigl=new w(this.el,null,null,!0),requestAnimationFrame(()=>{this.el&&(this.computedCanvasStyle=getComputedStyle(this.el),this.waitForCssVars())}))}disconnect(){this.scrollObserver&&(window.removeEventListener("scroll",this.handleScroll),window.removeEventListener("mousedown",this.handleMouseDown),window.removeEventListener("mouseup",this.handleMouseUp),window.removeEventListener("keydown",this.handleKeyDown),this.scrollObserver.disconnect()),window.removeEventListener("resize",this.resize)}initMaterial(){this.uniforms={u_time:new this.minigl.Uniform({value:0}),u_shadow_power:new this.minigl.Uniform({value:5}),u_darken_top:new this.minigl.Uniform({value:this.el.dataset.jsDarkenTop===""?1:0}),u_active_colors:new this.minigl.Uniform({value:this.activeColors,type:"vec4"}),u_global:new this.minigl.Uniform({value:{noiseFreq:new this.minigl.Uniform({value:[this.freqX,this.freqY],type:"vec2"}),noiseSpeed:new this.minigl.Uniform({value:5e-6})},type:"struct"}),u_vertDeform:new this.minigl.Uniform({value:{incline:new this.minigl.Uniform({value:Math.sin(this.angle)/Math.cos(this.angle)}),offsetTop:new this.minigl.Uniform({value:-.5}),offsetBottom:new this.minigl.Uniform({value:-.5}),noiseFreq:new this.minigl.Uniform({value:[3,4],type:"vec2"}),noiseAmp:new this.minigl.Uniform({value:this.amp}),noiseSpeed:new this.minigl.Uniform({value:10}),noiseFlow:new this.minigl.Uniform({value:3}),noiseSeed:new this.minigl.Uniform({value:this.seed})},type:"struct",excludeFrom:"fragment"}),u_baseColor:new this.minigl.Uniform({value:this.sectionColors[0],type:"vec3",excludeFrom:"fragment"}),u_waveLayers:new this.minigl.Uniform({value:[],excludeFrom:"fragment",type:"array"})};for(let o=1;o<this.sectionColors.length;o+=1)this.uniforms.u_waveLayers.value.push(new this.minigl.Uniform({value:{color:new this.minigl.Uniform({value:this.sectionColors[o],type:"vec3"}),noiseFreq:new this.minigl.Uniform({value:[2+o/this.sectionColors.length,3+o/this.sectionColors.length],type:"vec2"}),noiseSpeed:new this.minigl.Uniform({value:11+.3*o}),noiseFlow:new this.minigl.Uniform({value:6.5+.3*o}),noiseSeed:new this.minigl.Uniform({value:this.seed+10*o}),noiseFloor:new this.minigl.Uniform({value:.1}),noiseCeil:new this.minigl.Uniform({value:.63+.07*o})},type:"struct"}));return this.vertexShader=[this.shaderFiles.noise,this.shaderFiles.blend,this.shaderFiles.vertex].join(` 384 385`),new this.minigl.Material(this.vertexShader,this.shaderFiles.fragment,this.uniforms)}initMesh(){this.material=this.initMaterial(),this.geometry=new this.minigl.PlaneGeometry,this.mesh=new this.minigl.Mesh(this.geometry,this.material)}shouldSkipFrame(o){return!!window.document.hidden||!this.conf.playing||parseInt(o,10)%2==0||void 0}updateFrequency(o){this.freqX+=o,this.freqY+=o}toggleColor(o){this.activeColors[o]=this.activeColors[o]===0?1:0}showGradientLegend(){this.width>this.minWidth&&(this.isGradientLegendVisible=!0,document.body.classList.add("isGradientLegendVisible"))}hideGradientLegend(){this.isGradientLegendVisible=!1,document.body.classList.remove("isGradientLegendVisible")}init(){this.initGradientColors(),this.initMesh(),this.resize(),requestAnimationFrame(this.animate),window.addEventListener("resize",this.resize)}waitForCssVars(){if(this.computedCanvasStyle&&this.computedCanvasStyle.getPropertyValue("--gradient-color-1").indexOf("#")!==-1)this.init(),this.addIsLoadedClass();else{if(this.cssVarRetries+=1,this.cssVarRetries>this.maxCssVarRetries)return this.sectionColors=[16711680,16711680,16711935,65280,255],void this.init();requestAnimationFrame(()=>this.waitForCssVars())}}initGradientColors(){this.sectionColors=["--gradient-color-1","--gradient-color-2","--gradient-color-3","--gradient-color-4"].map(o=>{let a=this.computedCanvasStyle.getPropertyValue(o).trim();return a.length===4&&(a=`#${a.substr(1).split("").map(y=>y+y).join("")}`),a&&`0x${a.substr(1)}`}
385).filter(Boolean).map(g)}}var O=E})(U)),U.exports}var k=P();const H=V(k),Y={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 167 233"};function K(_,f){return F(),$("svg",Y,[...f[0]||(f[0]=[p("path",{fill:"url(#a)","fill-rule":"evenodd",d:"M51.069 16.02 89.409 0 178 36.536l-53.476 14.042c-2.215-5.767-4.685-11.443-6.589-13.779-3.575-4.379-14.604-11.32-28.991-11.32-15.528 0-26.139 7.326-29.58 11.2-1.59 1.797-4.29 7.723-6.922 14.09l-14.046-3.593v4.684a4.06 4.06 0 0 1 1.843 3.4c0 1.544-.871 2.872-2.14 3.56.68.276 1.356.692 2.028 1.264l.957 12.302c0 2.62-9.821 2.62-9.821 0l.957-12.302q1.03-.844 2.044-1.255c-1.278-.685-2.157-2.018-2.157-3.57 0-1.424.736-2.673 1.844-3.4V23.02c0-3.126 2.44-5.776 5.556-6.038zm-21.931 9.162V44.81L0 37.356zm63.215 67.982 19.194 28.144c5.196-7.88 12.492-19.381 14.921-30.866 2.438-11.54-1.319-22.548-16.787-28.9-3.459 7.104-17.328 31.622-17.328 31.622M62.311 39.08c-3.06 3.455-12.902 30.131-12.902 30.131 3.438-4.016 14.693-15.03 39.632-15.03 21.496 0 37.097 12.512 37.097 12.512s-7.424-22.96-11.214-27.613c-2.443-2.994-12.085-9.897-25.963-9.897-13.23 0-23.215 6.028-26.65 9.897m22.484 120.627c-13.977 18.912-29.183 42.332-31.693 73.024 0 0-10.62-15.435-23.007-40.45-4.906-9.112 6.549-26.12 34.903-63.843 5.533 8.867 10.26 16.014 13.709 21.227 4.088 6.181 6.38 9.646 6.088 10.043zm91.467 48.614h-50.91c-17.067-22.604-68.058-91.299-74.274-117.472-5.745-24.177 18.553-29.304 18.553-29.304 17.036 34.472 78.964 121.73 106.631 146.776","clip-rule":"evenodd"},null,-1),p("defs",null,[p("linearGradient",{id:"a",x1:"87.624",x2:"108.016",y1:"50.019",y2:"208.99",gradientUnits:"userSpaceOnUse"},[p("stop"),p("stop",{offset:"1","stop-opacity":"0"})])],-1)])])}const W={render:K},X="_splash_item_1e1u0_1",J="_splash_item_canvas_1e1u0_6",Q="_splash_item_logo_1e1u0_15",Z="_splash_item_slot_1e1u0_23",ee={splash_item:X,splash_item_canvas:J,splash_item_logo:Q,splash_item_slot:Z},te=["id"],ne={__name:"splash-item",setup(_){const{Gradient:f}=H,C=j(),w=C.meta.theme==="academy"?"stripe-gradient-academy":"stripe-gradient";return B(()=>{new f().initGradient(`#${w}`)}),(g,n)=>(F(),$("div",{class:L(g.$style.splash_item)},[p("canvas",{id:D(w),class:L(g.$style.splash_item_canvas)},null,10,te),D(C).meta.theme==="academy"?(F(),q(D(W),{key:0,class:L(g.$style.splash_item_logo)},null,8,["class"])):I("",!0),p("div",{class:L(g.$style.splash_item_slot)},[G(g.$slots,"default")],2)],2))}},ie={$style:ee},oe=T(ne,[["__cssModules",ie]]);export{oe as S};
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.