-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex_c7da.2f51790a.js
1 lines (1 loc) · 6.34 KB
/
index_c7da.2f51790a.js
1
(function(_){for(var r in _){_[r].__farm_resource_pot__='index_c7da.js';(globalThis || window || global)['4b6f8beb5d28e5f6af150793b77121b9'].__farm_module_system__.register(r,_[r])}})({"174b47ed":function n(n,e,a,o){n._m(e),n.o(e,"a",()=>s);var i=a("66b868ac"),t=a("5ce35544");function r(){var n=i.a(["\n precision mediump float;\n uniform vec3 color;\n uniform float numLines;\n uniform float lengthVariation;\n uniform vec2 transparencyRange;\n uniform bool useSepia;\n uniform bool useBurnOverlay;\n uniform bool useDivideOverlay;\n uniform float time;\n uniform float animationSpeed;\n varying vec2 vUv;\n\n float rand(vec2 co) {\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n }\n\n vec3 toSepia(vec3 color) {\n const mat3 mat = mat3(\n 0.493, 0.969, 0.189, // Increased red component\n 0.349, 0.686, 0.168, // Decreased green component\n 0.172, 0.534, 0.131);\n return clamp(color * mat * 1.2, 0.0, 1.0);\n }\n\n vec3 burnOverlay(vec3 base, vec3 blend) {\n return 1.0 - (1.0 - base) / (blend + 0.001);\n }\n\n void main() {\n float y = vUv.y * numLines;\n float lineIndex = floor(y);\n float t = fract(y);\n\n float lineLength = 0.5 + lengthVariation * rand(vec2(lineIndex, 0.0));\n float transparency = mix(transparencyRange.x, transparencyRange.y, rand(vec2(lineIndex, 1.0)));\n\n // Animate the phase of the sine wave based on time and line index\n float cycleTime = mod(time, 400.0); // Create a 400-second cycle\n float phaseOffset = (cycleTime * 0.025005 + lineIndex * 0.004995) * 2.0; // 2 times slower\n float sine = sin((vUv.y + phaseOffset) * 3.14159 * 2.0);\n float line = smoothstep(0.0, 0.1, abs(sine)); // Adjusted for sharper lines\n\n // New animation along the lines\n float alongLineAnim = sin((vUv.x - time * animationSpeed * 0.1) * 3.14159 * 4.0) * 0.5 + 0.5;\n line *= alongLineAnim;\n\n float fade = sin(vUv.x * 3.14159); // Keep fade based on vUv.x for horizontal fading\n \n vec3 finalColor = useSepia ? toSepia(color) : color;\n if (useBurnOverlay) {\n finalColor = burnOverlay(finalColor, vec3(0.8, 0.5, 0.2));\n }\n gl_FragColor = vec4(toSepia(finalColor), line * fade * transparency);\n }\n "]);return r=function(){return n;},n;}function l(){var n=i.a(["\n precision mediump float;\n attribute vec2 position;\n uniform mat4 projection, view, model;\n uniform float time;\n varying vec2 vUv;\n void main() {\n vUv = position * 0.5 + 0.5;\n float widthAnimation = sin(time * 0.5) * 0.2 + 1.0; // Oscillate between 0.8 and 1.2\n vec4 pos = vec4(position.x * widthAnimation, position.y, 0, 1);\n gl_Position = projection * view * model * pos;\n }\n "]);return l=function(){return n;},n;}var c=n=>n;function s(n,e,a,o,i,s,v){var f=!(arguments.length>7)||void 0===arguments[7]||arguments[7],m=!(arguments.length>8)||void 0===arguments[8]||arguments[8],u=arguments.length>9&&void 0!==arguments[9]&&arguments[9],d=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1,p=n.buffer([-1,-1,1,-1,1,1,-1,1]),y=n({frag:c(r()),vert:c(l()),attributes:{position:p},uniforms:{color:()=>o,numLines:()=>45,lengthVariation:()=>i,transparencyRange:()=>v,useSepia:()=>f,useBurnOverlay:()=>m,useDivideOverlay:()=>u,model:()=>{var n=t.a.create();return t.a.translate(n,n,e),t.a.multiply(n,n,a),t.a.scale(n,n,[3.75,.25*s,1]),n;},view:n.prop("view"),projection:n.prop("projection"),time:n.prop("time"),animationSpeed:()=>d},count:4,primitive:"triangle fan",blend:{enable:!0,func:{srcRGB:"src alpha",srcAlpha:1,dstRGB:"one minus src alpha",dstAlpha:1},equation:{rgb:"add",alpha:"add"}},depth:{enable:!1}});return{draw:n=>{y(n);}};}},"2e9b950b":function a(a,e,t,n){a._m(e),t("8a02f26b");var i=a.i(t("2614695f")),o=t("5ce35544"),r=t("174b47ed"),v=t("ff988c96"),l=a.i(t("7973b004")),u=document.getElementById("canvas"),h={seed:Math.floor(Math.random()*Number.MAX_SAFE_INTEGER),numBatches:15,numGroups:5},s=a.f(i)({canvas:u,attributes:{antialias:!0,samples:2}}),d=v.n(h.seed),p=v.n(h.numBatches),c=v.n(h.numGroups),f=v.n(13);function m(){return innerWidth/innerHeight;}var g=v.n(m()),w=v.k(()=>o.a.perspective([],Math.PI/6,g.value,.01,1e3)),M=v.k(()=>o.a.lookAt([],[0,0,f.value],[0,0,0],[0,1,0]));function b(a){var e=a.innerWidth,t=a.innerHeight;u.width=e,u.height=t,g.value=m();}v.m(()=>{s.destroy(),function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a.value,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.value,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.value,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n.value,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:M.value,v=arguments.length>5&&void 0!==arguments[5]?arguments[5]:w.value,l=function(a,e,t,n){for(var i=[],v=[],l=0;l<t;l++)v.push({pivotX:(n()-.5)*2,pivotY:l%2>0?1:-1,pivotZ:0});for(var u=Math.floor(e/t),h=e%t,s=0;s<t;s++)for(var d=u+(s<h?1:0),p=v[s],c=0;c<d;c++){var f=o.a.create(),m=Math.PI/10*1,g=(n()*(m-0)+0)*(.5>n()?1:-1),w=(n()*(m-0)+0)*(.5>n()?1:-1),M=n()*Math.PI*2;o.a.rotateX(f,f,g),o.a.rotateY(f,f,w),o.a.rotateZ(f,f,M);var b=(n()-.5)*2,y=(n()-.5)*1;i.push({position:[p.pivotX+b,p.pivotY+0,p.pivotZ+y],rotation:f,color:[n(),n(),n()],lengthVariation:10,widthVariation:.5*n()+1.1,transparencyRange:[0,.35]});}return i.map(e=>r.a(a,e.position,e.rotation,e.color,e.lengthVariation,e.widthVariation,e.transparencyRange,e.useBurnOverlay,e.useDivideOverlay,2*n()+.5));}(a,e,t,n),u=Date.now();a.frame(()=>{a.clear({color:[0,0,0,1],depth:1});var e={view:i,projection:v,time:(Date.now()-u)/1e3};l.forEach(a=>a.draw(e));});}(s=a.f(i)({canvas:u,attributes:{antialias:!0,samples:2}}),p.value,c.value,a.f(l)(d.value.toString())),s.poll();}),v.m(()=>{M.value,w.value,g.value,s.poll();}),window.addEventListener("resize",()=>b(window),!1),b(window);},});