1/** 2 * Template Name: PhotoFolio 3 * Template URL: https://bootstrapmade.com/photofolio-bootstrap-photography-website-template/ 4 * Updated: Aug 07 2024 with Bootstrap v5.3.3 5 * Author: BootstrapMade.com 6 * License: https://bootstrapmade.com/license/ 7 */ 8 9(function () { 10 'use strict'; 11 12 /** 13 * Preloader 14 */ 15 const preloader = document.querySelector('#preloader'); 16 if (preloader) { 17 window.addEventListener('load', () => { 18 setTimeout(() => { 19 preloader.classList.add('loaded'); 20 }, 1000); 21 setTimeout(() => { 22 preloader.remove(); 23 }, 2000); 24 }); 25 } 26 27 /** 28 * Initiate glightbox 29 */ 30 const glightbox = GLightbox({ 31 selector: '.glightbox', 32 }); 33 34 /** 35 * Init swiper sliders 36 */ 37 function initSwiper() { 38 document.querySelectorAll('.init-swiper').forEach(function (swiperElement) { 39 let config = JSON.parse(swiperElement.querySelector('.swiper-config').innerHTML.trim()); 40 41 if (swiperElement.classList.contains('swiper-tab')) { 42 initSwiperWithCustomPagination(swiperElement, config); 43 } else { 44 new Swiper(swiperElement, config); 45 } 46 }); 47 } 48 49 window.addEventListener('load', initSwiper); 50})(); 51 52(function ($) { 53 'use strict'; 54 55 $(function () { 56 var $header = $('#header'); 57 var $languageMenu = $('#subMenu .langmenu'); 58 var $activeLanguageMenu = $(); 59 var closeTimer = null; 60 61 function placeLanguageMenu($menu) { 62 var menuRect = $menu[0].getBoundingClientRect(); 63 var $dropdown = $menu.find('.sub'); 64 var dropdownWidth = Math.max($dropdown.outerWidth() || 90, 90); 65 var left = menuRect.right - dropdownWidth; 66 67 $dropdown.css({ 68 top: menuRect.bottom + 10 + 'px', 69 left: Math.max(8, left) + 'px', 70 }); 71 } 72 73 function openLanguageMenu($menu) { 74 clearTimeout(closeTimer); 75 $activeLanguageMenu = $menu; 76 placeLanguageMenu($menu); 77 $menu.addClass('is-open'); 78 $header.addClass('langmenu_only').removeClass('header_on'); 79 } 80 81 function closeLanguageMenu($menu) { 82 closeTimer = setTimeout(function () { 83 if (!$menu.find(':focus').length) { 84 $menu.removeClass('is-open'); 85 $header.removeClass('langmenu_only'); 86 $activeLanguageMenu = $(); 87 } 88 }, 120); 89 } 90 91 $languageMenu 92 .on('mouseenter focusin', function () { 93 openLanguageMenu($(this)); 94 }) 95 .on('mouseleave', function () { 96 closeLanguageMenu($(this)); 97 }) 98 .on('focusout', function () { 99 closeLanguageMenu($(this)); 100 }); 101 102 $languageMenu.find('.sub') 103 .on('mouseenter focusin', function () { 104 openLanguageMenu($(this).closest('.langmenu')); 105 }); 106 107 $(window).on('resize scroll', function () { 108 if ($activeLanguageMenu.length) { 109 placeLanguageMenu($activeLanguageMenu); 110 $header.addClass('langmenu_only').removeClass('header_on'); 111 } 112 }); 113 }); 114})(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.