PageSourceSearch

https://yokumoku.co.jp/cdn/shop/t/2/assets/js_collection_detail_gallery.js?v=18241660960651845351774261012

js yokumoku.co.jp collected 2026-10-03 19:25:21 UTC 4,518 bytes, 2 lines download raw bytes

1(function($){function initCollectionDetailGallery(){var $page=$(".page-collection-detail");if(!$page.length)return;var $slider=$page.find(".p-gallery__slider").first(),$thumbItems=$slider.find(".p-gallery__slider__thumb .item"),$mainGallery=$slider.find(".p-gallery__slider__main"),$modal=$("#collection-modal-gallery"),maxVisible=8;if(!$slider.length||!$thumbItems.length||!$modal.length)return;if($thumbItems.length>maxVisible){var $eighthItem=$thumbItems.eq(maxVisible-1),remainingCount=$thumbItems.length-maxVisible;$thumbItems.slice(maxVisible).hide(),$eighthItem.find(".p-gallery__thumb-overlay").length||$eighthItem.append('<div class="p-gallery__thumb-overlay js-gallery-overlay">+'+remainingCount+"</div>")}function getSlidesData(){var slides=[];return $mainGallery.find(".p-gallery__main-item").each(function(index){var $item=$(this),$img=$item.find("img").first(),src=$img.attr("src")||"";src&&slides.push({index:index,fullSrc:src,thumbSrc:src,alt:$img.attr("alt")||"Collection image "+(index+1),mediaType:$item.attr("data-media-type")||"image",videoSrc:$item.attr("data-video-src")||"",poster:$item.attr("data-poster")||src})}),slides}function getModalItems(){return $modal.find(".js-collection-gallery-grid .collection-modal__gallery-item")}function renderModalGrid(activeIndex){var slides=getSlidesData(),$grid=$modal.find(".js-collection-gallery-grid");$grid.length&&($grid.empty(),$.each(slides,function(_,slide){var activeClass=slide.index===activeIndex?" collection-modal__gallery-item--active":"",playButtonSrc=$thumbItems.eq(slide.index).find("img").first().attr("data-play-button-src")||"",$item=$('<div class="collection-modal__gallery-item'+activeClass+'" data-index="'+slide.index+'"><img src="'+slide.thumbSrc+'" data-full="'+slide.fullSrc+'" data-media-type="'+slide.mediaType+'" data-video-src="'+slide.videoSrc+'" data-poster="'+slide.poster+'" alt="'+slide.alt+'"></div>');slide.mediaType==="video"&&playButtonSrc&&$item.append('<span class="c-modal__gallery-thumb-play" aria-hidden="true"><img src="'+playButtonSrc+'" alt=""></span>'),$grid.append($item)}))}function getSlideData(index){var slides=getSlidesData();return slides[index]||null}function setModalMain(index){var slide=getSlideData(index);if(!(!slide||!slide.fullSrc)){var $main=$modal.find(".c-modal__gallery-main");$main.find("video").remove(),$main.find(".js-collection-gallery-main-image").removeClass("hidden");var $image=$modal.find(".js-collection-gallery-main-image").attr("src",slide.fullSrc).attr("alt",slide.alt||"Collection image "+(index+1));$modal.find(".js-collection-gallery-placeholder").addClass("hidden"),slide.mediaType==="video"&&slide.videoSrc&&($image.addClass("hidden"),$main.append('<video class="js-collection-gallery-main-video" controls autoplay playsinline poster="'+slide.poster+'"><source src="'+slide.videoSrc+'" type="video/mp4"></video>'))}}function setActiveModalItem(index){var $modalItems=getModalItems();$modalItems.removeClass("collection-modal__gallery-item--active"),$modalItems.eq(index).addClass("collection-modal__gallery-item--active")}function openModal(index){var safeIndex=Math.max(0,Math.min(index,$thumbItems.length-1));renderModalGrid(safeIndex),setModalMain(safeIndex),setActiveModalItem(safeIndex),$modal.addClass("is-active").attr("aria-hidden","false"),$("body").css("overflow","hidden")}$mainGallery.off("click.collectionDetailModal").on("click.collectionDetailModal",function(event){event.preventDefault();var currentIndex=0;$mainGallery.hasClass("slick-initialized")&&(currentIndex=$mainGallery.slick("slickCurrentSlide")),openModal(currentIndex)}),$slider.off("click.collectionDetailModalOverlay",".js-gallery-overlay").on("click.collectionDetailModalOverlay",".js-gallery-overlay",function(event){event.preventDefault(),event.stopPropagation(),openModal(0)}),$(document).off("click.collectionDetailModalItem","#collection-modal-gallery .js-collection-gallery-grid .collection-modal__gallery-item").on("click.collectionDetailModalItem","#collection-modal-gallery .js-collection-gallery-grid .collection-modal__gallery-item",function(event){event.preventDefault(),event.stopImmediatePropagation();var index=Number($(this).attr("data-index"));Number.isNaN(index)&&(index=$(this).index()),setModalMain(index),setActiveModalItem(index),$mainGallery.hasClass("slick-initialized")&&$mainGallery.slick("slickGoTo",index)})}$(initCollectionDetailGallery)})(jQuery);
2//# sourceMappingURL=/cdn/shop/t/2/assets/js_collection_detail_gallery.js.map?v=18241660960651845351774261012

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.