PageSourceSearch

https://www.swissdeluxehotels.com/sb/master.js.ve70718112e6c1b8a2814a4512e6524c2de0b2058

js swissdeluxehotels.com collected 2026-10-02 16:27:28 UTC 3,438 bytes, 32 lines download raw bytes

1class Fade{static in(el){el.style.display='block';return el.animate([{opacity:0},{opacity:1}],{duration:300,});}
2static out(el){const anim=el.animate([{opacity:1},{opacity:0}],{duration:300,});anim.finished.then(()=>{el.style.display='';});return anim;}};;
3class Menu{MENU_OPEN_CLASS='menu-open';constructor(){this.triggers=document.querySelectorAll('[data-toggle-menu]');this.isOpen=false;this._attachEvents();}
4get isOpen(){return this._isOpen??false;}
5set isOpen(isOpen){this._isOpen=isOpen;document.documentElement.classList.toggle(this.MENU_OPEN_CLASS,isOpen);}
6_attachEvents(){this.triggers.forEach(trigger=>{trigger.addEventListener('click',this._handleTriggerClick.bind(this));});}
7_handleTriggerClick(e){if(!e.currentTarget)return;const targetSelector=e.currentTarget.dataset.toggleMenu;const target=document.querySelector(targetSelector);if(!target)return;this._toggle(target);}
8_toggle(el){return this.isOpen?this._close(el):this._open(el);}
9_open(el){const anim=Fade.in(el);anim.finished.then(()=>{this.isOpen=true;});return anim;}
10_close(el){const anim=Fade.out(el);anim.finished.then(()=>{this.isOpen=false;});return anim;}}
11window.Menu=Menu;;;
12class PopupMenu{constructor(trigger){this.trigger=trigger;this.popup=document.querySelector(this.trigger.dataset.togglePopupMenu);this.isOpen=false;this._attachEvents();}
13_attachEvents(){this.trigger.addEventListener('click',this._toggle.bind(this));document.addEventListener('click',this._handleOutsideClick.bind(this));}
14_handleOutsideClick(e){if(!e.target)return;const hasClickedOnPopup=e.target.closest(this.trigger.dataset.togglePopupMenu);if(!hasClickedOnPopup&&this.isOpen)this._close();}
15_toggle(){return this.isOpen?this._close():this._open();}
16_open(){const anim=Fade.in(this.popup);anim.finished.then(()=>{this.isOpen=true;});return anim;}
17_close(){const anim=Fade.out(this.popup);anim.finished.then(()=>{this.isOpen=false;});return anim;}}
18window.PopupMenu=PopupMenu;;;
19class BackLink{static onClick(clickedLink){const clickedUrl=new URL(clickedLink.href);if(document.referrer.startsWith(clickedUrl.href.replace(/\/+$/,''))){history.back();return false;}
20return true;}};;
21class ContentNav{constructor(nav){this.nav=nav;this.links=nav.querySelectorAll('a');this.hero=document.querySelector('.hero');this._hideUnusedLinks();this._attachEvents();}
22_hideUnusedLinks(){this.links.forEach(link=>{if(!link.href.includes('#'))return;const referencedEl=document.querySelector(`#${link.href.split('#')[1]}`);if(!referencedEl)link.parentElement.style.display='none';});}
23_attachEvents(){window.addEventListener('scroll',this._onScroll.bind(this));}
24_onScroll(){if(this.hero){const headerHeight=parseInt(getComputedStyle(document.documentElement).getPropertyValue('--header-height'),10)||0;document.documentElement.classList.toggle('content-nav-sticky',window.scrollY>this.hero.clientHeight-headerHeight);}}}
25window.ContentNav=ContentNav;;;
26class Header{STICKY_CLASS_NAME='header-sticky';STICK_THRESHOLD=0;constructor(){this._attachEvents();this._handleScroll();}
27get isSticky(){return this._isSticky??false;}
28set isSticky(isSticky){this._isSticky=isSticky;document.documentElement.classList.toggle(this.STICKY_CLASS_NAME,isSticky);}
29_attachEvents(){window.addEventListener('scroll',this._handleScroll.bind(this));}
30_handleScroll(){this.isSticky=this._shouldStick();}
31_shouldStick(){return window.scrollY>this.STICK_THRESHOLD;}}
32window.Header=Header;;;

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.