1 2// Scroll anchor - Main.html 3function t3sbScrollToAnchor(sectionmenuAnchorOffset, fixedNavbar, navbarHeight, sectionhash=false) { 4 var hash = window.location.hash; 5 if (sectionhash) { 6 hash = sectionhash; 7 } 8 if (hash.length) { 9 var idArr = hash.split('#'); 10 var targetElement = document.getElementById(idArr[1]); 11 if ( targetElement === null ) { 12 idArr = hash.split('#c'); 13 targetElement = document.getElementById('tab-'+idArr[1]); 14 } 15 if ( targetElement != null ) { 16 var offsetSize = sectionmenuAnchorOffset; 17 if ( fixedNavbar ) { 18 offsetSize += navbarHeight; 19 } 20 var scrollTo = Math.round(t3sbOffsetTop(targetElement)-offsetSize); 21 window.scroll({ top: scrollTo, behavior: 'smooth' }); 22 } 23 } 24} 25 26function t3sbOffsetTop(el) { 27 var rect = el.getBoundingClientRect(), 28 scrollTop = window.pageYOffset || document.documentElement.scrollTop; 29 return rect.top + scrollTop; 30} 31 32 33 34// Link to top - Main.html 35function t3sbScrollToTop() { 36 document.addEventListener('scroll', t3sbHandleScroll); 37} 38 39function t3sbHandleScroll() { 40 var scrollToTopBtn = document.querySelector('.back-to-top'), 41 scrollTop = window.pageYOffset || document.documentElement.scrollTop; 42 if (scrollToTopBtn != null) { 43 scrollToTopBtn.addEventListener('click', t3sbScrollIt); 44 if (scrollTop > 100) { 45 scrollToTopBtn.classList.add('st-block'); 46 scrollToTopBtn.classList.remove('st-none'); 47 } else { 48 scrollToTopBtn.classList.add('st-none'); 49 scrollToTopBtn.classList.remove('st-block'); 50 } 51 } 52} 53 54function t3sbScrollIt(e) { 55 e.preventDefault(); 56 window.scroll({ top: 0, behavior: 'smooth' }); 57} 58 59 60 61// Shrinking Navbar on scrolling - Navbar/Assets.html 62function t3sbShrinkingNavbar(navbar, padding) { 63 let navShrinkColorschemes = navbar.getAttribute('data-shrinkcolorschemes'), 64 navShrinkColor = 'navbar-'+navbar.getAttribute('data-shrinkcolor'), 65 navColorschemes = navbar.getAttribute('data-colorschemes'), 66 navColor = navbar.getAttribute('data-color'); 67 68 let gradient = []; 69 if (navShrinkColorschemes != null) { 70 gradient = navShrinkColorschemes.split(' '); 71 } 72 73 if (gradient[1]) { 74 navShrinkColorschemes = gradient[0]; 75 } 76 window.addEventListener('scroll', function() { 77 if (navColor == navShrinkColor) { 78 if ( t3sbOffsetTop(navbar) > 100) { 79 navbar.classList.remove('py-'+padding, navColorschemes); 80 navbar.classList.add('navbar-shrink', navShrinkColorschemes); 81 } else { 82 navbar.classList.add('py-'+padding, navColorschemes); 83 navbar.classList.remove('navbar-shrink', navShrinkColorschemes); 84 } 85 } else { 86 if ( t3sbOffsetTop(navbar) > 100) { 87 navbar.classList.remove('py-'+padding, navColorschemes, navColor); 88 navbar.classList.add('navbar-shrink', navShrinkColor, navShrinkColorschemes); 89 } else { 90 navbar.classList.add('py-'+padding, navColorschemes, navColor); 91 navbar.classList.remove('navbar-shrink', navShrinkColor, navShrinkColorschemes); 92 } 93 } 94 }); 95} 96 97 98 99// Extra Row - Navbar/Assets.html 100function t3sbExtraRow(vw, bp) { 101 let extraRow = document.querySelector('.navbar .extra-row'); 102 if (extraRow) { 103 if ( vw < bp ) { 104 extraRow.classList.add('flex-row','me-auto','mt-4','mb-0'); 105 extraRow.classList.remove('ms-auto'); 106 } else { 107 extraRow.classList.remove('flex-row','me-auto','mt-4','mb-0'); 108 extraRow.classList.add('ms-auto'); 109 } 110 } 111} 112 113 114 115// Searchbox in Navbar - Navbar/Assets.html 116function t3sbNavbarSearchbox(vw, bp) { 117 let form = document.querySelector('.navbar form'); 118 if ( vw < bp ) { 119 if (form.classList.contains('ms-auto')) { 120 form.classList.remove('ms-auto'); 121 form.classList.add('xl-ms-auto'); 122 } 123 form.classList.add('mt-3'); 124 } else { 125 if (form) { 126 if (form.classList.contains('xl-ms-auto')) { 127 form.classList.add('ms-auto'); 128 form.classList.remove('xl-ms-auto'); 129 } 130 form.classList.remove('mt-3'); 131 } 132 } 133} 134 135 136 137// Dropdown animate - Navbar/Assets.html 138function t3sbDropdownAnimate(vw, bp, dropdownAnimateValue) { 139 if ( vw < bp ) { 140 document.querySelectorAll('.dd-animate-'+dropdownAnimateValue).forEach(function(dda) { 141 dda.classList.remove('dd-animate-'+dropdownAnimateValue); 142 dda.classList.add('removed-animate-'+dropdownAnimateValue); 143 }); 144 } else { 145 document.querySelectorAll('.removed-animate-'+dropdownAnimateValue).forEach(function(dda) { 146 dda.classList.add('dd-animate-'+dropdownAnimateValue); 147 dda.classList.remove('removed-animate-'+dropdownAnimateValue); 148 }); 149 } 150} 151 152 153 154function ready(fn) { 155 if (document.readyState != 'loading'){ 156fn(); 157 } else { 158document.addEventListener('DOMContentLoaded', fn); 159 } 160} 161ready(() => { 162 // Default - Main.html 163 const navbar = document.getElementById('main-navbar'), 164 navbarHeight = navbar.clientHeight, 165 navbarBreakpointWidth = document.body.getAttribute('data-navbar-breakpointwidth'), 166 viewportWidth = parseFloat(getComputedStyle(document.querySelector('html'), null).width.replace("px", "")), 167 onePageLayout = navbar.classList.contains('sectionMenu'); 168 169 var fixedNavbar = false;
170 171 if ( navbar.classList.contains('fixed-top') ||Â navbar.classList.contains('sticky-top') ) { 172 fixedNavbar = true; 173 } 174 175 // Scroll anchor - Main.html 176 if (window.location.hash) { 177 t3sbScrollToAnchor(29, fixedNavbar, navbarHeight); 178 } 179 180 181 // Link to top - Main.html 182 t3sbScrollToTop(); 183 184 185 // Searchbox - Navbar/Assets.html 186 t3sbNavbarSearchbox(viewportWidth, navbarBreakpointWidth); 187 window.addEventListener('resize', function(event) { 188 resizedViewportWidth = parseFloat(getComputedStyle(document.querySelector('html'), null).width.replace("px", "")); 189 t3sbNavbarSearchbox(resizedViewportWidth, navbarBreakpointWidth); 190 }, true); 191 192 193 // Extra row - Navbar/Assets.html 194 t3sbExtraRow(viewportWidth, navbarBreakpointWidth); 195 window.addEventListener('resize', function(event) { 196 resizedViewportWidth = parseFloat(getComputedStyle(document.querySelector('html'), null).width.replace("px", "")); 197 t3sbExtraRow(resizedViewportWidth, navbarBreakpointWidth); 198 }, true); 199 200 201 // Dropdown animate - Navbar/Assets.html 202 t3sbDropdownAnimate(viewportWidth, navbarBreakpointWidth, 1); 203 window.addEventListener('resize', function(event) { 204 resizedViewportWidth = parseFloat(getComputedStyle(document.querySelector('html'), null).width.replace("px", "")); 205 t3sbDropdownAnimate(resizedViewportWidth, navbarBreakpointWidth, 1); 206 }, true); 207 208 209 // Shrinking Navbar on scrolling - Navbar/Assets.html 210 t3sbShrinkingNavbar(navbar, 'x'); 211 212 213 // Card image overlay on mobile only - Card.html 214 var overlay = document.querySelectorAll('.card .img-overlay'); 215 if ( overlay.length ) { 216 if ( viewportWidth < navbarBreakpointWidth ) { 217 overlay.forEach(function(ol) { 218 ol.classList.add('card-img-overlay'); 219 }); 220 } 221 } 222 223});
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.