PageSourceSearch

https://altyor.com/wp-content/cache/autoptimize/js/autoptimize_single_3060a80f5d1e449a7f77dc4d5da070f6.js

js altyor.com collected 2026-10-10 02:21:06 UTC 10,206 bytes, 25 lines download raw bytes

1(function(){'use strict';function initFrise(){var track=document.getElementById('altyor-frise-track');var panel=document.getElementById('altyor-frise-panel');if(!track||!panel)return;var N=parseInt(panel.dataset.steps||'5',10);var active=-1;var tabs=panel.querySelectorAll('.altyor-hp-frise__tab');var steps=panel.querySelectorAll('.altyor-hp-frise__step');var photos=document.querySelectorAll('.altyor-hp-frise__photo-wrap');function setStep(idx){if(idx===active)return;active=idx;tabs.forEach(function(t,i){t.classList.toggle('is-active',i===idx);});steps.forEach(function(s,i){s.classList.toggle('is-active',i===idx);});photos.forEach(function(p,i){p.classList.toggle('is-active',i===idx);});var tab=tabs[idx];if(tab){panel.style.setProperty('--frise-bg',tab.dataset.bg||'#EDC8A3');panel.style.setProperty('--frise-fg',tab.dataset.fg||'#0F0F0F');if(tab.dataset.dk){panel.setAttribute('data-dk','1');}
2else{panel.removeAttribute('data-dk');}}}
3var raf=0;function compute(){var r=track.getBoundingClientRect();var vh=window.innerHeight||800;var total=r.height-vh;var prog=total>0?Math.min(1,Math.max(0,-r.top/total)):0;setStep(Math.min(N-1,Math.max(0,Math.round(prog*(N-1)))));}
4window.addEventListener('scroll',function(){if(!raf)raf=requestAnimationFrame(function(){compute();raf=0;});},{passive:true});window.addEventListener('resize',compute,{passive:true});tabs.forEach(function(tab,i){tab.addEventListener('click',function(){var r=track.getBoundingClientRect();var vh=window.innerHeight||800;var total=r.height-vh;window.scrollTo({top:window.scrollY+r.top+(i/(N-1))*total+2,behavior:'smooth'});});});setStep(0);}
5function initVerbatim(){var slider=document.querySelector('.altyor-hp-verbatim');if(!slider)return;var items=slider.querySelectorAll('.altyor-hp-verbatim__item');var dots=slider.querySelectorAll('.altyor-hp-verbatim__dot');var count=slider.querySelector('.altyor-hp-verbatim__count');var prev=slider.querySelector('[data-verbatim-prev]');var next=slider.querySelector('[data-verbatim-next]');var n=items.length;if(!n)return;var cur=0;var paused=false;var timer;function goTo(idx){items[cur].classList.remove('is-active');if(dots[cur])dots[cur].classList.remove('is-active');cur=(idx+n)%n;items[cur].classList.add('is-active');if(dots[cur])dots[cur].classList.add('is-active');if(count)count.textContent=String(cur+1).padStart(2,'0')+' / '+String(n).padStart(2,'0');}
6function tick(){clearTimeout(timer);if(!paused)timer=setTimeout(function(){goTo(cur+1);tick();},6000);}
7slider.addEventListener('mouseenter',function(){paused=true;clearTimeout(timer);});slider.addEventListener('mouseleave',function(){paused=false;tick();});if(prev)prev.addEventListener('click',function(){goTo(cur-1);tick();});if(next)next.addEventListener('click',function(){goTo(cur+1);tick();});dots.forEach(function(d,i){d.addEventListener('click',function(){goTo(i);tick();});});goTo(0);tick();}
8function initStickyOffset(){if(!document.querySelector('[data-altyor-sticky]'))return;var root=document.documentElement;var lastTop=-1;function fixedBottom(el){if(!el)return 0;var pos=getComputedStyle(el).position;if(pos!=='fixed'&&pos!=='sticky')return 0;var r=el.getBoundingClientRect();return r.bottom>0?r.bottom:0;}
9function offsets(){var top=Math.round(Math.max(fixedBottom(document.getElementById('mysticky-nav')),fixedBottom(document.querySelector('header.header')),fixedBottom(document.getElementById('wpadminbar'))));if(top!==lastTop){lastTop=top;root.style.setProperty('--altyor-sticky-top',top+'px');}}
10var raf=0;offsets();window.addEventListener('scroll',function(){if(!raf)raf=requestAnimationFrame(function(){offsets();raf=0;});},{passive:true});window.addEventListener('resize',offsets,{passive:true});document.addEventListener('transitionend',function(e){if(e.target&&e.target.id==='mysticky-nav')offsets();});}
11function initExpToc(){var wrap=document.querySelector('.altyor-xp-toc-wrap');var toc=wrap&&wrap.querySelector('.altyor-xp-toc');var links=wrap?wrap.querySelectorAll('.altyor-xp-toc__link'):[];if(!links.length)return;var root=document.documentElement;function height(){root.style.setProperty('--xp-toc-h',wrap.offsetHeight+'px');}
12height();window.addEventListener('resize',height,{passive:true});function setActive(id){links.forEach(function(a){var on=a.getAttribute('href')==='#'+id;a.classList.toggle('is-active',on);if(on){a.setAttribute('aria-current','true');
12if(toc.scrollWidth>toc.clientWidth){toc.scrollTo({left:a.offsetLeft-12,behavior:'smooth'});}}else{a.removeAttribute('aria-current');}});}
13if(!('IntersectionObserver'in window))return;var io=new IntersectionObserver(function(entries){entries.forEach(function(e){if(e.isIntersecting)setActive(e.target.id);});},{rootMargin:'-45% 0px -45% 0px'});document.querySelectorAll('.altyor-xp-block').forEach(function(b){io.observe(b);});}
14function initBlog(){var list=document.querySelector('.altyor-blog-list[data-ajax]');var results=list&&list.querySelector('.altyor-blog-results');if(!results||!window.fetch||!window.FormData)return;list.classList.add('is-js');var pills=list.querySelectorAll('.altyor-blog-pill');var current=parseInt(list.dataset.cat||'0',10);var ctrl=null;function setPills(cat){pills.forEach(function(p){var on=parseInt(p.dataset.cat,10)===cat;p.classList.toggle('is-active',on);if(on)p.setAttribute('aria-current','true');else p.removeAttribute('aria-current');});}
15function request(cat,page){if(ctrl&&ctrl.abort)ctrl.abort();ctrl=window.AbortController?new AbortController():null;var body=new FormData();body.append('action','altyor_blog_filter');body.append('cat',cat);body.append('page',page);body.append('lang',list.dataset.lang||'');return fetch(list.dataset.ajax,{method:'POST',body:body,credentials:'same-origin',signal:ctrl?ctrl.signal:undefined}).then(function(r){if(!r.ok)throw new Error(r.status);return r.json();}).then(function(json){if(!json||!json.success)throw new Error('ajax');return json.data;});}
16function filter(cat,push){current=cat;setPills(cat);results.setAttribute('aria-busy','true');request(cat,1).then(function(data){results.innerHTML=data.html;results.removeAttribute('aria-busy');if(push)history.pushState({altyorCat:cat},'',data.url);var top=list.getBoundingClientRect().top+window.pageYOffset
17-(parseInt(getComputedStyle(document.documentElement).getPropertyValue('--altyor-sticky-top'),10)||0);if(window.pageYOffset>top)window.scrollTo({top:top,behavior:'smooth'});}).catch(function(e){if(e&&e.name==='AbortError')return;results.removeAttribute('aria-busy');});}
18list.addEventListener('click',function(e){var pill=e.target.closest('a[data-cat]');if(pill&&list.hasAttribute('data-archive'))return;if(pill&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey){e.preventDefault();var cat=parseInt(pill.dataset.cat,10)||0;if(cat!==current||results.querySelector('.altyor-blog-empty'))filter(cat,true);return;}
19var more=e.target.closest('[data-blog-more]');if(!more||more.getAttribute('aria-busy')==='true')return;var label=more.textContent;more.setAttribute('aria-busy','true');more.textContent=more.dataset.loading||'…';request(parseInt(more.dataset.cat,10)||0,parseInt(more.dataset.page,10)||2).then(function(data){var tmp=document.createElement('div');tmp.innerHTML=data.html;var grid=results.querySelector('.altyor-blog-grid');var first=null;tmp.querySelectorAll('.altyor-blog-grid > .altyor-blog-card').forEach(function(c){grid.appendChild(c);if(!first)first=c;});grid.hidden=false;if(first)first.focus({preventScroll:true});var oldMore=results.querySelector('.altyor-blog-more');var newMore=tmp.querySelector('.altyor-blog-more');if(oldMore&&newMore&&newMore.querySelector('[data-blog-more]'))oldMore.replaceWith(newMore);else if(oldMore)oldMore.remove();}).catch(function(e){if(e&&e.name==='AbortError')return;more.textContent=label;more.removeAttribute('aria-busy');});});history.replaceState({altyorCat:current},'');window.addEventListener('popstate',function(e){if(e.state&&typeof e.state.altyorCat==='number')filter(e.state.altyorCat,false);});}
20function initXpd(){var sec=document.querySelector('[data-xpd-savoir]');if(sec&&'IntersectionObserver'in window){var items=sec.querySelectorAll('.altyor-xpd-savoir__item');var imgs=sec.querySelectorAll('.altyor-xpd-savoir__img');var bars=sec.querySelectorAll('.altyor-xpd-savoir__bars span');var cap=sec.querySelector('.altyor-xpd-savoir__cap');var prev=sec.querySelector('[data-dir="-1"]');var next=sec.querySelector('[data-dir="1"]');var cur=0;function set(i){cur=i;
20[items,imgs,bars].forEach(function(list){list.forEach(function(el,k){el.classList.toggle('is-active',k===i);});});var h=items[i]&&items[i].querySelector('.altyor-xpd-savoir__h3');if(cap&&h)cap.textContent=h.textContent;if(prev)prev.disabled=i<=0;if(next)next.disabled=i>=items.length-1;}
21var io=new IntersectionObserver(function(entries){entries.forEach(function(e){if(e.isIntersecting)set(+e.target.getAttribute('data-i'));});},{rootMargin:'-45% 0px -45% 0px'});items.forEach(function(el){io.observe(el);});[prev,next].forEach(function(b){if(!b)return;b.addEventListener('click',function(){var el=items[cur+(+b.getAttribute('data-dir'))];if(el)window.scrollTo({top:window.scrollY+el.getBoundingClientRect().top-window.innerHeight*0.3,behavior:'smooth'});});});}
22var deliv=document.querySelector('.altyor-xpd-deliv');var methode=deliv&&deliv.closest('.altyor-xpd-methode');var lis=deliv?deliv.querySelectorAll('.altyor-xpd-deliv__list li'):[];if(!lis.length||!methode)return;var mq=window.matchMedia('(max-width: 900px)');var raf=0;function progress(){raf=0;if(mq.matches||window.matchMedia('(prefers-reduced-motion: reduce)').matches){deliv.classList.remove('is-progress');return;}
23deliv.classList.add('is-progress');var r=methode.getBoundingClientRect();var tot=r.height-window.innerHeight*0.5;var p=Math.min(1,Math.max(0,(window.innerHeight*0.35-r.top)/(tot||1)));lis.forEach(function(li,k){li.classList.toggle('is-lit',p*(lis.length+1)*1.6>k);});}
24progress();window.addEventListener('scroll',function(){if(!raf)raf=requestAnimationFrame(progress);},{passive:true});window.addEventListener('resize',progress,{passive:true});}
25document.addEventListener('DOMContentLoaded',function(){initFrise();initVerbatim();initStickyOffset();initExpToc();initBlog();initXpd();});})();

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.