1(function($){ 2 3 $( ".fa-bars.nav-button" ).click(function() { 4 $( "#site-navigation" ).toggleClass( "toggled" ); 5 $( this ).toggleClass( "fa-times" ); 6 7 if (!$( "#site-navigation ul" ).hasClass("search-open")) { 8 $( "header" ).toggleClass("darken"); 9 } 10 11 12 }) 13 14// Hide Header on on scroll down 15var didScroll; 16var lastScrollTop = 0; 17var navbarHeight = $('.header-container').outerHeight(); 18var delta = navbarHeight; 19 20$(window).scroll(function(event) { 21 didScroll = true; 22 23if($(window).scrollTop() == 0) { 24 $(".header-container").removeClass('header-up'); 25 } 26 27}); 28 29setInterval(function() { 30 if (didScroll) { 31 hasScrolled(); 32 didScroll = false; 33 } 34}, 250); 35 36function hasScrolled() { 37 var st = $(this).scrollTop(); 38 39 // Make sure they scroll more than delta 40 if (Math.abs(lastScrollTop - st) <= delta) 41 return; 42 43if ($( window ).width() > 991) { 44 // If they scrolled down and are past the navbar, add class .nav-up. 45 // This is necessary so you never see what is "behind" the navbar. 46 if (st > lastScrollTop && st > navbarHeight) { 47 // Scroll Down 48 $('.header-container').addClass('header-up'); 49 } else { 50 // Scroll Up 51 if (st + $(window).height() < $(document).height()) { 52 $('.header-container').removeClass('header-up'); 53 } 54 } 55} 56 lastScrollTop = st; 57} 58 59// Header on mobile 60 61 $(window).on("scroll", function (e) { 62 if ( $(window).width() <= 991) { 63 if( $(window).scrollTop() > 100) { 64 $(".header-container").addClass("no-transparency"); 65 } else { 66 $(".header-container").removeClass("no-transparency"); 67 } 68 } 69 }); 70 71//scroll project 72 $('.scroll-button').click(function() { 73 console.log("scroll"); 74 var speed = 1000; 75 $('html, body').animate( { scrollTop: $("#photographer-statement").offset().top }, speed ); 76 return false; 77 }); 78 79 80/* Dark mode */ 81 82 $( ".fa-adjust" ).click(function( event ) { 83 event.preventDefault(); 84 console.log("Dark mode"); 85 $('body').toggleClass('darkmode'); 86 87 if ($( "body" ).hasClass("darkmode")) { 88 localStorage.setItem("darkmode","on"); 89 } else { 90 localStorage.setItem("darkmode","off"); 91 } 92 }) 93 94 let darkmode = localStorage.getItem("darkmode"); 95 96 if( darkmode == 'on') { 97 $('body').addClass('darkmode'); 98 } 99 100 101}(jQuery));
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.