PageSourceSearch

https://rodhouse.com/cdn/shop/t/82/assets/blocks-videos-vertical.js?v=68778636307793762861781014707

js rodhouse.com collected 2026-10-10 00:14:24 UTC 5,185 bytes, 2 lines download raw bytes

1(function(){let isDragging=!1,startX=0,scrollLeft=0,currentCarousel=null,hasDragged=!1;function handleMouseDown(e){if(e.target.closest("[data-play-button]"))return;const carousel=e.target.closest("[data-video-carousel]");carousel&&(isDragging=!0,hasDragged=!1,currentCarousel=carousel,startX=e.pageX-carousel.offsetLeft,scrollLeft=carousel.scrollLeft,carousel.classList.add("is-dragging"),e.preventDefault())}function handleMouseMove(e){if(!isDragging||!currentCarousel)return;e.preventDefault();const distance=e.pageX-currentCarousel.offsetLeft-startX;Math.abs(distance)>5&&(hasDragged=!0),currentCarousel.scrollLeft=scrollLeft-distance}function handleMouseUp(){currentCarousel&&(isDragging=!1,currentCarousel.classList.remove("is-dragging"),hasDragged&&setTimeout(()=>{hasDragged=!1},100),currentCarousel=null)}function handleClick(e){if(hasDragged&&!e.target.closest("[data-play-button]"))return e.preventDefault(),e.stopPropagation(),!1}document.addEventListener("mousedown",handleMouseDown),document.addEventListener("mousemove",handleMouseMove),document.addEventListener("mouseup",handleMouseUp),document.addEventListener("click",handleClick,!0)})();class VideosVertical{constructor(container){this.container=container,this.carousel=container.querySelector("[data-video-carousel]"),this.prevBtn=container.querySelector("[data-video-prev]"),this.nextBtn=container.querySelector("[data-video-next]"),this.cards=Array.from(container.querySelectorAll("[data-video-card]")),this.carousel&&this.init()}init(){this.updateCardSizes(),window.addEventListener("resize",()=>this.updateCardSizes()),this.prevBtn&&this.prevBtn.addEventListener("click",()=>this.navigate("prev")),this.nextBtn&&this.nextBtn.addEventListener("click",()=>this.navigate("next")),this.carousel.addEventListener("scroll",()=>this.updateNavigationButtons()),this.initPlayButtons(),this.updateNavigationButtons(),new MutationObserver(()=>{this.cards=Array.from(this.container.querySelectorAll("[data-video-card]")),this.updateCardSizes(),this.initPlayButtons()}).observe(this.carousel,{childList:!0})}updateCardSizes(){const containerStyles=getComputedStyle(this.container),cardsPerView=parseFloat(containerStyles.getPropertyValue("--cards-per-view"))||4,cardGap=parseFloat(containerStyles.getPropertyValue("--card-gap"))||16,overflowExtension=parseFloat(containerStyles.getPropertyValue("--overflow-extension"))||0,effectiveWidth=this.carousel.offsetWidth-overflowExtension,totalGapSpace=cardGap*(cardsPerView-1),cardWidth=(effectiveWidth-totalGapSpace)/cardsPerView;this.carousel.style.setProperty("--card-width",`${cardWidth}px`)}navigate(direction){const cardWidth=this.cards[0]?.offsetWidth||0,gap=parseInt(getComputedStyle(this.container).getPropertyValue("--card-gap"))||16,scrollAmount=cardWidth+gap;direction==="prev"?this.carousel.scrollBy({left:-scrollAmount,behavior:"smooth"}):this.carousel.scrollBy({left:scrollAmount,behavior:"smooth"})}updateNavigationButtons(){if(!this.prevBtn||!this.nextBtn)return;const{scrollLeft,scrollWidth,clientWidth}=this.carousel,isAtStart=scrollLeft<=10,isAtEnd=scrollLeft+clientWidth>=scrollWidth-10;this.prevBtn.classList.toggle("is-hidden",isAtStart),this.nextBtn.classList.toggle("is-hidden",isAtEnd)}initPlayButtons(){this.cards.forEach(card=>{if(card.dataset.initialized)return;card.dataset.initialized="true";const playButton=card.querySelector("[data-play-button]"),video=card.querySelector("[data-video]"),wrapper=card.querySelector("[data-video-wrapper]");if(!video||!wrapper)return;const showControls=video.dataset.showControls==="true",isIframe=video.tagName==="IFRAME",playVideo=e=>{e.preventDefault(),e.stopPropagation(),card.classList.add("is-playing"),isIframe?video.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}',"*"):(showControls&&(video.controls=!0),video.play().catch(err=>console.error("Play prevented:",err)))};playButton&&playButton.addEventListener("click",playVideo),isIframe||(video.addEventListener("pause",()=>{video.currentTime===0&&(card.classList.remove("is-playing"),showControls&&(video.controls=!1))}),video.addEventListener("ended",()=>{card.classList.remove("is-playing"),video.currentTime=0,showControls&&(video.controls=!1)}))})}}function initializeVideosVertical(){document.querySelectorAll("[data-vi
1deos-vertical]").forEach(container=>new VideosVertical(container))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",initializeVideosVertical):initializeVideosVertical(),document.addEventListener("shopify:section:load",e=>{const container=e.target.querySelector("[data-videos-vertical]");container&&new VideosVertical(container)}),document.addEventListener("shopify:block:select",e=>{if(e.target.closest("[data-videos-vertical]")){const videoCard=e.target.closest("[data-video-card]");videoCard&&videoCard.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})}}),document.addEventListener("shopify:block:load",e=>{const container=e.target.closest("[data-videos-vertical]");container&&setTimeout(()=>{new VideosVertical(container).updateCardSizes()},100)});
2//# sourceMappingURL=/cdn/shop/t/82/assets/blocks-videos-vertical.js.map?v=68778636307793762861781014707

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.