PageSourceSearch

https://momi.baby/cdn/shop/t/147/assets/custom.js?v=48385447228924455991782913941

js momi.baby collected 2026-10-07 16:51:37 UTC 6,448 bytes, 2 lines download raw bytes

1document.addEventListener("DOMContentLoaded",()=>{var customSection=document.querySelectorAll(".shopify-section--press");customSection.forEach((section,index)=>{var customDots=section.querySelector(".custom-page-dots"),pressCarousel=section.querySelector("press-carousel"),customTap=customDots.querySelectorAll(".tap-area"),pressImg=pressCarousel.querySelectorAll(".press__list-item"),autoSliderInterval,startX,endX;function startAutoSlider(){stopAutoSlider(),autoSliderInterval=setInterval(()=>{let currentSelectedIndex=Array.from(pressImg).findIndex(item=>item.classList.contains("is-selected")),nextIndex=(currentSelectedIndex+1)%pressImg.length;updateSelection(currentSelectedIndex,nextIndex)},4500)}function stopAutoSlider(){clearInterval(autoSliderInterval)}function updateSelection(currentIndex,nextIndex){currentIndex===-1||pressImg.length===0||(pressImg[currentIndex].classList.remove("is-selected"),pressImg[currentIndex].setAttribute("aria-current","false"),customTap[currentIndex].setAttribute("aria-current","false"),pressImg[nextIndex].classList.add("is-selected"),pressImg[nextIndex].setAttribute("aria-current","true"),customTap[nextIndex].setAttribute("aria-current","true"))}pressCarousel.addEventListener("touchstart",function(e){startX=e.touches[0].clientX}),pressCarousel.addEventListener("touchend",function(e){endX=e.changedTouches[0].clientX;let diffX=startX-endX;if(diffX>50){let currentSelectedIndex=Array.from(pressImg).findIndex(item=>item.classList.contains("is-selected")),nextIndex=(currentSelectedIndex+1)%pressImg.length;updateSelection(currentSelectedIndex,nextIndex)}else if(diffX<-50){let currentSelectedIndex=Array.from(pressImg).findIndex(item=>item.classList.contains("is-selected")),prevIndex=(currentSelectedIndex-1+pressImg.length)%pressImg.length;updateSelection(currentSelectedIndex,prevIndex)}}),customTap.forEach((item,index2)=>{item.addEventListener("click",()=>{console.log("click working"),stopAutoSlider();let currentSelectedIndex=Array.from(pressImg).findIndex(item2=>item2.classList.contains("is-selected"));updateSelection(currentSelectedIndex,index2),setTimeout(startAutoSlider,6e5)})})})}),document.addEventListener("DOMContentLoaded",async()=>{let nextBtn=document.querySelector("#main_slider_next_btn"),prevBtn=document.querySelector("#main_slider_prev_btn");prevBtn&&(prevBtn.disabled=!0),nextBtn&&nextBtn.addEventListener("click",async()=>{await pageDots("next"),updateButtonState()}),prevBtn&&prevBtn.addEventListener("click",async()=>{await pageDots("prev"),updateButtonState()});const pageDots=async direction=>{let iconSelect=document.querySelector(".page-dots");if(iconSelect){let tapArea=iconSelect.querySelectorAll(".tap-area"),currentIndex=-1;tapArea.forEach((item,index)=>{item.getAttribute("aria-current")==="true"&&(currentIndex=index,item.setAttribute("aria-current","false"))});let nextIndex;direction==="next"?nextIndex=currentIndex>=0&&currentIndex<tapArea.length-1?currentIndex+1:tapArea.length>0?0:-1:direction==="prev"&&(nextIndex=currentIndex>0?currentIndex-1:tapArea.length>0?tapArea.length-1:-1);let targetItem=tapArea[nextIndex];targetItem&&(targetItem.click(),targetItem.setAttribute("aria-current","true"))}},updateButtonState=()=>{let iconSelect=document.querySelector(".page-dots");if(iconSelect){let tapArea=iconSelect.querySelectorAll(".tap-area"),currentIndex=-1;tapArea.forEach((item,index)=>{item.getAttribute("aria-current")==="true"&&(currentIndex=index)}),prevBtn&&(prevBtn.disabled=currentIndex<=0),nextBtn&&(nextBtn.disabled=currentIndex>=tapArea.length-1)}}}),document.addEventListener("DOMContentLoaded",()=>{let videoTag=document.querySelectorAll("video-media");const observer=new IntersectionObserver(entries=>{entries.forEach(entry=>{entry.target.classList.toggle("show",entry.isIntersecting),entry.isIntersecting?entry.target.play():entry.target.pause()})},{threshold:1});videoTag.forEach(videoItem=>{observer.observe(videoItem)})}),document.addEventListener("DOMContentLoaded",()=>{const iframes=document.querySelectorAll("iframe"),observer=new IntersectionObserver(entries=>{entries.forEach(entry=>{const iframe=entry.target;if(iframe.src.includes("player.vimeo.com")){const vimeoPlayer=new Vimeo.Player(iframe);entry.isIntersecting?vimeoPlayer.play().then(()=>{console.log("Video is playing.")}).catch(error=>{console.error("Error playing the video:",error)}):vimeoPlayer.pause().then(()=>{}).catch(error=>{console.error("Error pausing the video:",error)})}})},{threshold:1});
1iframes.forEach(iframe=>{observer.observe(iframe)})}),document.addEventListener("DOMContentLoaded",event=>{if(document.body.classList.contains("template--product")){let checkForDisabled2=function(keyVal){document.querySelectorAll("[data-group-item].active").length>1&&(document.querySelectorAll("[data-group-item].disabled").forEach(i=>{i.classList.remove("disabled")}),document.querySelectorAll(".pro-group-element")[1].querySelectorAll("[data-group-item]").forEach(cfdisableItem=>{let key=`${keyVal}_${cfdisableItem.dataset.value}`;console.log("key",key),groupingProductsURLArr[key]==null&&cfdisableItem.classList.add("disabled")}))};var checkForDisabled=checkForDisabled2;console.log("DOM fully loaded and parsed");let groupItemsArr=document.querySelectorAll("[data-group-item]");console.log("groupItemsArr",groupItemsArr),document.querySelector("[data-group-item].active")&&checkForDisabled2(document.querySelector("[data-group-item].active").dataset.value),groupItemsArr.forEach(item=>{item.addEventListener("click",function(e){if(e.preventDefault(),item.classList.contains("active"))return;console.log("group item clicked",groupingProductsURLArr),checkForDisabled2(this.dataset.value),this.closest(".pro-group-item-list").querySelector("[data-group-item].active").classList.remove("active"),this.classList.add("active"),this.closest(".pro-group-element").querySelector(".pro-group-ele-label span").innerHTML=this.dataset.label;let url="";document.querySelectorAll("[data-group-item].active").forEach((activeItem,index)=>{index==document.querySelectorAll("[data-group-item].active").length-1&&document.querySelectorAll("[data-group-item].active").length>1?url+=`${activeItem.dataset.value}`:url+=`${activeItem.dataset.value}_`}),url!=""&&groupingProductsURLArr[url]!=null&&location.pathname!=groupingProductsURLArr[url]&&(location.href=groupingProductsURLArr[url])})})}});
2//# sourceMappingURL=/cdn/shop/t/147/assets/custom.js.map?v=48385447228924455991782913941

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.