document ready(function() { $('#navbar').addClass('animated fadeIn slow');function setSticky(domElement, stickTo, offset) { if(domElement) { console.log('domElement:'+domElement);} else { console.error('Unable to setSticky - domElement is null or undefined:'+domElement);alert('Unable to setSticky - domElement is null or undefined:'+domElement);} if(!stickTo) { console.error('Unable to setSticky - stickTo is null or undefined:'+stickTo);alert('Unable to setSticky - stickTo is null or undefined:'+stickTo);} if(!offset) offset=0;$(window).scroll(function() { if($(window).scrollTop() > $(stickTo).outerHeight()) { $('#'+domElement).addClass('fixed-top shadow');var navbar_height=$('.'+domElement).outerHeight();$('body').css('padding-top', navbar_height+ 'px');} else { $('#'+domElement).removeClass('fixed-top');$('body').css('padding-top', 0);} });} setSticky('navbar', '#intro', 0);setSticky('MySidebar', '#intro', 100);$('#subMenu li').click(function(e) { e.preventDefault();var linkObject=$(this).find('a');var href=linkObject.attr('href');var target=linkObject.attr('target');if(href.charAt(0)==='#') { try { $('html, body').velocity('scroll', { offset:$(href).offset().top - 250, duration:2400, easing:'easeOutQuart' });} catch(error) { console.log('Info:Velocity.js is not loaded. Please consider loading velocity.js within the template assets if you want the smoothest scroll experience. Error message:', error.message);$('html, body').animate({ scrollTop:$(href).offset().top - 250 }, 2400);} } else { if(target) { window.open(href, target);} else { window.open(href, '_self');} } });$('.scrollup').click(function() { try{ $("html, body").velocity("scroll", { duration:2400, easing:"easeOutExpo" });} catch { console.log('Error:Velocity.js is not loaded. Please consider loading velocity.js within the assets if you want the smoothest scroll experience. Error message:', error.message);$("html, body").animate({scrollTop:0}, 1200);} });$('#darkMode').click(function() { var id=$('#darkMode').data('id');document.cookie='frontendSwitchID='+id;});$('#lightMode').click(function() { var id=$('#lightMode').data('id');document.cookie='frontendSwitchID='+id;});$(window).scroll(function() { var screenWidth=$(window).width();var scrollTop=$(window).scrollTop();var fadeOutValue=1 -(scrollTop/(screenWidth/3));$(".scrollDownFadeOut").css("opacity", fadeOutValue);});var $scrollingDiv=$("#scrollingDiv");$(window).scroll(function() { $scrollingDiv.stop().animate({"marginTop":($(window).scrollTop())}, 0);});$(".sliding-link").click(function(e) { e.preventDefault();var aid=$(this).attr("href");$('html, body').animate({scrollTop:$(aid).offset().top - 150}, 'slow');window.location.hash=aid;});$(function() { $('[data-toggle="tooltip"]').tooltip();});const options={ controlColor:"#FFFFFF", controlShadow:true, addCircle:true, addCircleBlur:true, showLabels:true, labelOptions:{ before:'Before', after:'After', onHover:true }, smoothing:true, smoothingAmount:80, hoverStart:true, verticalMode:false, startingPoint:50, fluidMode:false };$('.image-compare').each(function() { let view=new ImageCompare(this, options).mount();});})