@fynd-design-engineering/fynd-one-v2 2.1.2 → 2.2.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.
@@ -1 +1,288 @@
1
- "use strict";(()=>{var l={NESTED_MENU_DELAY:10,NESTED_MENU_CLOSE_DELAY:500,MAIN_MENU_CLOSE_TIMEOUT:300},i={NESTED_MENU:'[data-mobile-nav="nested-menu"]',MAIN_MENU:'[data-mobile-nav="main-menu"]',TOGGLE_MAIN_MENU:'[data-nav-toggle="main-menu"]',TOGGLE_NESTED_MENU:'[data-nav-toggle="nested-menu"]',MAIN_MENU_LINKS:"[data-mobile-link]",NAV_OVERLAY:'[data-nav-element="overlay"]',OPEN_ICON:'[data-menu-icon="open"]',CLOSE_ICON:'[data-menu-icon="close"]',MOBILE_MENU:"[data-mobile-menu]"},a=class{constructor(){this.state={isMainMenuOpen:!1,isNestedMenuOpen:!1};this.isAnimating=!1;this.elements=this.getElements(),this.init()}getElements(){let e=document.querySelector(i.NESTED_MENU),t=document.querySelector(i.MAIN_MENU),s=document.querySelector(i.NAV_OVERLAY),n=document.querySelectorAll(i.OPEN_ICON),o=document.querySelectorAll(i.CLOSE_ICON);if(!e||!t||!s||n.length===0||o.length===0)throw new Error("Required navigation elements not found");return{nestedMenu:e,mainMenu:t,toggleMainMenuButtons:document.querySelectorAll(i.TOGGLE_MAIN_MENU),toggleNestedMenuButtons:document.querySelectorAll(i.TOGGLE_NESTED_MENU),mainMenuLinks:document.querySelectorAll(i.MAIN_MENU_LINKS),navOverlay:s,openIcons:n,closeIcons:o}}init(){this.setupInitialStyles(),this.bindEventListeners()}setupInitialStyles(){this.elements.nestedMenu.style.display="none",this.elements.nestedMenu.style.transform="translateX(100%)",this.elements.nestedMenu.style.transition="transform 0.5s ease",this.elements.mainMenu.style.display="block",this.elements.mainMenu.style.height="0dvh",this.elements.mainMenu.style.transition="height 0.3s ease-in-out",this.elements.openIcons.forEach(e=>{e.style.transition="opacity 0.2s ease"}),this.elements.closeIcons.forEach(e=>{e.style.transition="opacity 0.2s ease"}),this.updateMenuIcons(!1)}bindEventListeners(){this.elements.toggleMainMenuButtons.forEach((e,t)=>{e.addEventListener("click",s=>{s.preventDefault(),console.log(`Main menu button ${t} clicked, current state:`,this.state.isMainMenuOpen),this.handleMainMenuToggle(e)})}),this.elements.toggleNestedMenuButtons.forEach((e,t)=>{e.addEventListener("click",s=>{s.preventDefault(),console.log(`Nested menu button ${t} clicked, current state:`,this.state.isNestedMenuOpen),this.handleNestedMenuToggle(e)})}),this.elements.mainMenuLinks.forEach(e=>{e.addEventListener("click",t=>{let n=t.currentTarget.getAttribute("data-mobile-link");n&&(console.log(`Menu link clicked: ${n}`),this.replaceContent(n),this.toggleNestedMenu())})})}openMainMenu(){if(this.state.isMainMenuOpen){console.log("Main menu already open, skipping");return}let{mainMenu:e}=this.elements;this.isAnimating=!0,e.style.overflow="hidden",e.style.display="block",e.style.height="0dvh",this.state.isMainMenuOpen=!0,this.updateMenuIcons(!0),requestAnimationFrame(()=>{e.style.height="100dvh";let t=()=>{this.isAnimating=!1,console.log("\u{1F354} Main menu OPENED (animation complete)")};e.addEventListener("transitionend",t,{once:!0}),setTimeout(()=>{this.isAnimating=!1},350)}),console.log("\u{1F354} Main menu OPENING...")}closeMainMenu(){if(!this.state.isMainMenuOpen){console.log("Main menu already closed, skipping");return}let{mainMenu:e}=this.elements;this.isAnimating=!0,this.state.isMainMenuOpen=!1,this.updateMenuIcons(!1),e.style.height="0dvh";let t=!1,s=()=>{t||(t=!0,e.style.display="none",this.isAnimating=!1,console.log("\u{1F354} Main menu CLOSED (animation complete)"))},n=o=>{o.target===e&&o.propertyName==="height"&&s()};e.addEventListener("transitionend",n,{once:!0}),setTimeout(()=>{s()},l.MAIN_MENU_CLOSE_TIMEOUT),console.log("\u{1F354} Main menu CLOSING...")}handleMainMenuToggle(e){if(console.log("Handling main menu toggle. Current state:",this.state.isMainMenuOpen,"Is animating:",this.isAnimating),this.isAnimating){console.log("Animation in progress, ignoring click");return}this.state.isMainMenuOpen?(this.closeMainMenu(),this.state.isNestedMenuOpen&&this.closeNestedMenu()):this.openMainMenu()}handleNestedMenuToggle(e){if(console.log("Handling nested menu toggle. Current state:",this.state.isNestedMenuOpen,"Is animating:",this.isAnimating),this.isAnimating){console.log("Animation in progress, ignoring click");return}this.state.isNestedMenuOpen?this.closeNestedMenu():this.openNestedMenu()}toggleMainMenu(){console.log("Toggling main menu. Current state:",this.state.isMainMenuOpen),this.state.isMainMenuOpen?(this.closeMainMenu(),this.state.isNestedMenuOpen&&this.closeNestedMenu()):this.openMainMenu()}openNestedMenu(){if(this.state.isNestedMenuOpen){console.log("Nested menu already open, skipping");return}let{nestedMenu:e,navOverlay:t}=this.elements;e.style.display="block",t.style.opacity="1",setTimeout(()=>{e.style.transform="translateX(0%)"},l.NESTED_MENU_DELAY),this.state.isNestedMenuOpen=!0,console.log("\u{1F4C2} Nested menu OPENED")}closeNestedMenu(){if(!this.state.isNestedMenuOpen){console.log("Nested menu already closed, skipping");return}let{nestedMenu:e,navOverlay:t}=this.elements;e.style.transform="translateX(100%)",t.style.opacity="0",this.state.isNestedMenuOpen=!1,setTimeout(()=>{e.style.display="none",console.log("\u{1F4C2} Nested menu CLOSED (animation complete)")},l.NESTED_MENU_CLOSE_DELAY),console.log("\u{1F4C2} Nested menu closing...")}toggleNestedMenu(){console.log("Toggling nested menu. Current state:",this.state.isNestedMenuOpen),this.state.isNestedMenuOpen?this.closeNestedMenu():this.openNestedMenu()}updateMenuIcons(e){let{openIcons:t,closeIcons:s}=this.elements;console.log("Updating menu icons. isOpen:",e),e?(t.forEach(n=>{n.style.opacity="0"}),s.forEach(n=>{n.style.opacity="1"})):(t.forEach(n=>{n.style.opacity="1"}),s.forEach(n=>{n.style.opacity="0"}))}replaceContent(e){document.querySelectorAll(i.MOBILE_MENU).forEach(s=>{s.style.display="none"});let t=document.querySelector(`[data-mobile-menu="${e}"]`);t?(t.style.display="block",console.log(`\u{1F4C4} Content switched to: ${e}`)):console.warn(`Content element with data-mobile-menu="${e}" not found`)}getState(){return{...this.state}}closeAllMenus(){this.state.isMainMenuOpen&&this.closeMainMenu(),this.state.isNestedMenuOpen&&this.closeNestedMenu()}};document.addEventListener("DOMContentLoaded",()=>{try{new a}catch(u){console.error("Failed to initialize mobile navigation:",u)}});})();
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
+ console.log("Live reload disabled: not running on localhost");
11
+ }
12
+
13
+ // src/navigation/mobile/index.ts
14
+ var ANIMATION_TIMINGS = {
15
+ NESTED_MENU_DELAY: 10,
16
+ NESTED_MENU_CLOSE_DELAY: 500,
17
+ MAIN_MENU_CLOSE_TIMEOUT: 300
18
+ // Add timeout for main menu close
19
+ };
20
+ var SELECTORS = {
21
+ NESTED_MENU: '[data-mobile-nav="nested-menu"]',
22
+ MAIN_MENU: '[data-mobile-nav="main-menu"]',
23
+ TOGGLE_MAIN_MENU: '[data-nav-toggle="main-menu"]',
24
+ TOGGLE_NESTED_MENU: '[data-nav-toggle="nested-menu"]',
25
+ MAIN_MENU_LINKS: "[data-mobile-link]",
26
+ NAV_OVERLAY: '[data-nav-element="overlay"]',
27
+ OPEN_ICON: '[data-menu-icon="open"]',
28
+ CLOSE_ICON: '[data-menu-icon="close"]',
29
+ MOBILE_MENU: "[data-mobile-menu]"
30
+ };
31
+ var MobileNavigation = class {
32
+ constructor() {
33
+ this.state = {
34
+ isMainMenuOpen: false,
35
+ isNestedMenuOpen: false
36
+ };
37
+ this.isAnimating = false;
38
+ this.elements = this.getElements();
39
+ this.init();
40
+ }
41
+ getElements() {
42
+ const nestedMenu = document.querySelector(SELECTORS.NESTED_MENU);
43
+ const mainMenu = document.querySelector(SELECTORS.MAIN_MENU);
44
+ const navOverlay = document.querySelector(SELECTORS.NAV_OVERLAY);
45
+ const openIcons = document.querySelectorAll(SELECTORS.OPEN_ICON);
46
+ const closeIcons = document.querySelectorAll(SELECTORS.CLOSE_ICON);
47
+ if (!nestedMenu || !mainMenu || !navOverlay || openIcons.length === 0 || closeIcons.length === 0) {
48
+ throw new Error("Required navigation elements not found");
49
+ }
50
+ return {
51
+ nestedMenu,
52
+ mainMenu,
53
+ toggleMainMenuButtons: document.querySelectorAll(SELECTORS.TOGGLE_MAIN_MENU),
54
+ toggleNestedMenuButtons: document.querySelectorAll(SELECTORS.TOGGLE_NESTED_MENU),
55
+ mainMenuLinks: document.querySelectorAll(SELECTORS.MAIN_MENU_LINKS),
56
+ navOverlay,
57
+ openIcons,
58
+ closeIcons
59
+ };
60
+ }
61
+ init() {
62
+ this.setupInitialStyles();
63
+ this.bindEventListeners();
64
+ }
65
+ setupInitialStyles() {
66
+ this.elements.nestedMenu.style.display = "none";
67
+ this.elements.nestedMenu.style.transform = "translateX(100%)";
68
+ this.elements.nestedMenu.style.transition = "transform 0.5s ease";
69
+ this.elements.mainMenu.style.display = "block";
70
+ this.elements.mainMenu.style.height = "0dvh";
71
+ this.elements.mainMenu.style.transition = "height 0.3s ease-in-out";
72
+ this.elements.openIcons.forEach((icon) => {
73
+ icon.style.transition = "opacity 0.2s ease";
74
+ });
75
+ this.elements.closeIcons.forEach((icon) => {
76
+ icon.style.transition = "opacity 0.2s ease";
77
+ });
78
+ this.updateMenuIcons(false);
79
+ }
80
+ bindEventListeners() {
81
+ this.elements.toggleMainMenuButtons.forEach((button, index) => {
82
+ button.addEventListener("click", (e) => {
83
+ e.preventDefault();
84
+ console.log(`Main menu button ${index} clicked, current state:`, this.state.isMainMenuOpen);
85
+ this.handleMainMenuToggle(button);
86
+ });
87
+ });
88
+ this.elements.toggleNestedMenuButtons.forEach((button, index) => {
89
+ button.addEventListener("click", (e) => {
90
+ e.preventDefault();
91
+ console.log(`Nested menu button ${index} clicked, current state:`, this.state.isNestedMenuOpen);
92
+ this.handleNestedMenuToggle(button);
93
+ });
94
+ });
95
+ this.elements.mainMenuLinks.forEach((link) => {
96
+ link.addEventListener("click", (event) => {
97
+ const target = event.currentTarget;
98
+ const attrValue = target.getAttribute("data-mobile-link");
99
+ if (attrValue) {
100
+ console.log(`Menu link clicked: ${attrValue}`);
101
+ this.replaceContent(attrValue);
102
+ this.toggleNestedMenu();
103
+ }
104
+ });
105
+ });
106
+ }
107
+ openMainMenu() {
108
+ if (this.state.isMainMenuOpen) {
109
+ console.log("Main menu already open, skipping");
110
+ return;
111
+ }
112
+ const { mainMenu } = this.elements;
113
+ this.isAnimating = true;
114
+ mainMenu.style.overflow = "hidden";
115
+ mainMenu.style.display = "block";
116
+ mainMenu.style.height = "0dvh";
117
+ this.state.isMainMenuOpen = true;
118
+ this.updateMenuIcons(true);
119
+ requestAnimationFrame(() => {
120
+ mainMenu.style.height = "100dvh";
121
+ const handleOpenComplete = () => {
122
+ this.isAnimating = false;
123
+ console.log("\u{1F354} Main menu OPENED (animation complete)");
124
+ };
125
+ mainMenu.addEventListener("transitionend", handleOpenComplete, { once: true });
126
+ setTimeout(() => {
127
+ this.isAnimating = false;
128
+ }, 350);
129
+ });
130
+ console.log("\u{1F354} Main menu OPENING...");
131
+ }
132
+ closeMainMenu() {
133
+ if (!this.state.isMainMenuOpen) {
134
+ console.log("Main menu already closed, skipping");
135
+ return;
136
+ }
137
+ const { mainMenu } = this.elements;
138
+ this.isAnimating = true;
139
+ this.state.isMainMenuOpen = false;
140
+ this.updateMenuIcons(false);
141
+ mainMenu.style.height = "0dvh";
142
+ let animationCompleted = false;
143
+ const completeClose = () => {
144
+ if (animationCompleted) return;
145
+ animationCompleted = true;
146
+ mainMenu.style.display = "none";
147
+ this.isAnimating = false;
148
+ console.log("\u{1F354} Main menu CLOSED (animation complete)");
149
+ };
150
+ const handleTransitionEnd = (e) => {
151
+ if (e.target === mainMenu && e.propertyName === "height") {
152
+ completeClose();
153
+ }
154
+ };
155
+ mainMenu.addEventListener("transitionend", handleTransitionEnd, { once: true });
156
+ setTimeout(() => {
157
+ completeClose();
158
+ }, ANIMATION_TIMINGS.MAIN_MENU_CLOSE_TIMEOUT);
159
+ console.log("\u{1F354} Main menu CLOSING...");
160
+ }
161
+ handleMainMenuToggle(clickedButton) {
162
+ console.log("Handling main menu toggle. Current state:", this.state.isMainMenuOpen, "Is animating:", this.isAnimating);
163
+ if (this.isAnimating) {
164
+ console.log("Animation in progress, ignoring click");
165
+ return;
166
+ }
167
+ if (this.state.isMainMenuOpen) {
168
+ this.closeMainMenu();
169
+ if (this.state.isNestedMenuOpen) {
170
+ this.closeNestedMenu();
171
+ }
172
+ } else {
173
+ this.openMainMenu();
174
+ }
175
+ }
176
+ handleNestedMenuToggle(clickedButton) {
177
+ console.log("Handling nested menu toggle. Current state:", this.state.isNestedMenuOpen, "Is animating:", this.isAnimating);
178
+ if (this.isAnimating) {
179
+ console.log("Animation in progress, ignoring click");
180
+ return;
181
+ }
182
+ if (this.state.isNestedMenuOpen) {
183
+ this.closeNestedMenu();
184
+ } else {
185
+ this.openNestedMenu();
186
+ }
187
+ }
188
+ toggleMainMenu() {
189
+ console.log("Toggling main menu. Current state:", this.state.isMainMenuOpen);
190
+ if (this.state.isMainMenuOpen) {
191
+ this.closeMainMenu();
192
+ if (this.state.isNestedMenuOpen) {
193
+ this.closeNestedMenu();
194
+ }
195
+ } else {
196
+ this.openMainMenu();
197
+ }
198
+ }
199
+ openNestedMenu() {
200
+ if (this.state.isNestedMenuOpen) {
201
+ console.log("Nested menu already open, skipping");
202
+ return;
203
+ }
204
+ const { nestedMenu, navOverlay } = this.elements;
205
+ nestedMenu.style.display = "block";
206
+ navOverlay.style.opacity = "1";
207
+ setTimeout(() => {
208
+ nestedMenu.style.transform = "translateX(0%)";
209
+ }, ANIMATION_TIMINGS.NESTED_MENU_DELAY);
210
+ this.state.isNestedMenuOpen = true;
211
+ console.log("\u{1F4C2} Nested menu OPENED");
212
+ }
213
+ closeNestedMenu() {
214
+ if (!this.state.isNestedMenuOpen) {
215
+ console.log("Nested menu already closed, skipping");
216
+ return;
217
+ }
218
+ const { nestedMenu, navOverlay } = this.elements;
219
+ nestedMenu.style.transform = "translateX(100%)";
220
+ navOverlay.style.opacity = "0";
221
+ this.state.isNestedMenuOpen = false;
222
+ setTimeout(() => {
223
+ nestedMenu.style.display = "none";
224
+ console.log("\u{1F4C2} Nested menu CLOSED (animation complete)");
225
+ }, ANIMATION_TIMINGS.NESTED_MENU_CLOSE_DELAY);
226
+ console.log("\u{1F4C2} Nested menu closing...");
227
+ }
228
+ toggleNestedMenu() {
229
+ console.log("Toggling nested menu. Current state:", this.state.isNestedMenuOpen);
230
+ if (this.state.isNestedMenuOpen) {
231
+ this.closeNestedMenu();
232
+ } else {
233
+ this.openNestedMenu();
234
+ }
235
+ }
236
+ updateMenuIcons(isOpen) {
237
+ const { openIcons, closeIcons } = this.elements;
238
+ console.log("Updating menu icons. isOpen:", isOpen);
239
+ if (isOpen) {
240
+ openIcons.forEach((icon) => {
241
+ icon.style.opacity = "0";
242
+ });
243
+ closeIcons.forEach((icon) => {
244
+ icon.style.opacity = "1";
245
+ });
246
+ } else {
247
+ openIcons.forEach((icon) => {
248
+ icon.style.opacity = "1";
249
+ });
250
+ closeIcons.forEach((icon) => {
251
+ icon.style.opacity = "0";
252
+ });
253
+ }
254
+ }
255
+ replaceContent(attrValue) {
256
+ document.querySelectorAll(SELECTORS.MOBILE_MENU).forEach((div) => {
257
+ div.style.display = "none";
258
+ });
259
+ const targetDiv = document.querySelector(`[data-mobile-menu="${attrValue}"]`);
260
+ if (targetDiv) {
261
+ targetDiv.style.display = "block";
262
+ console.log(`\u{1F4C4} Content switched to: ${attrValue}`);
263
+ } else {
264
+ console.warn(`Content element with data-mobile-menu="${attrValue}" not found`);
265
+ }
266
+ }
267
+ // Public methods for external access if needed
268
+ getState() {
269
+ return { ...this.state };
270
+ }
271
+ closeAllMenus() {
272
+ if (this.state.isMainMenuOpen) {
273
+ this.closeMainMenu();
274
+ }
275
+ if (this.state.isNestedMenuOpen) {
276
+ this.closeNestedMenu();
277
+ }
278
+ }
279
+ };
280
+ document.addEventListener("DOMContentLoaded", () => {
281
+ try {
282
+ new MobileNavigation();
283
+ } catch (error) {
284
+ console.error("Failed to initialize mobile navigation:", error);
285
+ }
286
+ });
287
+ })();
288
+ //# sourceMappingURL=index.js.map
@@ -1 +1,55 @@
1
- "use strict";(()=>{var t=document.querySelector("[navigation-scrolled]"),o=document.querySelectorAll("[navigation-scrolled-menu]");function a(){let n=window.scrollY||document.documentElement.scrollTop;if(!t){console.warn("Navigation element not found");return}t.setAttribute("navigation-scrolled",n>350?"true":"false"),o&&o.forEach(e=>{e.setAttribute("navigation-scrolled-menu",n>350?"true":"false")})}function i(){let n=document.querySelectorAll("[announcementbar]");if(n.length===0){console.warn("No announcement bar elements found");return}window.announcementSlides===0||window.announcementSlides===void 0?(n.forEach(e=>{e.setAttribute("announcementbar","false")}),console.log("No announcement slides found, disabling announcement bars.")):n.forEach(e=>{e.setAttribute("announcementbar","true")})}t.setAttribute("navigation-scrolled","true");document.addEventListener("DOMContentLoaded",()=>{setTimeout(()=>{i(),a()},120)});window.addEventListener("scroll",a);})();
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
+ console.log("Live reload disabled: not running on localhost");
11
+ }
12
+
13
+ // src/navigation/scroll/index.ts
14
+ var navigationDiv = document.querySelector("[navigation-scrolled]");
15
+ var mobileNavigationMenus = document.querySelectorAll("[navigation-scrolled-menu]");
16
+ function setNavigationScrolled() {
17
+ const scrollTop = window.scrollY || document.documentElement.scrollTop;
18
+ if (!navigationDiv) {
19
+ console.warn("Navigation element not found");
20
+ return;
21
+ }
22
+ navigationDiv.setAttribute("navigation-scrolled", scrollTop > 350 ? "true" : "false");
23
+ if (mobileNavigationMenus) {
24
+ mobileNavigationMenus.forEach((menu) => {
25
+ menu.setAttribute("navigation-scrolled-menu", scrollTop > 350 ? "true" : "false");
26
+ });
27
+ }
28
+ }
29
+ function checkAndDisableAnnouncementBars() {
30
+ const announcementBarElements = document.querySelectorAll("[announcementbar]");
31
+ if (announcementBarElements.length === 0) {
32
+ console.warn("No announcement bar elements found");
33
+ return;
34
+ }
35
+ if (window.announcementSlides === 0 || window.announcementSlides === void 0) {
36
+ announcementBarElements.forEach((element) => {
37
+ element.setAttribute("announcementbar", "false");
38
+ });
39
+ console.log("No announcement slides found, disabling announcement bars.");
40
+ } else {
41
+ announcementBarElements.forEach((element) => {
42
+ element.setAttribute("announcementbar", "true");
43
+ });
44
+ }
45
+ }
46
+ navigationDiv.setAttribute("navigation-scrolled", "true");
47
+ document.addEventListener("DOMContentLoaded", () => {
48
+ setTimeout(() => {
49
+ checkAndDisableAnnouncementBars();
50
+ setNavigationScrolled();
51
+ }, 120);
52
+ });
53
+ window.addEventListener("scroll", setNavigationScrolled);
54
+ })();
55
+ //# sourceMappingURL=index.js.map
@@ -1 +1,102 @@
1
- [data-tab-link-active=true]{border-right-color:#404040;background-color:#f8f8f9;opacity:1}[data-tab-content-active]{display:none}[data-tab-content-active=true]{display:block}[data-tab-content-active=false]{display:none}[data-nav-element=mover]{height:0;overflow:hidden}[data-nav-element=overlay]{opacity:0;display:none}[data-nav-element=wrapper]{top:100px}[data-nav-toggle=main-menu]{z-index:10!important}[data-mobile-nav=main-menu]{z-index:999}[data-nav-element=mover]{border-radius:0 0 12px 12px;box-shadow:#00000008 0 12px 16px 6px}[data-dropdown-item],[data-dropdown-item=resources],[data-dropdown-item=company]{width:100%}[data-desktop-content]{display:none}@media (max-width: 992px){[data-desktop-content]{display:block}}.announcement-pagination.swiper-pagination-clickable.swiper-pagination-bullets.swiper-pagination-horizontal{display:none;flex-direction:column;height:100%;bottom:0;justify-content:center;gap:4px;padding-left:20px;padding-right:20px}span.swiper-pagination-bullet{width:6px;height:6px;background:#fffc;pointer-events:auto}span.swiper-pagination-bullet.swiper-pagination-bullet-active{background:#fff}@media screen and (max-width: 1024px){.announcement-pagination.swiper-pagination-clickable.swiper-pagination-bullets.swiper-pagination-horizontal{left:-16px}}[navigation-scrolled=true]{transform:translateY(-40px);box-shadow:#00000008 0 12px 16px 10px}[announcementbar=false]{transform:translateY(-40px)!important}[navigation-scrolled-menu=false]{top:0}[navigation-scrolled=false]{transform:translateY(0)}@media screen and (max-width: 991px){[navigation-scrolled=true]{transform:translateY(-50px)}[navigation-scrolled-menu=true]{top:46px}[announcementbar=false]{transform:translateY(-46px)!important}}
1
+ /* src/navigation/style.css */
2
+ [data-tab-link-active=true] {
3
+ border-right-color: #404040;
4
+ background-color: #f8f8f9;
5
+ opacity: 1;
6
+ }
7
+ [data-tab-content-active] {
8
+ display: none;
9
+ }
10
+ [data-tab-content-active=true] {
11
+ display: block;
12
+ }
13
+ [data-tab-content-active=false] {
14
+ display: none;
15
+ }
16
+ [data-nav-element=mover] {
17
+ height: 0;
18
+ overflow: hidden;
19
+ }
20
+ [data-nav-element=overlay] {
21
+ opacity: 0;
22
+ display: none;
23
+ }
24
+ [data-nav-element=wrapper] {
25
+ top: 100px;
26
+ }
27
+ [data-nav-toggle=main-menu] {
28
+ z-index: 10 !important;
29
+ }
30
+ [data-mobile-nav=main-menu] {
31
+ z-index: 999;
32
+ }
33
+ [data-nav-element=mover] {
34
+ border-radius: 0px 0px 12px 12px;
35
+ box-shadow: rgba(0, 0, 0, 0.03) 0px 12px 16px 6px;
36
+ }
37
+ [data-dropdown-item] {
38
+ width: 100%;
39
+ }
40
+ [data-dropdown-item=resources] {
41
+ width: 100%;
42
+ }
43
+ [data-dropdown-item=company] {
44
+ width: 100%;
45
+ }
46
+ [data-desktop-content] {
47
+ display: none;
48
+ }
49
+ @media (max-width: 992px) {
50
+ [data-desktop-content] {
51
+ display: block;
52
+ }
53
+ }
54
+ .announcement-pagination.swiper-pagination-clickable.swiper-pagination-bullets.swiper-pagination-horizontal {
55
+ display: none;
56
+ flex-direction: column;
57
+ height: 100%;
58
+ bottom: 0px;
59
+ justify-content: center;
60
+ gap: 4px;
61
+ padding-left: 20px;
62
+ padding-right: 20px;
63
+ }
64
+ span.swiper-pagination-bullet {
65
+ width: 6px;
66
+ height: 6px;
67
+ background: rgba(255, 255, 255, 0.80);
68
+ pointer-events: auto;
69
+ }
70
+ span.swiper-pagination-bullet.swiper-pagination-bullet-active {
71
+ background: white;
72
+ }
73
+ @media screen and (max-width: 1024px) {
74
+ .announcement-pagination.swiper-pagination-clickable.swiper-pagination-bullets.swiper-pagination-horizontal {
75
+ left: -16px;
76
+ }
77
+ }
78
+ [navigation-scrolled=true] {
79
+ transform: translateY(-40px);
80
+ box-shadow: rgba(0, 0, 0, 0.03) 0px 12px 16px 10px;
81
+ }
82
+ [announcementbar=false] {
83
+ transform: translateY(-40px) !important;
84
+ }
85
+ [navigation-scrolled-menu=false] {
86
+ top: 0px;
87
+ }
88
+ [navigation-scrolled=false] {
89
+ transform: translateY(0);
90
+ }
91
+ @media screen and (max-width: 991px) {
92
+ [navigation-scrolled=true] {
93
+ transform: translateY(-50px);
94
+ }
95
+ [navigation-scrolled-menu=true] {
96
+ top: 46px;
97
+ }
98
+ [announcementbar=false] {
99
+ transform: translateY(-46px) !important;
100
+ }
101
+ }
102
+ /*# sourceMappingURL=style.css.map */
@@ -0,0 +1,74 @@
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
+ console.log("Live reload disabled: not running on localhost");
11
+ }
12
+
13
+ // src/posthog/form-success.ts
14
+ var FORM_SUCCESS_STORAGE_KEY = "form_success_tracking";
15
+ var SESSION_DURATION_MS = 10 * 60 * 1e3;
16
+ function getFormName() {
17
+ const urlParams = new URLSearchParams(window.location.search);
18
+ const formName = urlParams.get("form_name");
19
+ return formName ? decodeURIComponent(formName) : null;
20
+ }
21
+ function hasFormSuccessBeenTracked(formName) {
22
+ try {
23
+ const storedData = sessionStorage.getItem(FORM_SUCCESS_STORAGE_KEY);
24
+ if (!storedData) {
25
+ return false;
26
+ }
27
+ const parsedData = JSON.parse(storedData);
28
+ const currentTime = Date.now();
29
+ const timeDifference = currentTime - parsedData.timestamp;
30
+ if (timeDifference > SESSION_DURATION_MS) {
31
+ sessionStorage.removeItem(FORM_SUCCESS_STORAGE_KEY);
32
+ return false;
33
+ }
34
+ return parsedData.formName === formName;
35
+ } catch (error) {
36
+ console.error("Error checking form success tracking:", error);
37
+ sessionStorage.removeItem(FORM_SUCCESS_STORAGE_KEY);
38
+ return false;
39
+ }
40
+ }
41
+ function markFormSuccessAsTracked(formName) {
42
+ try {
43
+ const trackingData = {
44
+ timestamp: Date.now(),
45
+ formName
46
+ };
47
+ sessionStorage.setItem(FORM_SUCCESS_STORAGE_KEY, JSON.stringify(trackingData));
48
+ } catch (error) {
49
+ console.error("Error storing form success tracking data:", error);
50
+ }
51
+ }
52
+ document.addEventListener("DOMContentLoaded", function() {
53
+ const currentFormName = getFormName();
54
+ if (!currentFormName) {
55
+ console.log("No form name found in URL parameters");
56
+ return;
57
+ }
58
+ if (hasFormSuccessBeenTracked(currentFormName)) {
59
+ console.log(`Form success for "${currentFormName}" already tracked in this session`);
60
+ return;
61
+ }
62
+ if (window.posthog && window.getTrackingPropertiesWithForm) {
63
+ window.posthog.capture(
64
+ "fynd_form_success",
65
+ window.getTrackingPropertiesWithForm(currentFormName)
66
+ );
67
+ markFormSuccessAsTracked(currentFormName);
68
+ console.log(`Form success tracked for "${currentFormName}"`);
69
+ } else {
70
+ console.warn("PostHog or tracking functions not available");
71
+ }
72
+ });
73
+ })();
74
+ //# sourceMappingURL=form-success.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../bin/live-reload.js", "../../src/posthog/form-success.ts"],
4
+ "sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n console.log(\"Live reload disabled: not running on localhost\");\n}\n", "// Type definitions (if not already defined elsewhere)\ninterface TrackingProperties {\n source_page: string;\n fynd_product: string;\n interface: string;\n device_type: string;\n utm_source: string;\n utm_medium: string;\n utm_campaign: string;\n referrer: string;\n}\n\ninterface TrackingPropertiesWithForm extends TrackingProperties {\n form_name: string;\n}\n\ninterface PostHog {\n capture: (eventName: string, properties: TrackingProperties | TrackingPropertiesWithForm) => void;\n}\n\n// Global declarations (if not already defined elsewhere)\ndeclare global {\n interface Window {\n getTrackingPropertiesWithForm: (formName: string) => TrackingPropertiesWithForm;\n posthog: PostHog;\n }\n}\n\n// This export statement makes the file a module and allows global declarations to work\nexport { };\n\n// Session storage key for tracking form success events\nconst FORM_SUCCESS_STORAGE_KEY = 'form_success_tracking';\nconst SESSION_DURATION_MS = 10 * 60 * 1000; // 10 minutes in milliseconds\n\ninterface FormSuccessData {\n timestamp: number;\n formName: string;\n}\n\nfunction getFormName(): string | null {\n const urlParams: URLSearchParams = new URLSearchParams(window.location.search);\n const formName: string | null = urlParams.get(\"form_name\");\n return formName ? decodeURIComponent(formName) : null;\n}\n\nfunction hasFormSuccessBeenTracked(formName: string): boolean {\n try {\n const storedData: string | null = sessionStorage.getItem(FORM_SUCCESS_STORAGE_KEY);\n\n if (!storedData) {\n return false;\n }\n\n const parsedData: FormSuccessData = JSON.parse(storedData);\n const currentTime: number = Date.now();\n const timeDifference: number = currentTime - parsedData.timestamp;\n\n // Check if the session has expired (more than 10 minutes)\n if (timeDifference > SESSION_DURATION_MS) {\n // Session expired, remove old data\n sessionStorage.removeItem(FORM_SUCCESS_STORAGE_KEY);\n return false;\n }\n\n // Check if the same form success was already tracked in this session\n return parsedData.formName === formName;\n } catch (error) {\n console.error('Error checking form success tracking:', error);\n // If there's an error, clear the storage and allow tracking\n sessionStorage.removeItem(FORM_SUCCESS_STORAGE_KEY);\n return false;\n }\n}\n\nfunction markFormSuccessAsTracked(formName: string): void {\n try {\n const trackingData: FormSuccessData = {\n timestamp: Date.now(),\n formName: formName\n };\n\n sessionStorage.setItem(FORM_SUCCESS_STORAGE_KEY, JSON.stringify(trackingData));\n } catch (error) {\n console.error('Error storing form success tracking data:', error);\n }\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", function (): void {\n const currentFormName: string | null = getFormName();\n\n if (!currentFormName) {\n console.log('No form name found in URL parameters');\n return;\n }\n\n // Check if form success has already been tracked for this form in the current session\n if (hasFormSuccessBeenTracked(currentFormName)) {\n console.log(`Form success for \"${currentFormName}\" already tracked in this session`);\n return;\n }\n\n if (window.posthog && window.getTrackingPropertiesWithForm) {\n window.posthog.capture(\n \"fynd_form_success\",\n window.getTrackingPropertiesWithForm(currentFormName)\n );\n\n // Mark this form success as tracked\n markFormSuccessAsTracked(currentFormName);\n console.log(`Form success tracked for \"${currentFormName}\"`);\n } else {\n console.warn(\"PostHog or tracking functions not available\");\n }\n});"],
5
+ "mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,MACpE,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,OAAO;AACL,YAAQ,IAAI,gDAAgD;AAAA,EAC9D;;;ACsBA,MAAM,2BAA2B;AACjC,MAAM,sBAAsB,KAAK,KAAK;AAOtC,WAAS,cAA6B;AAClC,UAAM,YAA6B,IAAI,gBAAgB,OAAO,SAAS,MAAM;AAC7E,UAAM,WAA0B,UAAU,IAAI,WAAW;AACzD,WAAO,WAAW,mBAAmB,QAAQ,IAAI;AAAA,EACrD;AAEA,WAAS,0BAA0B,UAA2B;AAC1D,QAAI;AACA,YAAM,aAA4B,eAAe,QAAQ,wBAAwB;AAEjF,UAAI,CAAC,YAAY;AACb,eAAO;AAAA,MACX;AAEA,YAAM,aAA8B,KAAK,MAAM,UAAU;AACzD,YAAM,cAAsB,KAAK,IAAI;AACrC,YAAM,iBAAyB,cAAc,WAAW;AAGxD,UAAI,iBAAiB,qBAAqB;AAEtC,uBAAe,WAAW,wBAAwB;AAClD,eAAO;AAAA,MACX;AAGA,aAAO,WAAW,aAAa;AAAA,IACnC,SAAS,OAAO;AACZ,cAAQ,MAAM,yCAAyC,KAAK;AAE5D,qBAAe,WAAW,wBAAwB;AAClD,aAAO;AAAA,IACX;AAAA,EACJ;AAEA,WAAS,yBAAyB,UAAwB;AACtD,QAAI;AACA,YAAM,eAAgC;AAAA,QAClC,WAAW,KAAK,IAAI;AAAA,QACpB;AAAA,MACJ;AAEA,qBAAe,QAAQ,0BAA0B,KAAK,UAAU,YAAY,CAAC;AAAA,IACjF,SAAS,OAAO;AACZ,cAAQ,MAAM,6CAA6C,KAAK;AAAA,IACpE;AAAA,EACJ;AAEA,WAAS,iBAAiB,oBAAoB,WAAkB;AAC5D,UAAM,kBAAiC,YAAY;AAEnD,QAAI,CAAC,iBAAiB;AAClB,cAAQ,IAAI,sCAAsC;AAClD;AAAA,IACJ;AAGA,QAAI,0BAA0B,eAAe,GAAG;AAC5C,cAAQ,IAAI,qBAAqB,eAAe,mCAAmC;AACnF;AAAA,IACJ;AAEA,QAAI,OAAO,WAAW,OAAO,+BAA+B;AACxD,aAAO,QAAQ;AAAA,QACX;AAAA,QACA,OAAO,8BAA8B,eAAe;AAAA,MACxD;AAGA,+BAAyB,eAAe;AACxC,cAAQ,IAAI,6BAA6B,eAAe,GAAG;AAAA,IAC/D,OAAO;AACH,cAAQ,KAAK,6CAA6C;AAAA,IAC9D;AAAA,EACJ,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,119 @@
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
+ console.log("Live reload disabled: not running on localhost");
11
+ }
12
+
13
+ // src/posthog/index.ts
14
+ var getTrackingProperties = () => {
15
+ const pathname = window.location.pathname;
16
+ return {
17
+ source_page: pathname === "/" ? pathname + " Home" : pathname,
18
+ fynd_product: "fynd.com website",
19
+ interface: "Webflow",
20
+ device_type: /Mobile|Android|iPhone|iPad/.test(navigator.userAgent) ? "Mobile" : "Web",
21
+ utm_source: new URLSearchParams(window.location.search).get("utm_source") || "",
22
+ utm_medium: new URLSearchParams(window.location.search).get("utm_medium") || "",
23
+ utm_campaign: new URLSearchParams(window.location.search).get("utm_campaign") || "",
24
+ referrer: document.referrer
25
+ };
26
+ };
27
+ var getTrackingPropertiesWithForm = (formName) => {
28
+ return {
29
+ ...getTrackingProperties(),
30
+ form_name: formName
31
+ };
32
+ };
33
+ window.getTrackingProperties = getTrackingProperties;
34
+ window.getTrackingPropertiesWithForm = getTrackingPropertiesWithForm;
35
+ window.interactedForm = "";
36
+ document.addEventListener("DOMContentLoaded", function() {
37
+ if (window.posthog) {
38
+ window.posthog.capture("$pageview", window.getTrackingProperties());
39
+ }
40
+ });
41
+ window.addEventListener("load", function() {
42
+ if (window.posthog) {
43
+ window.posthog.capture("fynd_page_loaded", window.getTrackingProperties());
44
+ }
45
+ });
46
+ document.addEventListener("DOMContentLoaded", function() {
47
+ const signUpButtons = document.querySelectorAll('[data-ph="sign-up"]');
48
+ const signInButtons = document.querySelectorAll('[data-ph="sign-in"]');
49
+ const scrollToFormButtons = document.querySelectorAll(
50
+ '[href="#footer-form"]'
51
+ );
52
+ const bookADemoButtons = document.querySelectorAll('[data-ph="book-a-demo"]');
53
+ signUpButtons.forEach((button) => {
54
+ button.addEventListener("click", function() {
55
+ if (window.posthog) {
56
+ window.posthog.capture("fynd_clicked_sign_up", window.getTrackingProperties());
57
+ }
58
+ });
59
+ });
60
+ signInButtons.forEach((button) => {
61
+ button.addEventListener("click", function() {
62
+ if (window.posthog) {
63
+ window.posthog.capture("fynd_clicked_sign_in", window.getTrackingProperties());
64
+ }
65
+ });
66
+ });
67
+ scrollToFormButtons.forEach((button) => {
68
+ button.addEventListener("click", function() {
69
+ if (window.posthog) {
70
+ window.posthog.capture("fynd_clicked_scroll_to_form", window.getTrackingProperties());
71
+ }
72
+ });
73
+ });
74
+ bookADemoButtons.forEach((button) => {
75
+ button.addEventListener("click", function() {
76
+ if (window.posthog) {
77
+ window.posthog.capture("fynd_clicked_book_a_demo", window.getTrackingProperties());
78
+ }
79
+ });
80
+ });
81
+ });
82
+ document.addEventListener("DOMContentLoaded", function() {
83
+ const formFields = document.querySelectorAll("[data-posthog-trigger]");
84
+ console.log(
85
+ "%cposthog/custom-events.js:58 formFields",
86
+ "color: #007acc;",
87
+ formFields
88
+ );
89
+ const processedForms = /* @__PURE__ */ new Set();
90
+ formFields.forEach((field) => {
91
+ field.addEventListener("change", function() {
92
+ const parentForm = this.closest("form");
93
+ if (parentForm) {
94
+ if (processedForms.has(parentForm)) {
95
+ return null;
96
+ }
97
+ processedForms.add(parentForm);
98
+ const formName = parentForm.getAttribute("data-name");
99
+ window.interactedForm = formName || "";
100
+ if (formName && window.posthog) {
101
+ console.log("form started");
102
+ window.posthog.capture(
103
+ "fynd_form_started",
104
+ window.getTrackingPropertiesWithForm(formName)
105
+ );
106
+ return formName;
107
+ } else {
108
+ console.warn("No data-name attribute found on parent form or PostHog not available");
109
+ return null;
110
+ }
111
+ } else {
112
+ console.warn("No parent form found");
113
+ return null;
114
+ }
115
+ });
116
+ });
117
+ });
118
+ })();
119
+ //# sourceMappingURL=index.js.map