@fynd-design-engineering/fynd-one-v2 3.3.51 → 3.3.52
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/hacktimus/2025.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var
|
|
1
|
+
"use strict";(()=>{console.log("Hacktimus 2025 script loaded.");var S=window.matchMedia("(prefers-reduced-motion: reduce)").matches;document.addEventListener("DOMContentLoaded",()=>{let a=window.gsap,s=window.ScrollTrigger;if(a&&s){let r=function(){if(s.getAll().forEach(c=>c.kill()),!e||!t)return;let i=t.scrollWidth-e.clientWidth;i<=0||(a.set(t,{x:0}),a.to(t,{x:-i,ease:"none",scrollTrigger:{trigger:n||e,start:"top top",end:()=>"+="+i,scrub:!0,pin:!0,anticipatePin:1,invalidateOnRefresh:!0}}),s.addEventListener("refreshInit",()=>a.set(t,{x:0})),s.refresh())};var v=r;a.registerPlugin(s);let n=document.getElementById("h-scroll"),e=document.getElementById("cardsViewport"),t=document.getElementById("cardsTrack");r();let o=0;window.addEventListener("resize",()=>{o&&cancelAnimationFrame(o),o=requestAnimationFrame(()=>r())})}else console.warn("GSAP or ScrollTrigger not found on window.");let E=new Date("2025-11-30T00:00:00Z");function m(){let n=Date.now(),e=E.getTime()-n;if(e<=0){document.querySelectorAll("[fynd-timer]").forEach(d=>{d.textContent="00"}),clearInterval(h);return}let t=Math.floor(e/(1e3*60*60*24)),r=Math.floor(e/(1e3*60*60)%24),o=Math.floor(e/(1e3*60)%60),i=Math.floor(e/1e3%60),c=(d,l)=>{let p=document.querySelector(`[fynd-timer=${d}]`);p&&(p.textContent=l.toString().padStart(2,"0"))};c("day",t),c("hour",r),c("minute",o),c("second",i)}let h=setInterval(m,1e3);m();let T=6,u="accordian-clip",g="[accordian-view-more]";function y(n=T){let e=Array.from(document.querySelectorAll(g));e.length!==0&&e.forEach(t=>{let r=M(t);if(!r)return;let o=Array.from(r.querySelectorAll(`div[${u}]`));if(o.length===0){t.hidden=!0;return}o.sort((c,d)=>{let l=c.compareDocumentPosition(d);return l&Node.DOCUMENT_POSITION_FOLLOWING?-1:l&Node.DOCUMENT_POSITION_PRECEDING?1:0});let i={container:r,items:o,button:t,expanded:!1,visibleCount:n};if(t.setAttribute("aria-expanded","false"),t.setAttribute("type","button"),t.setAttribute("aria-controls",L(o)),o.length<=n){t.hidden=!0;return}f(i),t.addEventListener("click",()=>{i.expanded?f(i):w(i)})})}function f(n){let{items:e,button:t,visibleCount:r}=n;e.forEach((o,i)=>{o.hidden=i>=r}),t.textContent="View more",t.setAttribute("aria-expanded","false"),n.expanded=!1}function w(n){n.items.forEach(e=>e.hidden=!1),n.button.textContent="View less",n.button.setAttribute("aria-expanded","true"),n.expanded=!0}function M(n){let e=n.parentElement;for(;e&&e!==document.body;){if(e.querySelector(`div[${u}]`))return e;e=e.parentElement}return document.querySelector(`div[${u}]`)?document.body:null}function L(n){let e=[];return n.forEach((t,r)=>{t.id||(t.id=`wf-acc-item-${Math.random().toString(36).slice(2)}-${r}`),e.push(t.id)}),e.join(" ")}y()});})();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../bin/live-reload.js", "../../src/hacktimus/2025.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", "
|
|
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;AAAA,EAEP;;;
|
|
6
|
-
"names": []
|
|
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", "/* =========================================================\n Globals and setup\n========================================================= */\n\ndeclare const Swiper: any;\n\nconsole.log(\"Hacktimus 2025 script loaded.\");\n\nconst hasReducedMotion: boolean =\n window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n\n/* =========================================================\n DOMContentLoaded\n========================================================= */\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n /* =========================================================\n GSAP horizontal scroll (cards)\n ========================================================= */\n\n // Safely get gsap and ScrollTrigger from window\n const gsap = (window as any).gsap;\n const ScrollTrigger = (window as any).ScrollTrigger;\n\n if (gsap && ScrollTrigger) {\n gsap.registerPlugin(ScrollTrigger);\n\n const section = document.getElementById(\"h-scroll\");\n const viewport = document.getElementById(\"cardsViewport\");\n const track = document.getElementById(\"cardsTrack\");\n\n function setup(): void {\n // Kill previous triggers before re-init\n ScrollTrigger.getAll().forEach((st: any) => st.kill());\n\n if (!viewport || !track) return;\n\n const scrollDistance = track.scrollWidth - viewport.clientWidth;\n if (scrollDistance <= 0) return;\n\n gsap.set(track, { x: 0 });\n gsap.to(track, {\n x: -scrollDistance,\n ease: \"none\",\n scrollTrigger: {\n trigger: section || viewport,\n start: \"top top\",\n end: () => \"+=\" + scrollDistance,\n scrub: true,\n pin: true,\n anticipatePin: 1,\n invalidateOnRefresh: true,\n },\n });\n\n ScrollTrigger.addEventListener(\"refreshInit\", () => gsap.set(track, { x: 0 }));\n ScrollTrigger.refresh();\n }\n\n setup();\n\n let raf = 0;\n window.addEventListener(\"resize\", () => {\n if (raf) cancelAnimationFrame(raf);\n raf = requestAnimationFrame(() => setup());\n });\n } else {\n console.warn(\"GSAP or ScrollTrigger not found on window.\");\n }\n\n /* =========================================================\n Testimonials Swiper\n ========================================================= */\n\n // const testimonialsSwiper = new Swiper(\"[fynd-slider='testimonials']\", {\n // slidesPerView: 'auto',\n // spaceBetween: 20,\n // loop: true,\n // speed: 5000,\n // allowTouchMove: true,\n // grabCursor: true,\n // autoplay: hasReducedMotion\n // ? false\n // : { delay: 0 },\n // });\n\n /* =========================================================\n Incentive Swiper\n ========================================================= */\n\n // const incentiveSwiper = new Swiper(\"[fynd-slider='incentive']\", {\n // slidesPerView: 3,\n // spaceBetween: 20,\n // loop: false,\n // freeMode: true,\n // mousewheel: {\n // forceToAxis: true,\n // sensitivity: 1,\n // },\n // breakpoints: {\n // 992: { slidesPerView: 3 },\n // 768: { slidesPerView: 2.1 },\n // 640: { slidesPerView: 1.8 },\n // 0: { slidesPerView: 1.2 },\n // },\n // });\n\n /* =========================================================\n Simple countdown timer\n ========================================================= */\n\n const targetDate = new Date(\"2025-11-30T00:00:00Z\");\n\n function updateTimer(): void {\n const now = Date.now();\n const distance = targetDate.getTime() - now;\n\n if (distance <= 0) {\n document.querySelectorAll<HTMLElement>(\"[fynd-timer]\").forEach((el) => {\n el.textContent = \"00\";\n });\n clearInterval(timer);\n return;\n }\n\n const days = Math.floor(distance / (1000 * 60 * 60 * 24));\n const hours = Math.floor((distance / (1000 * 60 * 60)) % 24);\n const minutes = Math.floor((distance / (1000 * 60)) % 60);\n const seconds = Math.floor((distance / 1000) % 60);\n\n const setText = (attr: string, val: number) => {\n const el = document.querySelector<HTMLElement>(`[fynd-timer=${attr}]`);\n if (el) el.textContent = val.toString().padStart(2, \"0\");\n };\n\n setText(\"day\", days);\n setText(\"hour\", hours);\n setText(\"minute\", minutes);\n setText(\"second\", seconds);\n }\n\n const timer = setInterval(updateTimer, 1000);\n updateTimer();\n\n /* =========================================================\n Accordion view more\n ========================================================= */\n\n const VISIBLE_COUNT = 6;\n const ITEM_ATTR = \"accordian-clip\";\n const BUTTON_SELECTOR = \"[accordian-view-more]\";\n\n type Group = {\n container: HTMLElement;\n items: HTMLElement[];\n button: HTMLButtonElement;\n expanded: boolean;\n visibleCount: number;\n };\n\n function setupAccordionViewMore(visibleCount = VISIBLE_COUNT): void {\n const buttons = Array.from(\n document.querySelectorAll<HTMLButtonElement>(BUTTON_SELECTOR)\n );\n if (buttons.length === 0) return;\n\n buttons.forEach((button) => {\n const container = findContainerForButton(button);\n if (!container) return;\n\n const items = Array.from(\n container.querySelectorAll<HTMLElement>(`div[${ITEM_ATTR}]`)\n );\n\n if (items.length === 0) {\n button.hidden = true;\n return;\n }\n\n // Preserve DOM order\n items.sort((a, b) => {\n const pos = a.compareDocumentPosition(b);\n if (pos & Node.DOCUMENT_POSITION_FOLLOWING) return -1;\n if (pos & Node.DOCUMENT_POSITION_PRECEDING) return 1;\n return 0;\n });\n\n const group: Group = {\n container,\n items,\n button,\n expanded: false,\n visibleCount,\n };\n\n button.setAttribute(\"aria-expanded\", \"false\");\n button.setAttribute(\"type\", \"button\");\n button.setAttribute(\"aria-controls\", createAriaControlsFor(items));\n\n if (items.length <= visibleCount) {\n button.hidden = true;\n return;\n }\n\n applyCollapsed(group);\n\n button.addEventListener(\"click\", () => {\n if (group.expanded) applyCollapsed(group);\n else applyExpanded(group);\n });\n });\n }\n\n function applyCollapsed(group: Group): void {\n const { items, button, visibleCount } = group;\n items.forEach((el, i) => {\n el.hidden = i >= visibleCount;\n });\n button.textContent = \"View more\";\n button.setAttribute(\"aria-expanded\", \"false\");\n group.expanded = false;\n }\n\n function applyExpanded(group: Group): void {\n group.items.forEach((el) => (el.hidden = false));\n group.button.textContent = \"View less\";\n group.button.setAttribute(\"aria-expanded\", \"true\");\n group.expanded = true;\n }\n\n function findContainerForButton(button: HTMLElement): HTMLElement | null {\n let el: HTMLElement | null = button.parentElement;\n while (el && el !== document.body) {\n if (el.querySelector(`div[${ITEM_ATTR}]`)) return el;\n el = el.parentElement;\n }\n if (document.querySelector(`div[${ITEM_ATTR}]`)) return document.body;\n return null;\n }\n\n function createAriaControlsFor(els: HTMLElement[]): string {\n const ids: string[] = [];\n els.forEach((el, i) => {\n if (!el.id) el.id = `wf-acc-item-${Math.random().toString(36).slice(2)}-${i}`;\n ids.push(el.id);\n });\n return ids.join(\" \");\n }\n\n setupAccordionViewMore();\n});\n\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;AAAA,EAEP;;;ACJA,UAAQ,IAAI,+BAA+B;AAE3C,MAAM,mBACF,OAAO,WAAW,kCAAkC,EAAE;AAM1D,WAAS,iBAAiB,oBAAoB,MAAM;AAMhD,UAAM,OAAQ,OAAe;AAC7B,UAAM,gBAAiB,OAAe;AAEtC,QAAI,QAAQ,eAAe;AAOvB,UAASA,SAAT,WAAuB;AAEnB,sBAAc,OAAO,EAAE,QAAQ,CAAC,OAAY,GAAG,KAAK,CAAC;AAErD,YAAI,CAAC,YAAY,CAAC,MAAO;AAEzB,cAAM,iBAAiB,MAAM,cAAc,SAAS;AACpD,YAAI,kBAAkB,EAAG;AAEzB,aAAK,IAAI,OAAO,EAAE,GAAG,EAAE,CAAC;AACxB,aAAK,GAAG,OAAO;AAAA,UACX,GAAG,CAAC;AAAA,UACJ,MAAM;AAAA,UACN,eAAe;AAAA,YACX,SAAS,WAAW;AAAA,YACpB,OAAO;AAAA,YACP,KAAK,MAAM,OAAO;AAAA,YAClB,OAAO;AAAA,YACP,KAAK;AAAA,YACL,eAAe;AAAA,YACf,qBAAqB;AAAA,UACzB;AAAA,QACJ,CAAC;AAED,sBAAc,iBAAiB,eAAe,MAAM,KAAK,IAAI,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;AAC7E,sBAAc,QAAQ;AAAA,MAC1B;AA1BS,kBAAAA;AANT,WAAK,eAAe,aAAa;AAEjC,Y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B;AACvC,YAAM,MAAM,QAAQ,CAAC,OAAQ,GAAG,SAAS,KAAM;AAC/C,YAAM,OAAO,cAAc;AAC3B,YAAM,OAAO,aAAa,iBAAiB,MAAM;AACjD,YAAM,WAAW;AAAA,IACrB;AAEA,aAAS,uBAAuB,QAAyC;AACrE,UAAI,KAAyB,OAAO;AACpC,aAAO,MAAM,OAAO,SAAS,MAAM;AAC/B,YAAI,GAAG,cAAc,OAAO,SAAS,GAAG,EAAG,QAAO;AAClD,aAAK,GAAG;AAAA,MACZ;AACA,UAAI,SAAS,cAAc,OAAO,SAAS,GAAG,EAAG,QAAO,SAAS;AACjE,aAAO;AAAA,IACX;AAEA,aAAS,sBAAsB,KAA4B;AACvD,YAAM,MAAgB,CAAC;AACvB,UAAI,QAAQ,CAAC,IAAI,MAAM;AACnB,YAAI,CAAC,GAAG,GAAI,IAAG,KAAK,eAAe,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC;AAC3E,YAAI,KAAK,GAAG,EAAE;AAAA,MAClB,CAAC;AACD,aAAO,IAAI,KAAK,GAAG;AAAA,IACvB;AAEA,2BAAuB;AAAA,EAC3B,CAAC;",
|
|
6
|
+
"names": ["setup"]
|
|
7
7
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.section_incentive-scroll{height:100dvh}.cards-track{display:inline-flex!important;will-change:transform}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/hacktimus/styles.css"],
|
|
4
|
+
"sourcesContent": [".section_incentive-scroll{\n height: 100dvh;\n}\n\n .cards-track {\n display: inline-flex !important;\n will-change: transform;\n }\n\n\n"],
|
|
5
|
+
"mappings": ";AAAA,CAAC;AACG,UAAQ;AACZ;AAEE,CAAC;AACG,WAAS;AACT,eAAa;AACf;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED