1 line
1.3 KiB
JavaScript

document.addEventListener("DOMContentLoaded",(function(){var t=document.querySelectorAll(".parallax");M.Parallax.init(t,{});t=document.querySelectorAll(".slider");M.Slider.init(t,{indicators:!0,duration:500,interval:5e3});t=document.querySelectorAll(".sidenav");M.Sidenav.init(t,{});for(var o=document.querySelectorAll(".cryptmail"),e=0;e<o.length;e++)o[e].onclick=function(){return window.location.href="mailto:"+this.dataset.name+"@"+this.dataset.domain+"."+this.dataset.tld,!1};var n=document.querySelectorAll("a[href^='#']:not([href='#'])");for(e=0;e<n.length;e++)n[e].onclick=function(){var t=this.getAttribute("href");return scrollToElement(t),!1}}));const navbarScrollOffset=-48,nativeSmoothScrollTo=function(t){window.scroll({behavior:"smooth",left:0,top:t.getBoundingClientRect().top+window.pageYOffset+-48})},smoothScrollTo=function(t,o){const e=document.scrollingElement||document.documentElement,n=e.scrollTop,l=t-n,r=+new Date,c=function(){const i=+new Date-r;var a,s,u;e.scrollTop=parseInt((a=i,s=n,u=l,(a/=o/2)<1?u/2*a*a+s:-u/2*(--a*(a-2)-1)+s)),i<o?requestAnimationFrame(c):e.scrollTop=t};c()},supportsNativeSmoothScroll="scrollBehavior"in document.documentElement.style,scrollToElement=function(t){if(!t)return;const o=document.querySelector(t);o&&(supportsNativeSmoothScroll?nativeSmoothScrollTo(o):smoothScrollTo(o.offsetTop+-48,600))};