PageSourceSearch

https://www.eurotrek.ch/.resources/eurofun-v2-module/webresources/…/ContentTabContainerTalos-ODosII5J.js

js eurotrek.ch collected 2026-10-02 17:55:57 UTC 3,262 bytes, 1 lines download raw bytes

1import{B as d}from"./BaseComponent-CLVtauQr.js";const o=r=>new Promise(s=>setTimeout(s,r));class n extends d{static SELECTORS={tab:".content-tab-container__tab",tabsContainer:".content-tab-container__tabs",card:".content-tab-container__card-image",page:'[data-role="content-tab-container-pagination-bullet"]'};tabs;activeCard;activeCardIndex=0;tabsContainer;cards;pages;constructor(s,e={}){super(s,e)}run(){this.bind(),matchMedia("(max-width: 767px)").matches?this.initMobile():(this.initDesktop(),this.initTabs(),this.initPagination())}bind=()=>{this.tabs=Array.from(this.element.querySelectorAll(n.SELECTORS.tab)),this.tabsContainer=this.element.querySelector(n.SELECTORS.tabsContainer),this.cards=Array.from(this.element.querySelectorAll(n.SELECTORS.card)),this.pages=Array.from(this.element.querySelectorAll(n.SELECTORS.page))};scrollThroughImages=async s=>{if(s===0)return;const e=this.cards?.slice(0,this.activeCardIndex),t=this.cards?.slice(this.activeCardIndex,this.activeCardIndex+4),i=this.cards?.slice(this.activeCardIndex+4,this.cards?.length);for(let l=0;l<Math.abs(s);l++){if(s>0&&t&&t[0]){t[0].style.scale="1.05",t[0].style.top="80px",t[0].style.zIndex="-10",t[0].style.opacity="0",t&&t[1]&&(t[1].style.scale="1",t[1].style.top="48px",t[1].style.zIndex="0",t[1].style.opacity="1"),t&&t[2]&&(t[2].style.scale="0.95",t[2].style.top="32px",t[2].style.zIndex="-2",t[2].style.opacity="0.6"),t&&t[3]&&(t[3].style.scale="0.9",t[3].style.top="16px",t[3].style.zIndex="-3",t[3].style.opacity="0.4"),i&&i[0]&&(i[0].style.scale="0.85",i[0].style.top="0px",i[0].style.zIndex="-4",i[0].style.opacity="0.2"),this.activeCardIndex+=1;const a=t?.shift();a&&e?.push(a);const c=i?.shift();c&&t?.push(c)}if(s<0&&e&&e[e.length-1]){e[e.length-1].style.zIndex="0",e[e.length-1].style.scale="1",e[e.length-1].style.top="48px",e[e.length-1].style.opacity="1",t&&t&&t[0]&&(t[0].style.zIndex="-2",t[0].style.scale="0.95",t[0].style.top="32px",t[0].style.opacity="0.6"),t&&t[1]&&(t[1].style.zIndex="-3",t[1].style.scale="0.9",t[1].style.top="16px",t[1].style.opacity="0.4"),t&&t[2]&&(t[2].style.zIndex="-4",t[2].style.scale="0.85",t[2].style.top="0px",t[2].style.opacity="0.2"),t&&t[3]&&(t[3].style.zIndex="-5",t[3].style.scale="0",t[3].style.top="80px",t[3].style.opacity="0"),this.activeCardIndex-=1;const a=e?.pop();a&&t?.unshift(a);const c=i?.shift();c&&t?.push(c)}await o(50)}};initMobile=()=>{this.cards&&(this.activeCard=this.cards[0],this.activeCard?.classList.add("open"))};initDesktop=()=>{!this.tabs||this.cards};handleAccordionClick=s=>{this.pages?.[this.activeCardIndex].classList.remove("active");const e=Number(s.currentTarget.dataset.index);if(isNaN(e))return;const t=e-this.activeCardIndex;this.scrollThroughImages(t),this.pages?.[e].classList.add("active")};handlePageClick=s=>{this.pages?.[this.activeCardIndex].classList.remove("active");const e=s.currentTarget;e?.classList.add("active");const t=Number(e?.dataset.index);isNaN(t)||this.tabs?.[t].querySelector('[data-role="accordion-trigger"]')?.click()};initTabs=()=>{this.tabs?.forEach(s=>{s.addEventListener("click",this.handleAccordionClick)})};initPagination=()=>{this.pages?.forEach((s,e)=>{e===0&&s.classList.add("active"),s.addEventListener("click",this.handlePageClick)})}}export{n as default};

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.