@fynd-design-engineering/fynd-one-v2 3.4.63 → 3.4.64
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/accordians/dropdown.js +1 -95
- package/dist/accordians/index.js +1 -391
- package/dist/cms-listing/index.js +1 -24
- package/dist/filters/clear-search.js +1 -32
- package/dist/filters/konnect.js +1 -165
- package/dist/filters/show-count.js +1 -66
- package/dist/form/country-dropdown.css +1 -160
- package/dist/form/cs-gated-redirection.js +1 -40
- package/dist/form/download-file.js +1 -70
- package/dist/form/validation.css +1 -1019
- package/dist/form/validation.js +7 -10611
- package/dist/global/anchor-scroll.js +1 -174
- package/dist/global/auth.js +1 -87
- package/dist/global/chat.js +1 -185
- package/dist/global/console-links.js +1 -89
- package/dist/global/contact-popup.js +2 -83
- package/dist/global/css/in-page-embed.css +1 -1043
- package/dist/global/css/in-project-settings.css +1 -173
- package/dist/global/css/temp.css +1 -89
- package/dist/global/custom-bg-video.js +1 -40
- package/dist/global/footer-accordion.js +1 -44
- package/dist/global/lazy-loader.js +1 -135
- package/dist/global/loader.js +2 -166
- package/dist/global/media-card.js +1 -166
- package/dist/global/miscellaneous.js +1 -136
- package/dist/global/number-count.js +1 -82
- package/dist/global/popup-video.js +1 -276
- package/dist/global/progressive-scroll.js +1 -222
- package/dist/global/responsive-video.js +1 -321
- package/dist/global/style.css +1 -1065
- package/dist/global/video-card.js +1 -50
- package/dist/hacktimus/2025.js +1 -177
- package/dist/hacktimus/styles.css +1 -91
- package/dist/home/index.js +1 -17
- package/dist/marquee/index.js +1 -3104
- package/dist/marquee/marquee-swiper.js +1 -36
- package/dist/navigation/announcement/index.js +1 -5169
- package/dist/navigation/context-menu/index.js +1 -31
- package/dist/navigation/desktop/index.js +1 -4603
- package/dist/navigation/initialization.js +1 -602
- package/dist/navigation/main.js +1 -4911
- package/dist/navigation/mobile/index.js +1 -286
- package/dist/navigation/scroll/index.js +1 -62
- package/dist/navigation/secondary-navigation/index.js +1 -437
- package/dist/navigation/style.css +1 -154
- package/dist/navigation/temp.css +0 -2
- package/dist/navigation/theme.css +1 -69
- package/dist/navigation-v2/index.js +1 -4990
- package/dist/navigation-v2/styles.css +1 -233
- package/dist/others/feature-detail.js +1 -75
- package/dist/others/geolocation.js +1 -50
- package/dist/others/hero-aniamtion.js +1 -53
- package/dist/others/hero-india-animation-2.js +1 -70
- package/dist/others/hero-india-animation.js +1 -93
- package/dist/others/home-solution-tab.js +1 -115
- package/dist/others/storefront-chat/index.js +1 -487
- package/dist/others/storefront-chat/styles.css +1 -107
- package/dist/playbook-2026/hero-reveal.js +1 -47
- package/dist/playbook-2026/index.js +1 -536
- package/dist/playbook-2026/styles.css +1 -110
- package/dist/posthog-and-ga/attributes.js +1 -190
- package/dist/posthog-and-ga/main.js +1 -528
- package/dist/progressive-scroll/index.js +1 -147
- package/dist/quick-fix/reload.js +1 -22
- package/dist/seo/schema.js +1 -465
- package/dist/slider/freescroll.js +1 -34
- package/dist/test/sample.js +1 -15
- package/dist/testimonials/index.js +1 -2654
- package/dist/timeline/index.js +1 -160
- package/dist/timeline/style.css +1 -42
- package/dist/tracking/custom-id.js +1 -75
- package/dist/tracking/fill-form-fields.js +1 -238
- package/dist/tracking/form-tracker.js +1 -146
- package/dist/tracking/page-categories.js +1 -20
- package/dist/tracking/user-journey.js +1 -839
- package/dist/tracking/utm-links.js +1 -194
- package/dist/utils/sample.js +1 -17
- package/dist/validations/localhost.js +1 -221
- package/package.json +1 -1
|
@@ -1,95 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
(() => {
|
|
3
|
-
// bin/live-reload.js
|
|
4
|
-
if (window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1") {
|
|
5
|
-
new EventSource(`${"http://localhost:3000"}/esbuild`).addEventListener(
|
|
6
|
-
"change",
|
|
7
|
-
() => location.reload()
|
|
8
|
-
);
|
|
9
|
-
} else {
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// src/accordians/dropdown.ts
|
|
13
|
-
function findDropdownElements(dropdownName) {
|
|
14
|
-
const wrapper = document.querySelector(`[fynd-dropdown="wrapper"][fynd-dropdown-name="${dropdownName}"]`);
|
|
15
|
-
if (!wrapper) return null;
|
|
16
|
-
const toggle = wrapper.querySelector('[fynd-dropdown="toggle"]');
|
|
17
|
-
const content = wrapper.querySelector('[fynd-dropdown="content"]');
|
|
18
|
-
if (!toggle || !content) return null;
|
|
19
|
-
return {
|
|
20
|
-
wrapper,
|
|
21
|
-
toggle,
|
|
22
|
-
content,
|
|
23
|
-
name: dropdownName
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
function closeAllDropdowns(excludeDropdownName = null) {
|
|
27
|
-
const allWrappers = document.querySelectorAll('[fynd-dropdown="wrapper"][fynd-dropdown-name]');
|
|
28
|
-
allWrappers.forEach((wrapper) => {
|
|
29
|
-
const dropdownName = wrapper.getAttribute("fynd-dropdown-name");
|
|
30
|
-
const content = wrapper.querySelector('[fynd-dropdown="content"]');
|
|
31
|
-
if (content && dropdownName !== excludeDropdownName) {
|
|
32
|
-
content.style.display = "none";
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
function initializeDropdowns() {
|
|
37
|
-
const dropdownWrappers = document.querySelectorAll('[fynd-dropdown="wrapper"][fynd-dropdown-name]');
|
|
38
|
-
dropdownWrappers.forEach((wrapper) => {
|
|
39
|
-
const dropdownName = wrapper.getAttribute("fynd-dropdown-name");
|
|
40
|
-
const toggle = wrapper.querySelector('[fynd-dropdown="toggle"]');
|
|
41
|
-
const content = wrapper.querySelector('[fynd-dropdown="content"]');
|
|
42
|
-
if (!toggle || !content || !dropdownName) return;
|
|
43
|
-
content.style.display = "none";
|
|
44
|
-
const newToggle = toggle.cloneNode(true);
|
|
45
|
-
const newContent = content.cloneNode(true);
|
|
46
|
-
toggle.parentNode?.replaceChild(newToggle, toggle);
|
|
47
|
-
content.parentNode?.replaceChild(newContent, content);
|
|
48
|
-
newToggle.addEventListener("click", (e) => {
|
|
49
|
-
e.stopPropagation();
|
|
50
|
-
closeAllDropdowns(dropdownName);
|
|
51
|
-
if (newContent.style.display === "none") {
|
|
52
|
-
newContent.style.display = "block";
|
|
53
|
-
} else {
|
|
54
|
-
newContent.style.display = "none";
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
newContent.addEventListener("click", (e) => {
|
|
58
|
-
e.stopPropagation();
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
document.removeEventListener("click", handleOutsideClick);
|
|
62
|
-
document.addEventListener("click", handleOutsideClick);
|
|
63
|
-
document.removeEventListener("keydown", handleEscapeKey);
|
|
64
|
-
document.addEventListener("keydown", handleEscapeKey);
|
|
65
|
-
}
|
|
66
|
-
function handleOutsideClick() {
|
|
67
|
-
closeAllDropdowns();
|
|
68
|
-
}
|
|
69
|
-
function handleEscapeKey(e) {
|
|
70
|
-
if (e.key === "Escape") {
|
|
71
|
-
closeAllDropdowns();
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
var fyndDropdown = {
|
|
75
|
-
close: (dropdownName) => {
|
|
76
|
-
const elements = findDropdownElements(dropdownName);
|
|
77
|
-
if (elements) {
|
|
78
|
-
elements.content.style.display = "none";
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
closeAll: () => {
|
|
82
|
-
closeAllDropdowns();
|
|
83
|
-
},
|
|
84
|
-
init: () => {
|
|
85
|
-
initializeDropdowns();
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
if (document.readyState === "loading") {
|
|
89
|
-
document.addEventListener("DOMContentLoaded", initializeDropdowns);
|
|
90
|
-
} else {
|
|
91
|
-
initializeDropdowns();
|
|
92
|
-
}
|
|
93
|
-
var dropdown_default = fyndDropdown;
|
|
94
|
-
})();
|
|
95
|
-
//# sourceMappingURL=dropdown.js.map
|
|
1
|
+
"use strict";(()=>{function u(n){let e=document.querySelector(`[fynd-dropdown="wrapper"][fynd-dropdown-name="${n}"]`);if(!e)return null;let t=e.querySelector('[fynd-dropdown="toggle"]'),o=e.querySelector('[fynd-dropdown="content"]');return!t||!o?null:{wrapper:e,toggle:t,content:o,name:n}}function r(n=null){document.querySelectorAll('[fynd-dropdown="wrapper"][fynd-dropdown-name]').forEach(t=>{let o=t.getAttribute("fynd-dropdown-name"),d=t.querySelector('[fynd-dropdown="content"]');d&&o!==n&&(d.style.display="none")})}function c(){document.querySelectorAll('[fynd-dropdown="wrapper"][fynd-dropdown-name]').forEach(e=>{let t=e.getAttribute("fynd-dropdown-name"),o=e.querySelector('[fynd-dropdown="toggle"]'),d=e.querySelector('[fynd-dropdown="content"]');if(!o||!d||!t)return;d.style.display="none";let s=o.cloneNode(!0),l=d.cloneNode(!0);o.parentNode?.replaceChild(s,o),d.parentNode?.replaceChild(l,d),s.addEventListener("click",i=>{i.stopPropagation(),r(t),l.style.display==="none"?l.style.display="block":l.style.display="none"}),l.addEventListener("click",i=>{i.stopPropagation()})}),document.removeEventListener("click",p),document.addEventListener("click",p),document.removeEventListener("keydown",a),document.addEventListener("keydown",a)}function p(){r()}function a(n){n.key==="Escape"&&r()}var y={close:n=>{let e=u(n);e&&(e.content.style.display="none")},closeAll:()=>{r()},init:()=>{c()}};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",c):c();var m=y;})();
|
package/dist/accordians/index.js
CHANGED
|
@@ -1,391 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
(() => {
|
|
3
|
-
// bin/live-reload.js
|
|
4
|
-
if (window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1") {
|
|
5
|
-
new EventSource(`${"http://localhost:3000"}/esbuild`).addEventListener(
|
|
6
|
-
"change",
|
|
7
|
-
() => location.reload()
|
|
8
|
-
);
|
|
9
|
-
} else {
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// src/accordians/index.ts
|
|
13
|
-
document.addEventListener("DOMContentLoaded", () => {
|
|
14
|
-
const faqWrappers = document.querySelectorAll(
|
|
15
|
-
'[fynd-faq-element="wrapper"]'
|
|
16
|
-
);
|
|
17
|
-
faqWrappers.forEach((wrapper) => {
|
|
18
|
-
const toggle = wrapper.querySelector(
|
|
19
|
-
'[fynd-faq-element="toggle"]'
|
|
20
|
-
);
|
|
21
|
-
const content = wrapper.querySelector(
|
|
22
|
-
'[fynd-faq-element="content"]'
|
|
23
|
-
);
|
|
24
|
-
const contentInner = wrapper.querySelector(
|
|
25
|
-
'[fynd-faq-element="content-inner"]'
|
|
26
|
-
);
|
|
27
|
-
const xLine = toggle?.querySelector('[fynd-faq-element="x-line"]') || null;
|
|
28
|
-
const yLine = toggle?.querySelector('[fynd-faq-element="y-line"]') || null;
|
|
29
|
-
if (!toggle || !content || !contentInner || !xLine || !yLine) {
|
|
30
|
-
console.warn("Required FAQ elements not found in wrapper");
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
const groupContainer = wrapper.closest("[fynd-faq-group]");
|
|
34
|
-
const groupName = groupContainer?.getAttribute("fynd-faq-group") || null;
|
|
35
|
-
const faqType = groupContainer?.getAttribute("fynd-faq-type") || "one-at-a-time";
|
|
36
|
-
if (wrapper.getAttribute("fynd-faq-initialopen") === "true") {
|
|
37
|
-
gsap.set(content, { height: "auto", overflow: "hidden" });
|
|
38
|
-
gsap.set(contentInner, { opacity: 1 });
|
|
39
|
-
gsap.set(xLine, { rotation: 180 });
|
|
40
|
-
gsap.set(yLine, { rotation: 270 });
|
|
41
|
-
toggle.setAttribute("data-state", "open");
|
|
42
|
-
updateFaqGroupImage(wrapper, groupName);
|
|
43
|
-
updateFaqGroupText(wrapper, groupName);
|
|
44
|
-
updateFaqGroupButton(wrapper, groupName);
|
|
45
|
-
updateFaqGroupVideo(wrapper, groupName);
|
|
46
|
-
} else {
|
|
47
|
-
gsap.set(content, { height: 0 });
|
|
48
|
-
gsap.set(contentInner, { opacity: 0 });
|
|
49
|
-
gsap.set(xLine, { rotation: 0 });
|
|
50
|
-
gsap.set(yLine, { rotation: 0 });
|
|
51
|
-
toggle.setAttribute("data-state", "closed");
|
|
52
|
-
}
|
|
53
|
-
let isAnimating = false;
|
|
54
|
-
toggle.addEventListener("click", () => {
|
|
55
|
-
if (isAnimating) return;
|
|
56
|
-
isAnimating = true;
|
|
57
|
-
const isOpen = toggle.getAttribute("data-state") === "open";
|
|
58
|
-
if (faqType === "one-at-a-time" && groupContainer) {
|
|
59
|
-
const openFAQs = groupContainer.querySelectorAll(
|
|
60
|
-
'[fynd-faq-element="wrapper"] [data-state="open"]'
|
|
61
|
-
);
|
|
62
|
-
if (isOpen && openFAQs.length === 1) {
|
|
63
|
-
isAnimating = false;
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
if (isOpen) {
|
|
68
|
-
closeAccordion(wrapper, () => {
|
|
69
|
-
isAnimating = false;
|
|
70
|
-
});
|
|
71
|
-
} else {
|
|
72
|
-
if (faqType === "one-at-a-time" && groupContainer) {
|
|
73
|
-
closeOtherAccordions(groupContainer);
|
|
74
|
-
}
|
|
75
|
-
openAccordion(wrapper, groupName, () => {
|
|
76
|
-
isAnimating = false;
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
handleRatioHeights();
|
|
82
|
-
initFaqVideoAutoplayObserver();
|
|
83
|
-
setTimeout(playAllFaqVideos, 500);
|
|
84
|
-
});
|
|
85
|
-
window.addEventListener("resize", () => {
|
|
86
|
-
handleRatioHeights();
|
|
87
|
-
});
|
|
88
|
-
function handleRatioHeights() {
|
|
89
|
-
if (window.innerWidth < 992) return;
|
|
90
|
-
const imageTargets = document.querySelectorAll(
|
|
91
|
-
"[fynd-faq-image-target]"
|
|
92
|
-
);
|
|
93
|
-
imageTargets.forEach((imageTarget) => {
|
|
94
|
-
const wrapper = imageTarget.parentElement;
|
|
95
|
-
if (!wrapper) return;
|
|
96
|
-
const ratioHeight = wrapper.getAttribute("ratio-height");
|
|
97
|
-
if (ratioHeight !== "true") return;
|
|
98
|
-
wrapper.style.height = "auto";
|
|
99
|
-
requestAnimationFrame(() => {
|
|
100
|
-
const renderedHeight = wrapper.offsetHeight;
|
|
101
|
-
wrapper.style.height = `${renderedHeight}px`;
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
const tabGroups = document.querySelectorAll(
|
|
105
|
-
'[fynd-faq-tabgroup][ratio-height="true"]'
|
|
106
|
-
);
|
|
107
|
-
tabGroups.forEach((tabGroup) => {
|
|
108
|
-
tabGroup.style.height = "auto";
|
|
109
|
-
requestAnimationFrame(() => {
|
|
110
|
-
const renderedHeight = tabGroup.offsetHeight;
|
|
111
|
-
tabGroup.style.height = `${renderedHeight}px`;
|
|
112
|
-
});
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
function openAccordion(wrapper, groupName, callback) {
|
|
116
|
-
const toggle = wrapper.querySelector(
|
|
117
|
-
'[fynd-faq-element="toggle"]'
|
|
118
|
-
);
|
|
119
|
-
const content = wrapper.querySelector(
|
|
120
|
-
'[fynd-faq-element="content"]'
|
|
121
|
-
);
|
|
122
|
-
const contentInner = wrapper.querySelector(
|
|
123
|
-
'[fynd-faq-element="content-inner"]'
|
|
124
|
-
);
|
|
125
|
-
const xLine = toggle?.querySelector('[fynd-faq-element="x-line"]') || null;
|
|
126
|
-
const yLine = toggle?.querySelector('[fynd-faq-element="y-line"]') || null;
|
|
127
|
-
if (!toggle || !content || !contentInner || !xLine || !yLine) {
|
|
128
|
-
console.warn("Required elements not found for opening accordion");
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
if (content.gsapAnimation) {
|
|
132
|
-
content.gsapAnimation.kill();
|
|
133
|
-
}
|
|
134
|
-
const timeline = gsap.timeline({
|
|
135
|
-
onComplete: () => callback && callback()
|
|
136
|
-
});
|
|
137
|
-
gsap.set(content, { height: "auto", visibility: "hidden", opacity: 0 });
|
|
138
|
-
const height = content.offsetHeight;
|
|
139
|
-
gsap.set(content, { height: 0, visibility: "visible", opacity: 1 });
|
|
140
|
-
timeline.to(xLine, { rotation: 180, duration: 0.4, ease: "power2.inOut" }, 0);
|
|
141
|
-
timeline.to(yLine, { rotation: 270, duration: 0.4, ease: "power2.inOut" }, 0);
|
|
142
|
-
timeline.to(
|
|
143
|
-
content,
|
|
144
|
-
{
|
|
145
|
-
height,
|
|
146
|
-
duration: 0.5,
|
|
147
|
-
ease: "power3.inOut",
|
|
148
|
-
clearProps: "height",
|
|
149
|
-
onComplete: () => {
|
|
150
|
-
content.style.height = "auto";
|
|
151
|
-
}
|
|
152
|
-
},
|
|
153
|
-
0
|
|
154
|
-
);
|
|
155
|
-
timeline.to(
|
|
156
|
-
contentInner,
|
|
157
|
-
{ opacity: 1, duration: 0.4, ease: "power2.out" },
|
|
158
|
-
"-=0.35"
|
|
159
|
-
);
|
|
160
|
-
content.gsapAnimation = timeline;
|
|
161
|
-
toggle.setAttribute("data-state", "open");
|
|
162
|
-
const icon = toggle.querySelector(
|
|
163
|
-
'[fynd-faq-element="chevron"]'
|
|
164
|
-
);
|
|
165
|
-
if (icon)
|
|
166
|
-
gsap.to(icon, { rotation: 180, duration: 0.4, ease: "back.out(1.7)" });
|
|
167
|
-
updateFaqGroupImage(wrapper, groupName);
|
|
168
|
-
updateFaqGroupText(wrapper, groupName);
|
|
169
|
-
updateFaqGroupButton(wrapper, groupName);
|
|
170
|
-
updateFaqGroupVideo(wrapper, groupName);
|
|
171
|
-
}
|
|
172
|
-
function closeAccordion(wrapper, callback) {
|
|
173
|
-
const toggle = wrapper.querySelector(
|
|
174
|
-
'[fynd-faq-element="toggle"]'
|
|
175
|
-
);
|
|
176
|
-
const content = wrapper.querySelector(
|
|
177
|
-
'[fynd-faq-element="content"]'
|
|
178
|
-
);
|
|
179
|
-
const contentInner = wrapper.querySelector(
|
|
180
|
-
'[fynd-faq-element="content-inner"]'
|
|
181
|
-
);
|
|
182
|
-
const xLine = toggle?.querySelector('[fynd-faq-element="x-line"]') || null;
|
|
183
|
-
const yLine = toggle?.querySelector('[fynd-faq-element="y-line"]') || null;
|
|
184
|
-
if (!toggle || !content || !contentInner || !xLine || !yLine) {
|
|
185
|
-
console.warn("Required elements not found for closing accordion");
|
|
186
|
-
return;
|
|
187
|
-
}
|
|
188
|
-
if (content.gsapAnimation) content.gsapAnimation.kill();
|
|
189
|
-
const height = content.offsetHeight;
|
|
190
|
-
content.style.height = `${height}px`;
|
|
191
|
-
const timeline = gsap.timeline({
|
|
192
|
-
onComplete: () => callback && callback()
|
|
193
|
-
});
|
|
194
|
-
timeline.to(xLine, { rotation: 0, duration: 0.4, ease: "power2.inOut" }, 0);
|
|
195
|
-
timeline.to(yLine, { rotation: 0, duration: 0.4, ease: "power2.inOut" }, 0);
|
|
196
|
-
timeline.to(
|
|
197
|
-
contentInner,
|
|
198
|
-
{ opacity: 0, duration: 0.3, ease: "power2.in" },
|
|
199
|
-
0
|
|
200
|
-
);
|
|
201
|
-
timeline.to(
|
|
202
|
-
content,
|
|
203
|
-
{ height: 0, duration: 0.4, ease: "power3.inOut" },
|
|
204
|
-
"-=0.25"
|
|
205
|
-
);
|
|
206
|
-
content.gsapAnimation = timeline;
|
|
207
|
-
toggle.setAttribute("data-state", "closed");
|
|
208
|
-
const icon = toggle.querySelector(
|
|
209
|
-
'[fynd-faq-element="chevron"]'
|
|
210
|
-
);
|
|
211
|
-
if (icon)
|
|
212
|
-
gsap.to(icon, { rotation: 0, duration: 0.4, ease: "back.out(1.7)" });
|
|
213
|
-
}
|
|
214
|
-
function closeOtherAccordions(groupContainer) {
|
|
215
|
-
const openFAQs = groupContainer.querySelectorAll(
|
|
216
|
-
'[fynd-faq-element="wrapper"] [data-state="open"]'
|
|
217
|
-
);
|
|
218
|
-
openFAQs.forEach((openToggle) => {
|
|
219
|
-
const wrapper = openToggle.closest(
|
|
220
|
-
'[fynd-faq-element="wrapper"]'
|
|
221
|
-
);
|
|
222
|
-
if (wrapper) closeAccordion(wrapper);
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
function updateFaqGroupImage(wrapper, groupName) {
|
|
226
|
-
if (!groupName) return;
|
|
227
|
-
const groupImage = document.querySelector(
|
|
228
|
-
`[fynd-faq-image-target="${groupName}"]`
|
|
229
|
-
);
|
|
230
|
-
if (!groupImage) return;
|
|
231
|
-
const imageSource = wrapper.querySelector(
|
|
232
|
-
"[fynd-faq-image-source]"
|
|
233
|
-
);
|
|
234
|
-
if (!imageSource) return;
|
|
235
|
-
const newSrc = imageSource.getAttribute("src");
|
|
236
|
-
const newSrcset = imageSource.getAttribute("srcset");
|
|
237
|
-
if (newSrc) groupImage.setAttribute("src", newSrc);
|
|
238
|
-
if (newSrcset) groupImage.setAttribute("srcset", "");
|
|
239
|
-
}
|
|
240
|
-
function updateFaqGroupText(wrapper, groupName) {
|
|
241
|
-
if (!groupName) return;
|
|
242
|
-
const groupText = document.querySelector(
|
|
243
|
-
`[fynd-faq-text-target="${groupName}"]`
|
|
244
|
-
);
|
|
245
|
-
if (!groupText) return;
|
|
246
|
-
const textSource = wrapper.querySelector(
|
|
247
|
-
"[fynd-faq-text-source]"
|
|
248
|
-
);
|
|
249
|
-
if (!textSource) return;
|
|
250
|
-
groupText.textContent = textSource.textContent;
|
|
251
|
-
}
|
|
252
|
-
function updateFaqGroupButton(wrapper, groupName) {
|
|
253
|
-
if (!groupName) return;
|
|
254
|
-
const buttonTextTarget = document.querySelector(
|
|
255
|
-
`[fynd-faq-button-text-target="${groupName}"]`
|
|
256
|
-
);
|
|
257
|
-
const buttonLinkTarget = document.querySelector(
|
|
258
|
-
`[fynd-faq-button-link-target="${groupName}"]`
|
|
259
|
-
);
|
|
260
|
-
const linkSource = wrapper.querySelector(
|
|
261
|
-
"[fynd-faq-link-source]"
|
|
262
|
-
);
|
|
263
|
-
if (!linkSource) return;
|
|
264
|
-
if (buttonTextTarget) buttonTextTarget.textContent = linkSource.textContent;
|
|
265
|
-
if (buttonLinkTarget) {
|
|
266
|
-
for (let i = 0; i < linkSource.attributes.length; i++) {
|
|
267
|
-
const attr = linkSource.attributes[i];
|
|
268
|
-
buttonLinkTarget.setAttribute(attr.name, attr.value);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
function updateFaqGroupVideo(wrapper, groupName) {
|
|
273
|
-
if (!groupName) return;
|
|
274
|
-
const groupVideo = document.querySelector(
|
|
275
|
-
`[fynd-faq-video-target="${groupName}"]`
|
|
276
|
-
);
|
|
277
|
-
if (!groupVideo) return;
|
|
278
|
-
const groupVideoWrapper = wrapper.querySelector(`[fynd-faq-video]`);
|
|
279
|
-
const groupImageWrapper = wrapper.querySelector(`[fynd-faq-image]`);
|
|
280
|
-
const sourceVideo = wrapper.querySelector(
|
|
281
|
-
"[fynd-faq-video-source]"
|
|
282
|
-
);
|
|
283
|
-
const mobile = window.innerWidth < 992;
|
|
284
|
-
const sourceEl = sourceVideo?.querySelector("source") || null;
|
|
285
|
-
const newSrc = (sourceEl?.getAttribute("src") || "").trim();
|
|
286
|
-
const newType = (sourceEl?.getAttribute("type") || "video/mp4").trim();
|
|
287
|
-
const hasVideo = !!sourceVideo && !!sourceEl && newSrc !== "";
|
|
288
|
-
if (mobile) {
|
|
289
|
-
if (groupVideoWrapper)
|
|
290
|
-
groupVideoWrapper.style.display = hasVideo ? "block" : "none";
|
|
291
|
-
if (groupImageWrapper)
|
|
292
|
-
groupImageWrapper.style.display = hasVideo ? "none" : "block";
|
|
293
|
-
}
|
|
294
|
-
if (!hasVideo) {
|
|
295
|
-
groupVideo.style.display = "none";
|
|
296
|
-
const targetSourceEl2 = groupVideo.querySelector("source");
|
|
297
|
-
if (targetSourceEl2) {
|
|
298
|
-
targetSourceEl2.removeAttribute("src");
|
|
299
|
-
targetSourceEl2.removeAttribute("type");
|
|
300
|
-
try {
|
|
301
|
-
groupVideo.load();
|
|
302
|
-
} catch {
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
return;
|
|
306
|
-
}
|
|
307
|
-
let targetSourceEl = groupVideo.querySelector("source");
|
|
308
|
-
if (!targetSourceEl) {
|
|
309
|
-
targetSourceEl = document.createElement("source");
|
|
310
|
-
groupVideo.appendChild(targetSourceEl);
|
|
311
|
-
}
|
|
312
|
-
targetSourceEl.setAttribute("src", newSrc);
|
|
313
|
-
targetSourceEl.setAttribute("type", newType);
|
|
314
|
-
groupVideo.setAttribute("loop", "");
|
|
315
|
-
groupVideo.setAttribute("autoplay", "");
|
|
316
|
-
groupVideo.setAttribute("muted", "");
|
|
317
|
-
groupVideo.setAttribute("playsinline", "");
|
|
318
|
-
if (mobile && sourceVideo) {
|
|
319
|
-
sourceVideo.setAttribute("loop", "");
|
|
320
|
-
sourceVideo.setAttribute("autoplay", "");
|
|
321
|
-
sourceVideo.setAttribute("muted", "");
|
|
322
|
-
sourceVideo.setAttribute("playsinline", "");
|
|
323
|
-
autoplayVideo(sourceVideo);
|
|
324
|
-
}
|
|
325
|
-
try {
|
|
326
|
-
groupVideo.load();
|
|
327
|
-
} catch {
|
|
328
|
-
}
|
|
329
|
-
autoplayVideo(groupVideo);
|
|
330
|
-
groupVideo.style.display = "block";
|
|
331
|
-
}
|
|
332
|
-
function autoplayVideo(video) {
|
|
333
|
-
if (!video.isConnected || video.style.display === "none") return;
|
|
334
|
-
requestAnimationFrame(() => {
|
|
335
|
-
const playPromise = video.play();
|
|
336
|
-
if (playPromise && typeof playPromise.catch === "function") {
|
|
337
|
-
playPromise.catch(() => {
|
|
338
|
-
});
|
|
339
|
-
}
|
|
340
|
-
});
|
|
341
|
-
}
|
|
342
|
-
function initFaqVideoAutoplayObserver() {
|
|
343
|
-
const videos = document.querySelectorAll(
|
|
344
|
-
"[fynd-faq-video-target]"
|
|
345
|
-
);
|
|
346
|
-
if (!videos.length) return;
|
|
347
|
-
const io = new IntersectionObserver(
|
|
348
|
-
(entries) => {
|
|
349
|
-
entries.forEach((entry) => {
|
|
350
|
-
const video = entry.target;
|
|
351
|
-
const hasSrc = !!video.querySelector("source[src]");
|
|
352
|
-
if (!hasSrc || video.style.display === "none") return;
|
|
353
|
-
if (entry.isIntersecting && entry.intersectionRatio >= 0.5) {
|
|
354
|
-
video.setAttribute("autoplay", "");
|
|
355
|
-
video.setAttribute("muted", "");
|
|
356
|
-
video.setAttribute("playsinline", "");
|
|
357
|
-
video.setAttribute("loop", "");
|
|
358
|
-
autoplayVideo(video);
|
|
359
|
-
} else {
|
|
360
|
-
try {
|
|
361
|
-
video.pause();
|
|
362
|
-
} catch (e) {
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
});
|
|
366
|
-
},
|
|
367
|
-
{ threshold: [0, 0.5, 1] }
|
|
368
|
-
);
|
|
369
|
-
videos.forEach((v) => io.observe(v));
|
|
370
|
-
}
|
|
371
|
-
async function playAllFaqVideos() {
|
|
372
|
-
const videos = document.querySelectorAll(
|
|
373
|
-
"video[fynd-faq-video-target], video.fynd-faq-video-target, video[data-fynd-faq-video-target], video[fynd-faq-video-source]"
|
|
374
|
-
);
|
|
375
|
-
for (const v of videos) {
|
|
376
|
-
const hasSrc = !!v.src || v.querySelector("source[src]");
|
|
377
|
-
if (!hasSrc) continue;
|
|
378
|
-
v.setAttribute("muted", "");
|
|
379
|
-
v.setAttribute("playsinline", "");
|
|
380
|
-
v.setAttribute("autoplay", "");
|
|
381
|
-
v.setAttribute("loop", "");
|
|
382
|
-
v.preload = "auto";
|
|
383
|
-
v.muted = true;
|
|
384
|
-
try {
|
|
385
|
-
await v.play();
|
|
386
|
-
} catch {
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
})();
|
|
391
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";(()=>{document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll('[fynd-faq-element="wrapper"]').forEach(t=>{let e=t.querySelector('[fynd-faq-element="toggle"]'),n=t.querySelector('[fynd-faq-element="content"]'),o=t.querySelector('[fynd-faq-element="content-inner"]'),l=e?.querySelector('[fynd-faq-element="x-line"]')||null,s=e?.querySelector('[fynd-faq-element="y-line"]')||null;if(!e||!n||!o||!l||!s){console.warn("Required FAQ elements not found in wrapper");return}let u=t.closest("[fynd-faq-group]"),r=u?.getAttribute("fynd-faq-group")||null,c=u?.getAttribute("fynd-faq-type")||"one-at-a-time";t.getAttribute("fynd-faq-initialopen")==="true"?(gsap.set(n,{height:"auto",overflow:"hidden"}),gsap.set(o,{opacity:1}),gsap.set(l,{rotation:180}),gsap.set(s,{rotation:270}),e.setAttribute("data-state","open"),q(t,r),p(t,r),E(t,r),L(t,r)):(gsap.set(n,{height:0}),gsap.set(o,{opacity:0}),gsap.set(l,{rotation:0}),gsap.set(s,{rotation:0}),e.setAttribute("data-state","closed"));let a=!1;e.addEventListener("click",()=>{if(a)return;a=!0;let d=e.getAttribute("data-state")==="open";if(c==="one-at-a-time"&&u){let f=u.querySelectorAll('[fynd-faq-element="wrapper"] [data-state="open"]');if(d&&f.length===1){a=!1;return}}d?g(t,()=>{a=!1}):(c==="one-at-a-time"&&u&&A(u),h(t,r,()=>{a=!1}))})}),y(),T(),setTimeout(H,500)});window.addEventListener("resize",()=>{y()});function y(){if(window.innerWidth<992)return;document.querySelectorAll("[fynd-faq-image-target]").forEach(e=>{let n=e.parentElement;!n||n.getAttribute("ratio-height")!=="true"||(n.style.height="auto",requestAnimationFrame(()=>{let l=n.offsetHeight;n.style.height=`${l}px`}))}),document.querySelectorAll('[fynd-faq-tabgroup][ratio-height="true"]').forEach(e=>{e.style.height="auto",requestAnimationFrame(()=>{let n=e.offsetHeight;e.style.height=`${n}px`})})}function h(i,t,e){let n=i.querySelector('[fynd-faq-element="toggle"]'),o=i.querySelector('[fynd-faq-element="content"]'),l=i.querySelector('[fynd-faq-element="content-inner"]'),s=n?.querySelector('[fynd-faq-element="x-line"]')||null,u=n?.querySelector('[fynd-faq-element="y-line"]')||null;if(!n||!o||!l||!s||!u){console.warn("Required elements not found for opening accordion");return}o.gsapAnimation&&o.gsapAnimation.kill();let r=gsap.timeline({onComplete:()=>e&&e()});gsap.set(o,{height:"auto",visibility:"hidden",opacity:0});let c=o.offsetHeight;gsap.set(o,{height:0,visibility:"visible",opacity:1}),r.to(s,{rotation:180,duration:.4,ease:"power2.inOut"},0),r.to(u,{rotation:270,duration:.4,ease:"power2.inOut"},0),r.to(o,{height:c,duration:.5,ease:"power3.inOut",clearProps:"height",onComplete:()=>{o.style.height="auto"}},0),r.to(l,{opacity:1,duration:.4,ease:"power2.out"},"-=0.35"),o.gsapAnimation=r,n.setAttribute("data-state","open");let a=n.querySelector('[fynd-faq-element="chevron"]');a&&gsap.to(a,{rotation:180,duration:.4,ease:"back.out(1.7)"}),q(i,t),p(i,t),E(i,t),L(i,t)}function g(i,t){let e=i.querySelector('[fynd-faq-element="toggle"]'),n=i.querySelector('[fynd-faq-element="content"]'),o=i.querySelector('[fynd-faq-element="content-inner"]'),l=e?.querySelector('[fynd-faq-element="x-line"]')||null,s=e?.querySelector('[fynd-faq-element="y-line"]')||null;if(!e||!n||!o||!l||!s){console.warn("Required elements not found for closing accordion");return}n.gsapAnimation&&n.gsapAnimation.kill();let u=n.offsetHeight;n.style.height=`${u}px`;let r=gsap.timeline({onComplete:()=>t&&t()});r.to(l,{rotation:0,duration:.4,ease:"power2.inOut"},0),r.to(s,{rotation:0,duration:.4,ease:"power2.inOut"},0),r.to(o,{opacity:0,duration:.3,ease:"power2.in"},0),r.to(n,{height:0,duration:.4,ease:"power3.inOut"},"-=0.25"),n.gsapAnimation=r,e.setAttribute("data-state","closed");let c=e.querySelector('[fynd-faq-element="chevron"]');c&&gsap.to(c,{rotation:0,duration:.4,ease:"back.out(1.7)"})}function A(i){i.querySelectorAll('[fynd-faq-element="wrapper"] [data-state="open"]').forEach(e=>{let n=e.closest('[fynd-faq-element="wrapper"]');n&&g(n)})}function q(i,t){if(!t)return;let e=document.querySelector(`[fynd-faq-image-target="${t}"]`);if(!e)return;let n=i.querySelector("[fynd-faq-image-source]");if(!n)return;let o=n.getAttribute("src"),l=n.getAttribute("srcset");o&&e.setAttribute("src",o),l&&e.setAttribute("srcset","")}function p(i,t){if(!t)return;let e=document.querySelector(`[fynd-faq-text-target="${t}"]`);if(!e)return;let n=i.querySelector("[fynd-faq-text-source]");n&&(e.textContent=n.textContent)}function E(i,t){if(!t)return;let e=document.querySelector(`[fynd-faq-button-text-target="${t}"]`),n=document.querySelector(`[fynd-faq-button-link-target="${t}"]`),o=i.querySelector("[fynd-faq-link-source]");if(o&&(e&&(e.textContent=o.textContent),n))for(let l=0;l<o.attributes.length;l++){let s=o.attributes[l];n.setAttribute(s.name,s.value)}}function L(i,t){if(!t)return;let e=document.querySelector(`[fynd-faq-video-target="${t}"]`);if(!e)return;let n=i.querySelector("[fynd-faq-video]"),o=i.querySelector("[fynd-faq-image]"),l=i.querySelector("[fynd-faq-video-source]"),s=window.innerWidth<992,u=l?.querySelector("source")||null,r=(u?.getAttribute("src")||"").trim(),c=(u?.getAttribute("type")||"video/mp4").trim(),a=!!l&&!!u&&r!=="";if(s&&(n&&(n.style.display=a?"block":"none"),o&&(o.style.display=a?"none":"block")),!a){e.style.display="none";let f=e.querySelector("source");if(f){f.removeAttribute("src"),f.removeAttribute("type");try{e.load()}catch{}}return}let d=e.querySelector("source");d||(d=document.createElement("source"),e.appendChild(d)),d.setAttribute("src",r),d.setAttribute("type",c),e.setAttribute("loop",""),e.setAttribute("autoplay",""),e.setAttribute("muted",""),e.setAttribute("playsinline",""),s&&l&&(l.setAttribute("loop",""),l.setAttribute("autoplay",""),l.setAttribute("muted",""),l.setAttribute("playsinline",""),m(l));try{e.load()}catch{}m(e),e.style.display="block"}function m(i){!i.isConnected||i.style.display==="none"||requestAnimationFrame(()=>{let t=i.play();t&&typeof t.catch=="function"&&t.catch(()=>{})})}function T(){let i=document.querySelectorAll("[fynd-faq-video-target]");if(!i.length)return;let t=new IntersectionObserver(e=>{e.forEach(n=>{let o=n.target;if(!(!o.querySelector("source[src]")||o.style.display==="none"))if(n.isIntersecting&&n.intersectionRatio>=.5)o.setAttribute("autoplay",""),o.setAttribute("muted",""),o.setAttribute("playsinline",""),o.setAttribute("loop",""),m(o);else try{o.pause()}catch{}})},{threshold:[0,.5,1]});i.forEach(e=>t.observe(e))}async function H(){let i=document.querySelectorAll("video[fynd-faq-video-target], video.fynd-faq-video-target, video[data-fynd-faq-video-target], video[fynd-faq-video-source]");for(let t of i)if(t.src||t.querySelector("source[src]")){t.setAttribute("muted",""),t.setAttribute("playsinline",""),t.setAttribute("autoplay",""),t.setAttribute("loop",""),t.preload="auto",t.muted=!0;try{await t.play()}catch{}}}})();
|
|
@@ -1,24 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
(() => {
|
|
3
|
-
// bin/live-reload.js
|
|
4
|
-
if (window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1") {
|
|
5
|
-
new EventSource(`${"http://localhost:3000"}/esbuild`).addEventListener(
|
|
6
|
-
"change",
|
|
7
|
-
() => location.reload()
|
|
8
|
-
);
|
|
9
|
-
} else {
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// src/cms-listing/index.ts
|
|
13
|
-
function isHTMLElement(element) {
|
|
14
|
-
return element instanceof HTMLElement;
|
|
15
|
-
}
|
|
16
|
-
var clearButton = document.getElementById("clear-button");
|
|
17
|
-
var fsClearButton = document.getElementById("fs-clear");
|
|
18
|
-
if (isHTMLElement(clearButton) && isHTMLElement(fsClearButton)) {
|
|
19
|
-
clearButton.addEventListener("click", (event) => {
|
|
20
|
-
fsClearButton.click();
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
})();
|
|
24
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";(()=>{function t(e){return e instanceof HTMLElement}var n=document.getElementById("clear-button"),l=document.getElementById("fs-clear");t(n)&&t(l)&&n.addEventListener("click",e=>{l.click()});})();
|
|
@@ -1,32 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
(() => {
|
|
3
|
-
// bin/live-reload.js
|
|
4
|
-
if (window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1") {
|
|
5
|
-
new EventSource(`${"http://localhost:3000"}/esbuild`).addEventListener(
|
|
6
|
-
"change",
|
|
7
|
-
() => location.reload()
|
|
8
|
-
);
|
|
9
|
-
} else {
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// src/filters/clear-search.ts
|
|
13
|
-
var input = document.querySelector("[fynd-show-clear]");
|
|
14
|
-
var clearButton = document.querySelector("[fynd-input-clear]");
|
|
15
|
-
if (input) {
|
|
16
|
-
input.addEventListener("input", () => {
|
|
17
|
-
if (input.value.trim() !== "") {
|
|
18
|
-
input.setAttribute("fynd-show-clear", "true");
|
|
19
|
-
} else {
|
|
20
|
-
input.setAttribute("fynd-show-clear", "false");
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
if (clearButton && input) {
|
|
25
|
-
clearButton.addEventListener("click", () => {
|
|
26
|
-
input.value = "";
|
|
27
|
-
input.setAttribute("fynd-show-clear", "false");
|
|
28
|
-
input.dispatchEvent(new Event("input"));
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
})();
|
|
32
|
-
//# sourceMappingURL=clear-search.js.map
|
|
1
|
+
"use strict";(()=>{var e=document.querySelector("[fynd-show-clear]"),t=document.querySelector("[fynd-input-clear]");e&&e.addEventListener("input",()=>{e.value.trim()!==""?e.setAttribute("fynd-show-clear","true"):e.setAttribute("fynd-show-clear","false")});t&&e&&t.addEventListener("click",()=>{e.value="",e.setAttribute("fynd-show-clear","false"),e.dispatchEvent(new Event("input"))});})();
|