PageSourceSearch

https://peterbuley.com/dist/animated-bg-gradient-blinds.b9e563a79aa7e47b929b.js

js peterbuley.com collected 2026-10-06 03:41:48 UTC 9,414 bytes, 1 lines download raw bytes

1(self.webpackChunkfolio=self.webpackChunkfolio||[]).push([[8802],{75236(n,e,o){"use strict";o.r(e),o.d(e,{default:()=>l});var t=o(31601),r=o.n(t),u=o(76314),i=o.n(u)()(r());i.push([n.id,"\n.gradient-blinds-root[data-v-358b9633] {\n  position: relative;\n  width: 100%;\n  height: 100%;\n  overflow: hidden;\n}\n",""]);const l=i},29266(n,e,o){"use strict";o.r(e),o.d(e,{default:()=>m});var t=o(20641),r=o(90033),u=o(29412),i=o(4347),l=o(82459),a=o(39040),f=o(50953);function s(n){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},s(n)}function v(n,e){var o=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})),o.push.apply(o,t)}return o}function c(n){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?v(Object(o),!0).forEach(function(e){d(n,e,o[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):v(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}function d(n,e,o){return(e=function(n){var e=function(n,e){if("object"!=s(n)||!n)return n;var o=n[Symbol.toPrimitive];if(void 0!==o){var t=o.call(n,e||"default");if("object"!=s(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(n)}(n,"string");return"symbol"==s(e)?e:e+""}(e))in n?Object.defineProperty(n,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[e]=o,n}const p=(0,t.pM)({__name:"GradientBlinds",props:{className:{},dpr:{},paused:{type:Boolean,default:!1},gradientColors:{},angle:{default:0},noise:{default:.3},blindCount:{default:16},blindMinWidth:{default:60},mouseDampening:{default:.15},mirrorGradient:{type:Boolean,default:!1},spotlightRadius:{default:.5},spotlightSoftness:{default:1},spotlightOpacity:{default:1},distortAmount:{default:0},shineDirection:{default:"left"},mixBlendMode:{default:"lighten"}},setup:function(n){var e=function(n){var e=n.replace("#","").padEnd(6,"0");return[parseInt(e.slice(0,2),16)/255,parseInt(e.slice(2,4),16)/255,parseInt(e.slice(4,6),16)/255]},o=n,s=(0,t.rk)("containerRef"),v=(0,f.KR)(0),d=(0,f.KR)(null),p=(0,f.KR)(null),m=(0,f.KR)(null),g=(0,f.KR)(null),h=(0,f.KR)([0,0]),C=(0,f.KR)(0),y=(0,f.KR)(!0),b=null,w=function(){var n,t=s.value;if(t){var r=new u.A({dpr:null!==(n=o.dpr)&&void 0!==n?n:"undefined"!=typeof window&&window.devicePixelRatio||1,alpha:!0,antialias:!0});g.value=r;var f=r.gl,c=f.canvas;c.style.width="100%",c.style.height="100%",c.style.display="block",t.appendChild(c);var w=function(n){var o,t=(n&&n.length?n:["#FF9FFC","#27FF64"]).slice(0,8);for(1===t.length&&t.push(t[0]);t.length<8;)t.push(t[t.length-1]);for(var r=[],u=0;u<8;u++)r.push(e(t[u]));return{arr:r,count:Math.max(2,Math.min(8,null!==(o=null==n?void 0:n.length)&&void 0!==o?o:2))}}(o.gradientColors),x=w.arr,M=w.count,R={iResolution:{value:[f.drawingBufferWidth,f.drawingBufferHeight,1]},iMouse:{value:[0,0]},iTime:{value:0},uAngle:{value:o.angle*Math.PI/180},uNoise:{value:o.noise},uBlindCount:{value:Math.max(1,o.blindCount)},uSpotlightRadius:{value:o.spotlightRadius},uSpotlightSoftness:{value:o.spotlightSoftness},uSpotlightOpacity:{value:o.spotlightOpacity},uMirror:{value:o.mirrorGradient?1:0},uDistort:{value:o.distortAmount},uShineFlip:{value:"right"===o.shineDirection?1:0},uColor0:{value:x[0]},uColor1:{value:x[1]},uColor2:{value:x[2]},uColor3:{value:x[3]},uColor4:{value:x[4]},uColor5:{value:x[5]},uColor6:{value:x[6]},uColor7:{value:x[7]},uColorCount:{value:M}},S=new i.B(f,{vertex:"\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\n\nvoid main() {\n  vUv = uv;\n  gl_Position = vec4(position, 0.0, 1.0);\n}\n",fragment:"\n#ifdef GL_ES\nprecision mediump float;\n#endif\n\nuniform vec3  iResolution;\nuniform vec2  iMouse;\nuniform float iTime;\n\nuniform float uAngle;\nuniform float uNoise;\nuniform float uBlindCount;\nuniform float uSpotlightRadius;\nuniform float uSpotlightSoftness;\nuniform float uSpotlightOpacity;\nuniform float uMirror;\nuniform float uDistort;\nuniform float uShineFlip;\nuniform vec3  uColor0;\nuniform vec3  uColor1;\nuniform vec3  uColor2;\nuniform vec3  uColor3;\nuniform vec3  uColor4;\nuniform vec3  uColor5;\nuniform vec3  uColor6;\nuniform vec3  uColor7;\nuniform int   uColorCount;\n\nvarying vec2 vUv;\n\nfloat rand(vec2 co){\n  return fract(sin(dot(co, vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec2 rotate2D(vec2 p, float a){\n  float c = cos(a);\n  float s = sin(a);\n  return mat2(c, -s, s, c) * p;\n}\n\nvec3 getGradientColor(float t){\n  float tt = clamp(t, 0.0, 1.0);\n  int count = uColorCount;\n  if (count < 2) count = 2;\n  float scaled = tt * float(count - 1);\n  float seg = floor(scaled);\n  float f = fract(scaled);\n\n  if (seg < 1.0) return mix(uColor0, uColor1, f);\n  if (seg < 2.0 && count > 2) return mix(uColor1, uColor2, f);\n  if (seg < 3.0 && count > 3) return mix(uColor2, uColor3, f);\n  if (seg < 4.0 && count > 4) return mix(uColor3, uColor4, f);\n  if (seg < 5.0 && count > 5) return mix(uColor4, uColor5, f);\n  if (seg < 6.0 && count > 6) return mix(uColor5, uColor6, f);\n  if (seg < 7.0 && count > 7) return mix(uColor6, uColor7, f);\n  if (count >
1 7) return uColor7;\n  if (count > 6) return uColor6;\n  if (count > 5) return uColor5;\n  if (count > 4) return uColor4;\n  if (count > 3) return uColor3;\n  if (count > 2) return uColor2;\n  return uColor1;\n}\n\nvoid mainImage( out vec4 fragColor, in vec2 fragCoord )\n{\n    vec2 uv0 = fragCoord.xy / iResolution.xy;\n\n    float aspect = iResolution.x / iResolution.y;\n    vec2 p = uv0 * 2.0 - 1.0;\n    p.x *= aspect;\n    vec2 pr = rotate2D(p, uAngle);\n    pr.x /= aspect;\n    vec2 uv = pr * 0.5 + 0.5;\n\n    vec2 uvMod = uv;\n    if (uDistort > 0.0) {\n      float a = uvMod.y * 6.0;\n      float b = uvMod.x * 6.0;\n      float w = 0.01 * uDistort;\n      uvMod.x += sin(a) * w;\n      uvMod.y += cos(b) * w;\n    }\n    float t = uvMod.x;\n    if (uMirror > 0.5) {\n      t = 1.0 - abs(1.0 - 2.0 * fract(t));\n    }\n    vec3 base = getGradientColor(t);\n\n    vec2 offset = vec2(iMouse.x/iResolution.x, iMouse.y/iResolution.y);\n  float d = length(uv0 - offset);\n  float r = max(uSpotlightRadius, 1e-4);\n  float dn = d / r;\n  float spot = (1.0 - 2.0 * pow(dn, uSpotlightSoftness)) * uSpotlightOpacity;\n  vec3 cir = vec3(spot);\n  float stripe = fract(uvMod.x * max(uBlindCount, 1.0));\n  if (uShineFlip > 0.5) stripe = 1.0 - stripe;\n    vec3 ran = vec3(stripe);\n\n    vec3 col = cir + base - ran;\n    col += (rand(gl_FragCoord.xy + iTime) - 0.5) * uNoise;\n\n    fragColor = vec4(col, 1.0);\n}\n\nvoid main() {\n    vec4 color;\n    mainImage(color, vUv * iResolution.xy);\n    gl_FragColor = color;\n}\n",uniforms:R});d.value=S;var O=new l.l(f);m.value=O;var B=new a.e(f,{geometry:O,program:S});p.value=B;var D=function(){var n=t.getBoundingClientRect();if(r.setSize(n.width,n.height),R.iResolution.value=[f.drawingBufferWidth,f.drawingBufferHeight,1],o.blindMinWidth&&o.blindMinWidth>0){var e=Math.max(1,Math.floor(n.width/o.blindMinWidth)),u=o.blindCount?Math.min(o.blindCount,e):e;R.uBlindCount.value=Math.max(1,u)}else R.uBlindCount.value=Math.max(1,o.blindCount);if(y.value){y.value=!1;var i=f.drawingBufferWidth/2,l=f.drawingBufferHeight/2;R.iMouse.value=[i,l],h.value=[i,l]}};D();var F=new ResizeObserver(D);F.observe(t);var j=function(n){var e=c.getBoundingClientRect(),t=r.dpr||1,u=(n.clientX-e.left)*t,i=(e.height-(n.clientY-e.top))*t;h.value=[u,i],o.mouseDampening<=0&&(R.iMouse.value=[u,i])};c.addEventListener("pointermove",j);var P=function(n){if(v.value=requestAnimationFrame(P),R.iTime.value=.001*n,o.mouseDampening>0){C.value||(C.value=n);var e=(n-C.value)/1e3;C.value=n;var t=Math.max(1e-4,o.mouseDampening),u=1-Math.exp(-e/t);u>1&&(u=1);var i=h.value,l=R.iMouse.value;l[0]+=(i[0]-l[0])*u,l[1]+=(i[1]-l[1])*u}else C.value=n;if(!o.paused&&d.value&&p.value)try{r.render({scene:p.value})}catch(n){console.error(n)}};v.value=requestAnimationFrame(P),b=function(){v.value&&cancelAnimationFrame(v.value),c.removeEventListener("pointermove",j),F.disconnect(),c.parentElement===t&&t.removeChild(c);var n=function(n,e){n&&"function"==typeof n[e]&&n[e].call(n)};n(d.value,"remove"),n(m.value,"remove"),n(p.value,"remove"),n(g.value,"destroy"),d.value=null,m.value=null,p.value=null,g.value=null}}};return(0,t.sV)(function(){w()}),(0,t.xo)(function(){var n;null===(n=b)||void 0===n||n()}),(0,t.wB)(o,function(){var n;null===(n=b)||void 0===n||n(),w()},{deep:!0}),function(e,o){return(0,t.uX)(),(0,t.CE)("div",{ref_key:"containerRef",ref:s,class:(0,r.C4)(["gradient-blinds-root",n.className]),style:(0,r.Tr)(c({},n.mixBlendMode?{mixBlendMode:n.mixBlendMode}:{}))},null,6)}}});o(71669);const m=(0,o(66262).A)(p,[["__scopeId","data-v-358b9633"]])},71669(n,e,o){var t=o(75236);t.__esModule&&(t=t.default),"string"==typeof t&&(t=[[n.id,t,""]]),t.locals&&(n.exports=t.locals);(0,o(70534).A)("4e799b61",t,!1,{})},82459(n,e,o){"use strict";o.d(e,{l:()=>r});var t=o(2727);class r extends t.V{constructor(n,{attributes:e={}}={}){Object.assign(e,{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(n,e)}}}}]);

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.