1/*! 2 * Start Bootstrap - Grayscale v6.0.2 (https://startbootstrap.com/themes/grayscale) 3 * Copyright 2013-2020 Start Bootstrap 4 * Licensed under MIT (https://github.com/StartBootstrap/startbootstrap-grayscale/blob/master/LICENSE) 5 */ 6 (function ($) { 7 "use strict"; // Start of use strict 8 9 // Smooth scrolling using jQuery easing 10 $('a.js-scroll-trigger[href*="#"]:not([href="#"])').click(function () { 11 if ( 12 location.pathname.replace(/^\//, "") == 13 this.pathname.replace(/^\//, "") && 14 location.hostname == this.hostname 15 ) { 16 var target = $(this.hash); 17 target = target.length 18 ? target 19 : $("[name=" + this.hash.slice(1) + "]"); 20 if (target.length) { 21 $("html, body").animate( 22 { 23 scrollTop: target.offset().top - 70, 24 }, 25 300, 26 "easeInOutExpo" 27 ); 28 return false; 29 } 30 } 31 }); 32 33 // Closes responsive menu when a scroll trigger link is clicked 34 $(".js-scroll-trigger").click(function () { 35 $(".navbar-collapse").collapse("hide"); 36 }); 37 38 // Activate scrollspy to add active class to navbar items on scroll 39 $("body").scrollspy({ 40 target: "#mainNav", 41 offset: 100, 42 }); 43 44 let isMobile = window.matchMedia('(max-width: 600px)').matches; 45 if (isMobile) { 46 //$("#logoSwitch").attr("src", "https://www.horse-ball.org/media/assets/img/WHBO_NOIR.png"); 47 //Toast.create("Test", 'Mobile !', TOAST_STATUS.SUCCESS, 7000); 48 } 49 50 // Collapse Navbar 51 var navbarCollapse = function () { 52 if ($("#mainNav").offset().top > 100) { 53 $("#mainNav").addClass("navbar-shrink"); 54 $("#logoSwitch").attr("src", "https://www.horse-ball.org/media/assets/img/WHBO_NOIR.png"); 55 } else { 56 $("#mainNav").removeClass("navbar-shrink"); 57 if (isMobile) $("#logoSwitch").attr("src", "https://www.horse-ball.org/media/assets/img/WHBO_NOIR.png"); 58 else $("#logoSwitch").attr("src", "https://www.horse-ball.org/media/assets/img/WHBO_BLANC.png"); 59 } 60 }; 61 // Collapse now if page is not at top 62 navbarCollapse(); 63 // Collapse the navbar when page is scrolled 64 $(window).scroll(navbarCollapse); 65})(jQuery); // End of use strict
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.