{
"version": 3,
"sources": ["../../../views/pages/home.ts"],
"sourcesContent": ["// const btn_reserve = document.querySelector(\n// 'button.reserve'\n// ) as HTMLButtonElement\n\n// btn_reserve.addEventListener('click', function () {\n// const rem = 1\n\n// requestAnimationFrame(() => {\n// const px =\n// parseFloat(getComputedStyle(document.documentElement).fontSize) * rem\n// const rect = this.getBoundingClientRect()\n// const scrollAmount = rect.top + window.scrollY - px\n\n// window.scrollTo({\n// top: scrollAmount,\n// behavior: 'smooth',\n// })\n// })\n// })\n\nconst msg_bg_img = document.querySelector(\n 'section.message img'\n) as HTMLImageElement\nmsg_bg_img.style.filter = `opacity(${msg_bg_img.getAttribute('data-opacity')}%)`\n\nconst highlights = document.querySelector(\n 'section.highlights div.mobile'\n) as Element\nconst highlight_images = highlights.querySelectorAll('ul.images li')\nconst highlight_buttons = highlights.querySelectorAll('ul.nav li')\nconst caption = highlights.querySelector('p span.caption') as HTMLElement\n\nlet current_index = 0\nlet intervalId: number\n\nconst cycleHighlightImages = (index?: number) => {\n // If an index is provided, use it. Otherwise, use the current index.\n current_index = index !== undefined ? index : current_index\n\n // Hide all images\n highlight_images.forEach(item => {\n item.classList.remove('is-visible')\n // Remove 'selected' class from corresponding nav element\n const nav_el = document.querySelector(`[data-target=\"${item.id}\"]`)\n if (nav_el) nav_el.classList.remove('selected')\n })\n\n // Show the current image\n const current_image = highlight_images[current_index]\n current_image?.classList.add('is-visible')\n\n // Add 'selected' class to corresponding nav element\n const nav_el = document.querySelector(`[data-target=\"${current_image?.id}\"]`)\n if (nav_el) nav_el.classList.add('selected')\n\n // Update the caption\n const title = nav_el?.getAttribute('data-title') || ''\n const by = nav_el?.getAttribute('data-by') || ''\n\n if (title.length > 0 && by.length > 0) {\n caption.innerHTML = `${title} by ${by}`\n } else if (title.length > 0) {\n caption.innerHTML = `${title}`\n }\n\n // Increment the current index after displaying the image\n current_index = (current_index + 1) % highlight_images.length\n}\n\n// Start the cycle\nintervalId = setInterval(cycleHighlightImages, 7000)\n\n// Add click event listener to each button\nhighlight_buttons.forEach((button, index) => {\n button.addEventListener('click', _ => {\n // Clear the interval\n clearInterval(intervalId)\n\n // Call cycleHighlightImages with the index of the clicked button\n cycleHighlightImages(index)\n\n // Restart the interval\n intervalId = setInterval(cycleHighlightImages, 5000)\n })\n})\n"],
"mappings": "mBAoBA,IAAMA,EAAa,SAAS,cAC1B,qBACF,EACAA,EAAW,MAAM,OAAS,WAAWA,EAAW,aAAa,cAAc,CAAC,KAE5E,IAAMC,EAAa,SAAS,cAC1B,+BACF,EACMC,EAAmBD,EAAW,iBAAiB,cAAc,EAC7DE,EAAoBF,EAAW,iBAAiB,WAAW,EAC3DG,EAAUH,EAAW,cAAc,gBAAgB,EAErDI,EAAgB,EAChBC,EAEEC,EAAwBC,GAAmB,CAE/CH,EAAgBG,IAAU,OAAYA,EAAQH,EAG9CH,EAAiB,QAAQO,GAAQ,CAC/BA,EAAK,UAAU,OAAO,YAAY,EAElC,IAAMC,EAAS,SAAS,cAAc,iBAAiBD,EAAK,EAAE,IAAI,EAC9DC,GAAQA,EAAO,UAAU,OAAO,UAAU,CAChD,CAAC,EAGD,IAAMC,EAAgBT,EAAiBG,CAAa,EACpDM,GAAe,UAAU,IAAI,YAAY,EAGzC,IAAMD,EAAS,SAAS,cAAc,iBAAiBC,GAAe,EAAE,IAAI,EACxED,GAAQA,EAAO,UAAU,IAAI,UAAU,EAG3C,IAAME,EAAQF,GAAQ,aAAa,YAAY,GAAK,GAC9CG,EAAKH,GAAQ,aAAa,SAAS,GAAK,GAE1CE,EAAM,OAAS,GAAKC,EAAG,OAAS,EAClCT,EAAQ,UAAY,MAAMQ,CAAK,WAAWC,CAAE,GACnCD,EAAM,OAAS,IACxBR,EAAQ,UAAY,MAAMQ,CAAK,QAIjCP,GAAiBA,EAAgB,GAAKH,EAAiB,MACzD,EAGAI,EAAa,YAAYC,EAAsB,GAAI,EAGnDJ,EAAkB,QAAQ,CAACW,EAAQN,IAAU,CAC3CM,EAAO,iBAAiB,QAASC,GAAK,CAEpC,cAAcT,CAAU,EAGxBC,EAAqBC,CAAK,EAG1BF,EAAa,YAAYC,EAAsB,GAAI,CACrD,CAAC,CACH,CAAC",
"names": ["msg_bg_img", "highlights", "highlight_images", "highlight_buttons", "caption", "current_index", "intervalId", "cycleHighlightImages", "index", "item", "nav_el", "current_image", "title", "by", "button", "_"]
}