anegis-webflow-new 1.1.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +137 -1
- package/package.json +1 -1
- package/src/index.ts +9 -2
package/dist/index.js
CHANGED
|
@@ -1 +1,137 @@
|
|
|
1
|
-
"use strict";(()=>{var
|
|
1
|
+
"use strict";(()=>{var oe=Object.defineProperty;var ne=(d,o,e)=>o in d?oe(d,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):d[o]=e;var _=(d,o,e)=>ne(d,typeof o!="symbol"?o+"":o,e);var B=(d=document)=>{let o="Last Published:";for(let e of d.childNodes)if(e.nodeType===Node.COMMENT_NODE&&e.textContent?.includes(o)){let t=e.textContent.trim().split(o)[1];if(t)return new Date(t)}};var z=()=>{let d=B();console.log("index.js loaded"),console.log(`Last published: ${d?.toLocaleString("en-US",{year:"numeric",month:"long",day:"2-digit",hour:"2-digit",minute:"2-digit"})}`)};function U(d){let o=d.match(/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);return o?[parseInt(o[1],16)/255,parseInt(o[2],16)/255,parseInt(o[3],16)/255]:null}var re=[.224,.478,.463],ie=[.106,.275,.435],se=[.047,.047,.047],V=()=>{let d=document.querySelector("[data-blob-main]");if(!d)return;d.innerHTML="";let o=d.getAttribute("data-color-1"),e=d.getAttribute("data-color-2"),t=d.getAttribute("data-color-3"),i=d.getAttribute("data-blur")||"1.2rem",r=o&&U(o)||re,n=e&&U(e)||ie,m=t&&U(t)||se,c=document.createElement("canvas");c.style.cssText=`position:absolute;inset:0;width:100%;height:100%;filter:blur(${i});`,d.appendChild(c);let a=document.createElement("canvas");a.style.cssText="position:absolute;inset:0;width:100%;height:100%;pointer-events:none;mix-blend-mode:overlay;",d.appendChild(a);let l=a.getContext("2d"),s=c.getContext("webgl");if(!s){console.error("WebGL not supported");return}let S=`
|
|
2
|
+
attribute vec2 a_position;
|
|
3
|
+
varying vec2 v_uv;
|
|
4
|
+
void main() {
|
|
5
|
+
v_uv = a_position * 0.5 + 0.5;
|
|
6
|
+
gl_Position = vec4(a_position, 0.0, 1.0);
|
|
7
|
+
}
|
|
8
|
+
`,O=`
|
|
9
|
+
precision highp float;
|
|
10
|
+
|
|
11
|
+
varying vec2 v_uv;
|
|
12
|
+
uniform float u_time;
|
|
13
|
+
uniform vec2 u_resolution;
|
|
14
|
+
uniform vec3 u_color1;
|
|
15
|
+
uniform vec3 u_color2;
|
|
16
|
+
uniform vec3 u_colorBg;
|
|
17
|
+
|
|
18
|
+
// Simplex noise functions
|
|
19
|
+
vec3 mod289(vec3 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }
|
|
20
|
+
vec2 mod289(vec2 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }
|
|
21
|
+
vec3 permute(vec3 x) { return mod289(((x*34.0)+1.0)*x); }
|
|
22
|
+
|
|
23
|
+
float snoise(vec2 v) {
|
|
24
|
+
const vec4 C = vec4(0.211324865405187, 0.366025403784439,
|
|
25
|
+
-0.577350269189626, 0.024390243902439);
|
|
26
|
+
vec2 i = floor(v + dot(v, C.yy));
|
|
27
|
+
vec2 x0 = v - i + dot(i, C.xx);
|
|
28
|
+
vec2 i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);
|
|
29
|
+
vec4 x12 = x0.xyxy + C.xxzz;
|
|
30
|
+
x12.xy -= i1;
|
|
31
|
+
i = mod289(i);
|
|
32
|
+
vec3 p = permute(permute(i.y + vec3(0.0, i1.y, 1.0)) + i.x + vec3(0.0, i1.x, 1.0));
|
|
33
|
+
vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);
|
|
34
|
+
m = m*m;
|
|
35
|
+
m = m*m;
|
|
36
|
+
vec3 x = 2.0 * fract(p * C.www) - 1.0;
|
|
37
|
+
vec3 h = abs(x) - 0.5;
|
|
38
|
+
vec3 ox = floor(x + 0.5);
|
|
39
|
+
vec3 a0 = x - ox;
|
|
40
|
+
m *= 1.79284291400159 - 0.85373472095314 * (a0*a0 + h*h);
|
|
41
|
+
vec3 g;
|
|
42
|
+
g.x = a0.x * x0.x + h.x * x0.y;
|
|
43
|
+
g.yz = a0.yz * x12.xz + h.yz * x12.yw;
|
|
44
|
+
return 130.0 * dot(m, g);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Fractal Brownian Motion for richer noise
|
|
48
|
+
float fbm(vec2 p) {
|
|
49
|
+
float value = 0.0;
|
|
50
|
+
float amplitude = 0.5;
|
|
51
|
+
float frequency = 1.0;
|
|
52
|
+
for (int i = 0; i < 4; i++) {
|
|
53
|
+
value += amplitude * snoise(p * frequency);
|
|
54
|
+
amplitude *= 0.5;
|
|
55
|
+
frequency *= 2.0;
|
|
56
|
+
}
|
|
57
|
+
return value;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Film grain
|
|
61
|
+
float grain(vec2 uv, float t) {
|
|
62
|
+
return fract(sin(dot(uv + t, vec2(12.9898, 78.233))) * 43758.5453);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
void main() {
|
|
66
|
+
vec2 uv = v_uv;
|
|
67
|
+
float time = u_time * 1.01; // Animation speed
|
|
68
|
+
|
|
69
|
+
// --- CENTER the blob in the canvas ---
|
|
70
|
+
vec2 center = vec2(0.5, 0.5);
|
|
71
|
+
vec2 fromCenter = uv - center;
|
|
72
|
+
|
|
73
|
+
// Distance that works for rectangular canvas - use max of abs coords
|
|
74
|
+
// This ensures we reach the edge on ALL sides (not just corners)
|
|
75
|
+
float distX = abs(fromCenter.x) * 2.0; // 0 at center, 1 at left/right edge
|
|
76
|
+
float distY = abs(fromCenter.y) * 2.0; // 0 at center, 1 at top/bottom edge
|
|
77
|
+
float dist = max(distX, distY); // Use maximum - reaches 1.0 at any edge
|
|
78
|
+
|
|
79
|
+
// --- ANIMATED NOISE for organic color morphing ---
|
|
80
|
+
vec2 noiseCoord = uv * 6.0;
|
|
81
|
+
float n1 = fbm(noiseCoord + vec2(time * 0.6, time * 0.4));
|
|
82
|
+
float n2 = fbm(noiseCoord * 0.8 - vec2(time * 0.5, time * -0.3));
|
|
83
|
+
float noise = (n1 + n2) * 0.5;
|
|
84
|
+
|
|
85
|
+
// --- COLOR MIXING: two colors morphing together ---
|
|
86
|
+
float colorMix = noise * 0.75 + 0.5;
|
|
87
|
+
colorMix = smoothstep(0.3, 0.7, colorMix);
|
|
88
|
+
vec3 gradientColor = mix(u_color1, u_color2, colorMix);
|
|
89
|
+
|
|
90
|
+
// --- RADIAL FADE: MUST reach background before canvas edges ---
|
|
91
|
+
float edgeNoise = snoise(uv * 4.0 + time * 0.2) * 0.5;
|
|
92
|
+
|
|
93
|
+
// Fade from center to edges
|
|
94
|
+
float innerRadius = 0.2 + edgeNoise; // Start fading at 20% from center
|
|
95
|
+
float outerRadius = 0.9; // Complete fade at 90% (before edge)
|
|
96
|
+
|
|
97
|
+
float fade = smoothstep(innerRadius, outerRadius, dist);
|
|
98
|
+
|
|
99
|
+
// Apply fade: gradient -> background
|
|
100
|
+
vec3 finalColor = mix(gradientColor, u_colorBg, fade);
|
|
101
|
+
|
|
102
|
+
gl_FragColor = vec4(finalColor, 1.0);
|
|
103
|
+
}
|
|
104
|
+
`;function q(h,x,g){let y=h.createShader(x);return y?(h.shaderSource(y,g),h.compileShader(y),h.getShaderParameter(y,h.COMPILE_STATUS)?y:(console.error("Shader compile error:",h.getShaderInfoLog(y)),h.deleteShader(y),null)):null}let R=q(s,s.VERTEX_SHADER,S),k=q(s,s.FRAGMENT_SHADER,O);if(!R||!k)return;let f=s.createProgram();if(!f)return;if(s.attachShader(f,R),s.attachShader(f,k),s.linkProgram(f),!s.getProgramParameter(f,s.LINK_STATUS)){console.error("Program link error:",s.getProgramInfoLog(f));return}let u=s.createBuffer();s.bindBuffer(s.ARRAY_BUFFER,u),s.bufferData(s.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),s.STATIC_DRAW);let b=s.getAttribLocation(f,"a_position"),M=s.getUniformLocation(f,"u_time"),p=s.getUniformLocation(f,"u_resolution"),L=s.getUniformLocation(f,"u_color1"),E=s.getUniformLocation(f,"u_color2"),w=s.getUniformLocation(f,"u_colorBg");function A(){let h=window.devicePixelRatio||1,x=Math.floor(c.clientWidth*h),g=Math.floor(c.clientHeight*h);(c.width!==x||c.height!==g)&&(c.width=x,c.height=g),(a.width!==x||a.height!==g)&&(a.width=x,a.height=g)}let v,H=performance.now(),P=0,N=12,te=.08,$=4,T=null;function G(){A(),s.viewport(0,0,c.width,c.height),s.useProgram(f);let h=(performance.now()-H)/1e3;s.uniform1f(M,h),s.uniform2f(p,c.width,c.height),s.uniform3f(L,r[0],r[1],r[2]),s.uniform3f(E,n[0],n[1],n[2]),s.uniform3f(w,m[0],m[1],m[2]),s.enableVertexAttribArray(b),s.bindBuffer(s.ARRAY_BUFFER,u),s.vertexAttribPointer(b,2,s.FLOAT,!1,0,0),s.drawArrays(s.TRIANGLES,0,6);let x=performance.now();if(l&&x-P>1e3/N){P=x;let g=Math.ceil(a.width/$),y=Math.ceil(a.height/$);(!T||T.width!==g||T.height!==y)&&(T=l.createImageData(g,y));let{data:I}=T;for(let C=0;C<I.length;C+=4){let F=(Math.random()-.5)*255*te;I[C]=128+F,I[C+1]=128+F,I[C+2]=128+F,I[C+3]=255}l.clearRect(0,0,a.width,a.height),l.imageSmoothingEnabled=!1,l.putImageData(T,0,0),l.drawImage(a,0,0,g,y,0,0,a.width,a.height)}v=requestAnimationFrame(G)}G();let W=new MutationObserver(h=>{for(let x of h)for(let g of x.removedNodes)(g===c||g instanceof Element&&g.contains(c))&&(cancelAnimationFrame(v),W.disconnect())});W.observe(d.parentElement||document.body,{childList:!0,subtree:!0})};var X=(d={pauseOnHover:!1})=>{let o=document.querySelector(".banner_component"),e=document.querySelector(".banner_inner-wrapper"),t=document.querySelector(".banner_marquee");if(!o||!e||!t)return;let i="perfect-marquee-styles";if(!document.getElementById(i)){let n=document.createElement("style");n.id=i;let m=d.pauseOnHover?`
|
|
105
|
+
/* Pause on hover for better UX (Optional) */
|
|
106
|
+
.banner_component:hover .banner_marquee {
|
|
107
|
+
animation-play-state: paused;
|
|
108
|
+
}
|
|
109
|
+
`:"";n.textContent=`
|
|
110
|
+
.banner_inner-wrapper {
|
|
111
|
+
/* Ensure the gap between the original and clone matches the internal grid gap */
|
|
112
|
+
column-gap: 3rem;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.banner_marquee {
|
|
116
|
+
/* Animate the list */
|
|
117
|
+
animation: scroll-left 30s linear infinite;
|
|
118
|
+
will-change: transform;
|
|
119
|
+
/* Ensure layout is stable */
|
|
120
|
+
grid-auto-flow: column;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
@keyframes scroll-left {
|
|
124
|
+
from {
|
|
125
|
+
transform: translateX(0);
|
|
126
|
+
}
|
|
127
|
+
to {
|
|
128
|
+
/*
|
|
129
|
+
* IMPORTANT:
|
|
130
|
+
* We translate by -100% of the element's width
|
|
131
|
+
* PLUS the column-gap (3rem) so it lines up perfectly.
|
|
132
|
+
*/
|
|
133
|
+
transform: translateX(calc(-100% - 3rem));
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
${m}
|
|
137
|
+
`,document.head.appendChild(n)}if(e.querySelectorAll(".banner_marquee").length===1){let n=t.cloneNode(!0);n.setAttribute("aria-hidden","true"),n.classList.add("is-clone"),e.appendChild(n)}};function Y(){let d=document.querySelector("[data-line-scroll] line");if(!d)return;let o=d.closest("svg");o&&gsap.set(o,{attr:{preserveAspectRatio:"none"}}),gsap.to(d,{strokeDashoffset:-16,duration:1,ease:"none",repeat:-1})}function j(){let d=document.querySelectorAll(".layout_card.is-faq"),o=document.querySelectorAll(".about_component-image-outer");gsap.set(".layout-card-bottom",{height:0,overflow:"hidden",display:"block"}),gsap.set(o,{autoAlpha:0,display:"none",width:"100%",height:"100%",objectFit:"cover",position:"absolute",top:0,left:0});let e=document.querySelectorAll(".about_component-image-outer img");gsap.set(e,{width:"100%",height:"100%",objectFit:"cover"});function t(r,n){let m=r.querySelector(".layout-card-bottom"),c=r.querySelector(".layout_action-icon"),a=r.getAttribute("data-card"),l=document.querySelector(`.about_component-image-outer[data-image="${a}"]`);n?(m&&gsap.to(m,{height:"auto",duration:.6,ease:"power3.inOut"}),c&&c.classList.add("is-active"),l?(gsap.set(l,{display:"block",zIndex:2}),gsap.to(l,{autoAlpha:1,duration:.6,ease:"power3.inOut",overwrite:!0})):console.warn(`No image found for Card ID: ${a}`)):(gsap.to(m,{height:0,duration:.6,ease:"power3.inOut"}),c&&c.classList.remove("is-active"),l&&(gsap.set(l,{zIndex:1}),gsap.to(l,{autoAlpha:0,duration:.6,ease:"power3.inOut",onComplete:()=>gsap.set(l,{display:"none"})})))}let i=Array.from(d).find(r=>{let n=r.getAttribute("data-card");return document.querySelector(`.about_component-image-outer[data-image="${n}"]`)});i&&t(i,!0),d.forEach(r=>{let n=r.querySelector(".layout_card-top");n&&n.addEventListener("click",()=>{let m=r.querySelector(".layout-card-bottom"),c=m?gsap.getProperty(m,"height"):0,a=parseFloat(String(c))>0;d.forEach(l=>{l!==r&&t(l,!1)}),a||t(r,!0)})})}function K(){if(!window.matchMedia("(hover: hover) and (pointer: fine)").matches)return;let o=document.querySelectorAll("[data-cursor]"),e=document.getElementById("cursor-hijack"),t=document.getElementById("cursor-trail-canvas"),i=document.getElementById("cursor-trail-path"),r=document.getElementById("trailGradient");if(!e||!t||!i||!o.length)return;if(typeof gsap>"u"){console.warn("GSAP not found");return}gsap.set(i,{opacity:.08});let n={tipOffset:{x:0,y:14},trailOffset:32,positionLerp:.25,maxPoints:50,minDistance:4,trailDecay:.92,rotationLerp:.15,idleSpeedThreshold:.5},m=!1,c={x:0,y:0},a={x:0,y:0},l=[],s=0,S=0;function O(){t&&t.setAttribute("viewBox",`0 0 ${window.innerWidth} ${window.innerHeight}`)}O(),window.addEventListener("resize",O),window.addEventListener("mousemove",u=>{c.x=u.clientX,c.y=u.clientY},{passive:!0});function q(){m=!0,document.body.classList.add("cursor-active"),a.x=c.x,a.y=c.y,l=[];for(let u=0;u<n.maxPoints;u++)l.push({x:c.x,y:c.y});S=0,s=0}function R(){m=!1,document.body.classList.remove("cursor-active")}o.forEach(u=>{u.addEventListener("mouseenter",q),u.addEventListener("mouseleave",R)}),document.querySelectorAll(".button-wrapper").forEach(u=>{u.addEventListener("mouseenter",()=>{document.body.classList.add("cursor-hidden")}),u.addEventListener("mouseleave",()=>{document.body.classList.remove("cursor-hidden")})}),gsap.ticker.add(()=>{if(!m)return;a.x+=(c.x-a.x)*n.positionLerp,a.y+=(c.y-a.y)*n.positionLerp;let u=a.x-l[1].x,b=a.y-l[1].y;Math.hypot(u,b)>n.idleSpeedThreshold&&(s=Math.atan2(b,u)*(180/Math.PI));let p=s-S;p>180&&(p-=360),p<-180&&(p+=360),S+=p*n.rotationLerp;let L=S*Math.PI/180,E=a.x-Math.cos(L)*n.trailOffset,w=a.y-Math.sin(L)*n.trailOffset;l[0].x=E,l[0].y=w;for(let v=1;v<l.length;v++)l[v].x+=(l[v-1].x-l[v].x)*(1-n.trailDecay),l[v].y+=(l[v-1].y-l[v].y)*(1-n.trailDecay);let A=f(l);i&&i.setAttribute("d",A),k(),gsap.set(e,{x:a.x-n.tipOffset.x,y:a.y-n.tipOffset.y,rotation:S+180,transformOrigin:`${n.tipOffset.x}px ${n.tipOffset.y}px`})});function k(){if(!r||l.length<2)return;let u=l[l.length-1],b=l[0];r.setAttribute("x1",String(u.x)),r.setAttribute("y1",String(u.y)),r.setAttribute("x2",String(b.x)),r.setAttribute("y2",String(b.y))}function f(u,b=.5){if(u.length<2)return"";let M=`M ${u[0].x.toFixed(2)} ${u[0].y.toFixed(2)}`;for(let p=0;p<u.length-1;p++){let L=u[Math.max(p-1,0)],E=u[p],w=u[p+1],A=u[Math.min(p+2,u.length-1)],v=E.x+(w.x-L.x)/6*b,H=E.y+(w.y-L.y)/6*b,P=w.x-(A.x-E.x)/6*b,N=w.y-(A.y-E.y)/6*b;M+=` C ${v.toFixed(2)} ${H.toFixed(2)}, ${P.toFixed(2)} ${N.toFixed(2)}, ${w.x.toFixed(2)} ${w.y.toFixed(2)}`}return M}}function Q(){let d=document.querySelectorAll(".w-dropdown");function o(e){let t=e.querySelector(".w-dropdown-toggle"),i=e.querySelector(".w-dropdown-list"),r=e.querySelector(".dropdown_icon");t&&(t.classList.remove("w--open"),t.setAttribute("aria-expanded","false")),i&&i.classList.remove("w--open"),r&&r.classList.remove("is-open"),window.jQuery&&window.jQuery(e).trigger("w-close.w-dropdown")}d.forEach(e=>{let t=e.querySelector(".w-dropdown-toggle"),i=e.querySelector(".w-dropdown-list"),r=e.querySelector(".dropdown_icon");if(!t||!i)return;i.querySelectorAll("a").forEach(c=>{c.addEventListener("keydown",a=>{a.key==="Tab"&&setTimeout(()=>{e.contains(document.activeElement)||o(e)},0)})}),e.addEventListener("keydown",c=>{let a=c;a.key==="Escape"&&i.classList.contains("w--open")&&(o(e),t.focus(),a.preventDefault())}),new MutationObserver(c=>{c.forEach(a=>{if(a.attributeName==="class"){let l=t.classList.contains("w--open");r&&(l?r.classList.add("is-open"):r.classList.remove("is-open"))}})}).observe(t,{attributes:!0})}),document.addEventListener("focusin",e=>{d.forEach(t=>{let i=t.querySelector(".w-dropdown-list");i&&i.classList.contains("w--open")&&(t.contains(e.target)||o(t))})})}function J(){let d="[fs-scrolldisable-element='smart-nav']",o=".button-wrapper",e="is-pinned",t="w-variant-a4b72284-6321-8341-edca-223fdec43abe",n=document.querySelector(d);if(!n)return;let m=n.querySelector(o),c=!1,a=!1,l=()=>{let s=window.scrollY||window.pageYOffset;!a&&s>50?(n.classList.add(e),m&&m.classList.remove(t),a=!0):a&&s<40&&(n.classList.remove(e),m&&m.classList.add(t),a=!1),c=!1};window.addEventListener("scroll",()=>{c||(window.requestAnimationFrame(l),c=!0)},{passive:!0}),l()}function Z(){if(typeof Swiper>"u")return;let d=document.querySelector(".swiper-progress-track"),o=document.querySelector(".swiper-progress-thumb"),e=new Swiper(".swiper.w-dyn-list",{slidesPerView:1,spaceBetween:36,loop:!1,centeredSlides:!0,navigation:{nextEl:".swiper-arrow.is-next",prevEl:".swiper-arrow.is-prev"},breakpoints:{768:{slidesPerView:1},1024:{slidesPerView:1}},on:{init:function(){t(this),i(this)},slideChange:function(){t(this),i(this)}}});d&&d.addEventListener("click",function(r){let n=r,m=d.getBoundingClientRect(),c=n.clientX-m.left,a=m.width,l=c/a,s=e.slides.length,S=Math.floor(l*s);e.slideTo(S)});function t(r){r.slides.forEach(function(n,m){m===r.activeIndex?(n.style.transform="scale(1)",n.style.transition="transform 0.4s ease"):(n.style.transform="scale(0.9)",n.style.transition="transform 0.4s ease")})}function i(r){if(!o)return;let n=r.slides.length,c=(r.realIndex+1)/n*100;o.style.width=c+"%"}}var D=class{constructor(o){_(this,"tablistNode");_(this,"tabs",[]);_(this,"firstTab",null);_(this,"lastTab",null);_(this,"tabpanels",[]);this.tablistNode=o;let e=this.tablistNode.getAttribute("data-orientation")||"horizontal";this.tablistNode.setAttribute("aria-orientation",e),this.tabs=Array.from(this.tablistNode.querySelectorAll("[role=tab]")),this.tabs.forEach(i=>{let r=i.getAttribute("aria-controls");if(!r)return;let n=document.getElementById(r);i.tabIndex=i.getAttribute("aria-selected")==="true"?0:-1,n&&(n.setAttribute("role","tabpanel"),n.setAttribute("aria-labelledby",i.id),n.removeAttribute("tabindex"),this.tabpanels.push(n)),i.addEventListener("keydown",this.onKeydown.bind(this)),i.addEventListener("click",this.onClick.bind(this)),this.firstTab||(this.firstTab=i),this.lastTab=i});let t=this.tabs.find(i=>i.getAttribute("aria-selected")==="true")||this.firstTab;t&&this.setSelectedTab(t,!1)}setSelectedTab(o,e=!0){this.tabs.forEach(t=>{let i=t.getAttribute("aria-controls"),r=i?document.getElementById(i):null;o===t?(t.setAttribute("aria-selected","true"),t.tabIndex=0,t.classList.add("is-active-tab"),r&&(r.classList.add("is-active-tab"),r.removeAttribute("hidden"),r.removeAttribute("style")),e&&t.focus()):(t.setAttribute("aria-selected","false"),t.tabIndex=-1,t.classList.remove("is-active-tab"),r&&(r.classList.remove("is-active-tab"),r.setAttribute("hidden","true"),r.removeAttribute("style")))})}setSelectedToPreviousTab(o){if(o===this.firstTab&&this.lastTab)this.setSelectedTab(this.lastTab);else{let e=this.tabs.indexOf(o);this.setSelectedTab(this.tabs[e-1])}}setSelectedToNextTab(o){if(o===this.lastTab&&this.firstTab)this.setSelectedTab(this.firstTab);else{let e=this.tabs.indexOf(o);this.setSelectedTab(this.tabs[e+1])}}onKeydown(o){let e=o.currentTarget,t=!1,i=this.tablistNode.getAttribute("aria-orientation")||"horizontal";switch(o.key){case"ArrowLeft":i==="horizontal"&&(this.setSelectedToPreviousTab(e),t=!0);break;case"ArrowRight":i==="horizontal"&&(this.setSelectedToNextTab(e),t=!0);break;case"ArrowUp":i==="vertical"&&(this.setSelectedToPreviousTab(e),t=!0);break;case"ArrowDown":i==="vertical"&&(this.setSelectedToNextTab(e),t=!0);break;case"Home":this.firstTab&&(this.setSelectedTab(this.firstTab),t=!0);break;case"End":this.lastTab&&(this.setSelectedTab(this.lastTab),t=!0);break;case"Enter":case" ":this.setSelectedTab(e),t=!0;break;default:break}t&&(o.stopPropagation(),o.preventDefault())}onClick(o){this.setSelectedTab(o.currentTarget)}};function ee(){document.querySelectorAll('[data-module="tabs"]').forEach(e=>{let t=e.querySelector('[role="tablist"]');if(t instanceof HTMLElement){if(e.hasAttribute("data-orientation")&&!t.hasAttribute("data-orientation")){let i=e.getAttribute("data-orientation");i&&t.setAttribute("data-orientation",i)}new D(t)}}),document.querySelectorAll('[role="tablist"]').forEach(e=>{e instanceof HTMLElement&&!e.closest('[data-module="tabs"]')&&new D(e)})}window.Webflow||(window.Webflow=[]);window.Webflow.push(()=>{z(),ee(),J(),j(),Z(),K(),Y(),Q(),X(),V()});})();
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { greetUser } from '$utils/greet';
|
|
2
2
|
|
|
3
|
+
import { initBlobAnimation } from './animations/BlobAnimation';
|
|
4
|
+
import { initMarquee } from './animations/Marquee';
|
|
5
|
+
import { initScrollLine } from './animations/ScrollLine';
|
|
3
6
|
import { initFaqCards } from './components/cards/FaqCards';
|
|
4
7
|
import { initCustomCursor } from './components/cursor/CustomCursor';
|
|
8
|
+
import { initAccessibleDropdown } from './components/dropdown/AccessibleDropdown';
|
|
5
9
|
import { initSmartNav } from './components/layout/SmartNav';
|
|
6
10
|
import { initSwiperSlider } from './components/sliders/SwiperSlider';
|
|
7
11
|
import { initTabLists } from './components/tabs/TabsAutomatic';
|
|
8
12
|
|
|
9
13
|
window.Webflow ||= [];
|
|
10
14
|
window.Webflow.push(() => {
|
|
11
|
-
|
|
12
|
-
greetUser(name);
|
|
15
|
+
greetUser();
|
|
13
16
|
|
|
14
17
|
// Initialize all components
|
|
15
18
|
initTabLists();
|
|
@@ -17,4 +20,8 @@ window.Webflow.push(() => {
|
|
|
17
20
|
initFaqCards();
|
|
18
21
|
initSwiperSlider();
|
|
19
22
|
initCustomCursor();
|
|
23
|
+
initScrollLine();
|
|
24
|
+
initAccessibleDropdown();
|
|
25
|
+
initMarquee();
|
|
26
|
+
initBlobAnimation();
|
|
20
27
|
});
|