1
const uniSlider={click:!0,x:null,hold:!1,thres:5,distance:50,started:!1,timeout:null,css:"LnVuaS1zbGlkZXItY29udGFpbmVye3Bvc2l0aW9uOnJlbGF0aXZlO2NvbnRhaW5lci10eXBlOmlubGluZS1zaXplfS51bmktc2xpZGVyLWNvbnRhaW5lciAudW5pLXNsaWRlci1zY3JvbGx7ZGlzcGxheTpncmlkO2dyaWQtYXV0by1mbG93OmNvbHVtbjtncmlkLWF1dG8tY29sdW1uczp2YXIoLS11bmktc2xpZGVyLWl0ZW0td2lkdGgsIDFmcik7Z2FwOjA7b3ZlcmZsb3cteDphdXRvOy1tcy1zY3JvbGwtc25hcC10eXBlOnggbWFuZGF0b3J5O3Njcm9sbC1zbmFwLXR5cGU6eCBtYW5kYXRvcnk7c2Nyb2xsYmFyLXdpZHRoOm5vbmU7LXdlYmtpdC11c2VyLXNlbGVjdDpub25lOy1tb3otdXNlci1zZWxlY3Q6bm9uZTstbXMtdXNlci1zZWxlY3Q6bm9uZTt1c2VyLXNlbGVjdDpub25lO3Njcm9sbC1iZWhhdmlvcjpzbW9vdGh9LnVuaS1zbGlkZXItY29udGFpbmVyIC51bmktc2xpZGVyLXNjcm9sbDpob3ZlcntjdXJzb3I6LXdlYmtpdC1ncmFiO2N1cnNvcjpncmFifS51bmktc2xpZGVyLWNvbnRhaW5lciAudW5pLXNsaWRlci1zY3JvbGw6YWN0aXZle2N1cnNvcjotd2Via2l0LWdyYWJiaW5nO2N1cnNvcjpncmFiYmluZ31Ac3VwcG9ydHMgbm90IChzY3JvbGxiYXItd2lkdGg6IG5vbmUpey51bmktc2xpZGVyLWNvbnRhaW5lciAudW5pLXNsaWRlci1zY3JvbGw6Oi13ZWJraXQtc2Nyb2xsYmFye2hlaWdodDowfX0udW5pLXNsaWRlci1jb250YWluZXIgLnVuaS1zbGlkZXItc2Nyb2xsIC51bmktc2xpZGVyLWl0ZW17cG9zaXRpb246cmVsYXRpdmU7c2Nyb2xsLXNuYXAtYWxpZ246Y2VudGVyO3BhZGRpbmctaW5saW5lOmNhbGModmFyKC0tdW5pLXNsaWRlci1nYXAsIDApLzIpfS51bmktc2xpZGVyLWNvbnRhaW5lcjpub3QoW2xlZnRdLFtyaWdodF0pLnVuaS1zbGlkZXItLWNlbnRlcmVkIC51bmktc2xpZGVyLXNjcm9sbHstd2Via2l0LWJveC1wYWNrOmNlbnRlcjstbXMtZmxleC1wYWNrOmNlbnRlcjtqdXN0aWZ5LWNvbnRlbnQ6Y2VudGVyfS51bmktc2xpZGVyLWNvbnRhaW5lcjppcyhbbGVmdF0sW3JpZ2h0XSkudW5pLXNsaWRlci0tY2VudGVyZWQgLnVuaS1zbGlkZXItc2Nyb2xse3BhZGRpbmctaW5saW5lOmNhbGMoNTAlIC0gdmFyKC0tdW5pLXNsaWRlci1pdGVtLXdpZHRoKS8yKX0=",init(){if(!this.started){let style=document.createElement("style");style.innerText=atob(this.css),document.body.appendChild(style),this.started=!0}
2
let uni=document.querySelectorAll(".uni-slider-container"),items,item,thumb,n,wrapper;uni&&(window.addEventListener("resize",e=>{this.resize()}
3
,{passive:!0}
4
),uni.forEach((container,i)=>{if(!container.querySelector(".uni-slider-scroll")&&container.childElementCount){for(items='<div class="uni-slider-scroll">',thumb="",n=0;container.firstElementChild;)item=container.removeChild(container.firstElementChild),"a"!==item.localName&&"img"!==item.localName||item.setAttribute("draggable","false"),item.querySelectorAll("img").forEach(img=>img.setAttribute("draggable","false")),item.querySelectorAll("a").forEach(img=>img.setAttribute("draggable","false")),items+=`<div class="uni-slider-item">${item.outerHTML}
5
</div>`,thumb+=`<span thumb="${n++}
6
"></span>`;items+=`</div><span prev></span><span thumbs>${thumb}
7
</span><span next></span>`,container.innerHTML=items,wrapper=container.querySelector(".uni-slider-scroll"),"ontouchstart"in window||container.classList.contains("no-drag")||(wrapper.addEventListener("mousedown",e=>{this.hold=!0,this.click=!0,this.x=e.x,e.target.closest(".uni-slider-scroll").classList.add("__lock")}
8
,{passive:!0}
9
),wrapper.addEventListener("mouseup",e=>{this.x=e.x,this.hold=!1,e.target.closest(".uni-slider-scroll").classList.remove("__lock")}
10
,{passive:!0}
11
),wrapper.addEventListener("mouseleave",e=>{this.hold=!1,e.target.closest(".uni-slider-scroll").classList.remove("__lock")}
12
,{passive:!0}
13
),wrapper.addEventListener("mousemove",e=>{if(this.click&&Math.abs(e.movementX)>this.thres&&(this.click=!1),this.hold){let el=e.target.closest(".uni-slider-scroll"),delta=this.x-e.x;Math.abs(delta)>this.distance&&(el.scrollLeft+=delta,this.check(el,!1))}
14
}
15
,{passive:!0}
16
),wrapper.addEventListener("click",e=>{this.click||e.preventDefault()}
17
,{passive:!1}
18
)),wrapper.addEventListener("scroll",e=>{if(e.target.classList.contains("uni-slider-scroll")){let thumbs=e.target.parentElement.querySelectorAll("[thumbs] [thumb]"),after=e.target.parentElement.getAttribute("onUnsetActive");e.target.querySelectorAll(".uni-slider-item").forEach((item,n)=>{if(item.classList.remove("active"),thumbs[n].classList.remove("active"),after)try{window[after](item)}
19
catch(err){}
20
}
21
)}
22
}
23
,{passive:!0}
24
),wrapper.addEventListener("scrollend",e=>{e.target.classList.contains("uni-slider-scroll")&&this.check(e.target)}
25
,{passive:!0}
26
),container.querySelector("[prev]").addEventListener("click",e=>this.prev(e),{passive:!0}
27
),container.querySelector("[next]").addEventListener("click",e=>this.next(e),{passive:!0}
28
),container.querySelector("[thumbs]").addEventListener("click",e=>this.thumbs(e),{passive:!0}
29
),setTimeout(()=>this.resize(),100)}
30
}
31
))}
32
,prev(e){let scr=e.target.parentElement.querySelector(".uni-slider-scroll"),items=scr.querySelectorAll(".uni-slider-item"),i;for(i=0,l=scr.childElementCount;i<l&&!(items[i].offsetLeft+items[i].clientWidth>scr.scrollLeft);i++);scr.scrollLeft-=parseInt(.67*items[i].clientWidth)}
33
,next(e){let scr=e.target.parentElement.querySelector(".uni-slider-scroll"),items=scr.querySelectorAll(".uni-slider-item"),i;for(i=scr.childElementCount-1;i>=0&&!(items[i].offsetLeft+items[i].clientWidth>scr.scrollLeft);i--);scr.scrollLeft+=parseInt(.67*items[i].clientWidth)}
34
,thumbs(e){if(e.target.getAttribute("thumb")){let order=parseInt(e.target.getAttribute("thumb")),area=e.target.closest(".uni-slider-container").querySelector(".uni-slider-scroll");area.scrollLeft=area.children[order].offsetLeft}
35
}
36
,resize(){let mov;document.querySelectorAll(".uni-slider-container").forEach(container=>{mov=container.querySelector(".uni-slider-scroll"),mov&&(container.classList.contains("uni-slider--centered")?mov.scrollLeft=mov.children[0].clientWidth<=container.clientWidth?parseInt(mov.scrollWidth/2-container.clientWidth/1.5):0:mov.scrollLeft=0,this.check(mov))}
37
)}
38
,check(el){el.scrollWidth<=el.clientWidth?(el.parentElement.removeAttribute("left"),el.parentElement.removeAttribute("right")):(el.scrollLeft>0?el.parentElement.setAttribute("left",""):el.parentElement.removeAttribute("left"),el.scrollWidth-el.scrollLeft-1>el.clientWidth?el.parentElement.setAttribute("right",""):el.parentElement.removeAttribute("right")),this.active(el)}
39
,active(el){let items=el.querySelectorAll(".uni-slider-item"),thumbs=el.parentElement.querySelectorAll("[thumbs] [thumb]"),view=el.parentElement.getBoundingClientRect(),fna=el.parentElement.getAttribute("onSetActive"),fnu=el.parentElement.getAttribute("onUnsetActive"),box,bl,vl,br,vr;for(let i=0,l=items.length;i<l;i++)if(box=items[i].getBoundingClientRect(),bl=Math.ceil(box.left),vl=Math.floor(view.left),br=Math.floor(box.right),vr=Math.ceil(view.right),bl>=vl&&br<=vr){if(thumbs[i].classList.add("active"),items[i].classList.add("active"),fna)try{window[fna](items[i])}
40
catch(err){}
...
</html>