PageSourceSearch

https://pierhotel.jp/wp/wp-content/cache/autoptimize/js/autoptimiz…0abf9ea974fa6ffc4491dcb0bef927.js?ver=1.0.0

js pierhotel.jp collected 2026-10-08 22:16:58 UTC 9,522 bytes, 8 lines download raw bytes

1"use strict";const setVh=()=>{document.documentElement.style.setProperty("--vh",`${window.innerHeight * 0.01}px`);};setVh();window.addEventListener("resize",setVh);const initLoading=()=>{const loading=document.getElementById("js-loading");const loadingLogo=document.getElementById("js-loading-logo");const loadingCatch=document.getElementById("js-loading-catch");const mvCarousel=document.getElementById("js-mv-carousel");const header=document.getElementById("js-header");const reservationBar=document.querySelector(".nav__reservation");if(!loading)return;if(sessionStorage.getItem("loadingShown")){loading.style.display="none";if(mvCarousel)mvCarousel.classList.add("is-visible");header.classList.add("is-visible");if(reservationBar)reservationBar.classList.add("is-visible");return;}
2sessionStorage.setItem("loadingShown","1");document.body.style.overflow="hidden";const startWipe=(el)=>{el.style.opacity="1";el.classList.add("is-wipe");el.addEventListener("animationend",()=>{el.style.webkitMaskImage="none";el.style.maskImage="none";},{once:true});};setTimeout(()=>startWipe(loadingLogo),400);setTimeout(()=>startWipe(loadingCatch),1600);setTimeout(()=>{loading.classList.add("is-fadeout");if(mvCarousel)mvCarousel.classList.add("is-visible");},2900);setTimeout(()=>{loading.style.display="none";document.body.style.overflow="";},3850);setTimeout(()=>{header.classList.add("is-visible");if(reservationBar)reservationBar.classList.add("is-visible");},3950);};const initMvCarousel=()=>{const slides=document.querySelectorAll(".mv__slide");if(!slides.length)return;let current=0;const goTo=(index)=>{slides[current].classList.remove("mv__slide--active");current=index;slides[current].classList.add("mv__slide--active");};setTimeout(()=>{setInterval(()=>{goTo((current+1)%slides.length);},3000);},5000);};const initHeaderScroll=()=>{const header=document.getElementById("js-header");const mv=document.querySelector(".mv");if(!header||!mv)return;const logoWhite=header.querySelector(".header__logo-img--white");const logoNavy=header.querySelector(".header__logo-img--navy");if(logoNavy)logoNavy.style.display="none";if(logoWhite)logoWhite.style.display="block";const onScroll=()=>{const scrollY=window.scrollY;const mvHeight=mv.offsetHeight;if(scrollY>=mvHeight){header.classList.add("is-scrolled");if(logoWhite)logoWhite.style.display="none";if(logoNavy)logoNavy.style.display="block";}else{header.classList.remove("is-scrolled");if(logoWhite)logoWhite.style.display="block";if(logoNavy)logoNavy.style.display="none";}};window.addEventListener("scroll",onScroll,{passive:true});};const initSpMenu=()=>{const hamburger=document.getElementById("js-hamburger");const spMenu=document.getElementById("js-sp-menu");const closeBtn=document.getElementById("js-sp-menu-close");if(!hamburger||!spMenu)return;const menuLinks=spMenu.querySelectorAll(".sp-menu__link");const openMenu=()=>{spMenu.classList.add("is-open");spMenu.setAttribute("aria-hidden","false");hamburger.setAttribute("aria-expanded","true");document.body.style.overflow="hidden";menuLinks.forEach((link,i)=>{link.style.animationDelay=`${0.08 + i * 0.07}s`;link.classList.add("is-animated");});};const closeMenu=()=>{spMenu.classList.remove("is-open");spMenu.setAttribute("aria-hidden","true");hamburger.setAttribute("aria-expanded","false");document.body.style.overflow="";menuLinks.forEach((link)=>link.classList.remove("is-animated"));};hamburger.addEventListener("click",openMenu);if(closeBtn)closeBtn.addEventListener("click",closeMenu);};const initFaqOverlap=()=>{const faqWrapper=document.getElementById("js-faq-wrapper");const hotelIntro=document.getElementById("js-hotel-intro");if(!faqWrapper||!hotelIntro)return;const setOverlap=()=>{const faqHeight=faqWrapper.offsetHeight;faqWrapper.style.marginTop=`-${faqHeight / 2}px`;hotelIntro.style.paddingBottom=`${faqHeight / 2 + 48}px`;};setOverlap();window.addEventListener("resize",setOverlap);};const initAboutWipe=()=>{const photoArea=document.querySelector(".about__photo-area");if(!photoArea)return;const observer=new IntersectionObserver((entries)=>{entries.forEach((entry)=>{if(entry.isIntersecting){photoArea.classList.add("is-wipe");photoArea.addEventListener("animationend",()=>{photoArea.style.webkitMaskImage="none";photoArea.style.maskImage="none";},{once:true});observer.disconnect();}});},{threshold:0.15});observer.observe(photoArea);};const initHeadingWipe=()=>{const targets=document.querySelectorAll(".about__heading, .news__heading, .page-title, .concept-intro__heading");if(!targets.length)return;const observer=new IntersectionObserver((entries)=>
2{entries.forEach((entry)=>{if(entry.isIntersecting){const el=entry.target;el.classList.add("is-wipe");el.addEventListener("animationend",()=>{el.style.webkitMaskImage="none";el.style.maskImage="none";},{once:true});observer.unobserve(el);}});},{threshold:0,rootMargin:"0px 0px -50px 0px"});targets.forEach((el)=>observer.observe(el));};const initRoomThumbs=()=>{const thumbBtns=document.querySelectorAll(".room-card__thumb");if(!thumbBtns.length)return;thumbBtns.forEach((btn)=>{btn.addEventListener("click",()=>{const targetId=btn.dataset.target;const mainImg=document.getElementById(targetId);if(!mainImg)return;mainImg.src=btn.querySelector("img").src;document.querySelectorAll(`[data-target="${targetId}"]`).forEach((b)=>{b.classList.remove("room-card__thumb--active");});btn.classList.add("room-card__thumb--active");});});};const initFaqAccordion=()=>{const accordion=document.getElementById("js-faq-accordion");if(!accordion)return;accordion.querySelectorAll(".faq-accordion__item").forEach((item)=>{const btn=item.querySelector(".faq-accordion__question");const answer=item.querySelector(".faq-accordion__answer");if(!btn||!answer)return;btn.addEventListener("click",()=>{const isOpen=item.classList.toggle("is-open");btn.setAttribute("aria-expanded",isOpen?"true":"false");answer.setAttribute("aria-hidden",isOpen?"false":"true");});});};const initConceptScroll=()=>{const conceptScroll=document.getElementById("js-concept-scroll");if(!conceptScroll)return;const bg=document.getElementById("js-concept-bg");const label=document.getElementById("js-concept-label");const bgImgs=bg.querySelectorAll(".concept-scroll__bg-img");const labelTexts=bg.querySelectorAll(".concept-scroll__label-text");const items=conceptScroll.querySelectorAll(".concept-scroll__item");const lastItem=conceptScroll.querySelector(".concept-scroll__item--last");let currentIndex=-1;let isFixed=false;let isUnfixed=false;let labelVisible=false;const switchTo=(index)=>{if(index===currentIndex)return;currentIndex=index;bgImgs.forEach((img,i)=>{img.classList.toggle("concept-scroll__bg-img--active",i===index);});
2labelTexts.forEach((lbl,i)=>{lbl.classList.toggle("is-active",i===index);});};const onScroll=()=>{const winH=window.innerHeight;const threshold=winH*0.1;const scrollRect=conceptScroll.getBoundingClientRect();if(!labelVisible&&scrollRect.top<winH){labelVisible=true;label.classList.add("is-label-visible");}
3if(labelVisible&&scrollRect.top>=winH){labelVisible=false;label.classList.remove("is-label-visible");}
4if(!isFixed&&!isUnfixed&&scrollRect.top<=0){isFixed=true;bg.classList.add("is-fixed");}
5if(isFixed&&!isUnfixed&&lastItem){const lastTextArea=lastItem.querySelector(".concept-scroll__text-area");const lastRect=(lastTextArea||lastItem).getBoundingClientRect();if(lastRect.top<=threshold){isUnfixed=true;bg.classList.remove("is-fixed");bg.style.top=`${-scrollRect.top}px`;const labelH=label.offsetHeight;label.style.position="absolute";label.style.top=`${winH - 10 - labelH}px`;label.style.bottom="auto";}}
6if(isUnfixed&&lastItem){const lastTextArea=lastItem.querySelector(".concept-scroll__text-area");const lastRect=(lastTextArea||lastItem).getBoundingClientRect();if(lastRect.top>threshold){isUnfixed=false;bg.style.top="";bg.classList.add("is-fixed");label.style.position="";label.style.top="";label.style.bottom="";}}
7if(isFixed&&!isUnfixed&&scrollRect.top>0){isFixed=false;bg.classList.remove("is-fixed");bg.style.top="0";}
8let activeIndex=0;items.forEach((item,i)=>{const textArea=item.querySelector(".concept-scroll__text-area");const rect=(textArea||item).getBoundingClientRect();if(rect.top<=threshold){activeIndex=Math.min(i+1,items.length-1);}});switchTo(activeIndex);};window.addEventListener("scroll",onScroll,{passive:true});onScroll();};const initReservationFloat=()=>{const btn=document.querySelector(".nav__reservation");const footer=document.querySelector(".footer");if(!btn||!footer)return;const onScroll=()=>{const footerTop=footer.getBoundingClientRect().top;const winH=window.innerHeight;if(footerTop<=winH){if(!btn.classList.contains("is-footer-reached")){btn.style.top=`${window.scrollY + footerTop - btn.offsetHeight}px`;btn.classList.add("is-footer-reached");}}else{if(btn.classList.contains("is-footer-reached")){btn.style.top="";btn.classList.remove("is-footer-reached");}}};window.addEventListener("scroll",onScroll,{passive:true});onScroll();};document.addEventListener("DOMContentLoaded",()=>{initLoading();initMvCarousel();initHeaderScroll();initSpMenu();initFaqOverlap();initFaqAccordion();initAboutWipe();initHeadingWipe();initRoomThumbs();initConceptScroll();initReservationFloat();const initCampaignAnim=()=>{const list=document.querySelector(".campaign__list");if(!list)return;const observer=new IntersectionObserver((entries)=>{entries.forEach((entry)=>{if(entry.isIntersecting){list.classList.add("is-visible");observer.disconnect();}});},{threshold:0.2});observer.observe(list);};initCampaignAnim();});

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.