1/* 2 Hypothesis by Pixelarity 3 pixelarity.com | [email protected] 4 License: pixelarity.com/license 5*/ 6 7(function($) { 8 9 skel.breakpoints({ 10 xlarge: '(max-width: 1680px)', 11 large: '(max-width: 1280px)', 12 medium: '(max-width: 980px)', 13 small: '(max-width: 736px)', 14 xsmall: '(max-width: 480px)', 15 xxsmall: '(max-width: 360px)' 16 }); 17 18 $(function() { 19 20 var $window = $(window), 21 $body = $('body'), 22 $header = $('#header'), 23 $banner = $('#banner'); 24 25 // Disable animations/transitions until the page has loaded. 26 $body.addClass('is-loading'); 27 28 $window.on('load', function() { 29 window.setTimeout(function() { 30 $body.removeClass('is-loading'); 31 }, 100); 32 }); 33 34 // Prioritize "important" elements on medium. 35 skel.on('+medium -medium', function() { 36 $.prioritize( 37 '.important\\28 medium\\29', 38 skel.breakpoint('medium').active 39 ); 40 }); 41 42 // Scrolly. 43 $('.scrolly').scrolly({ 44 offset: function() { return $header.height() - 5; } 45 }); 46 47 // Header. 48 if ($banner.length > 0 49 && $header.hasClass('alt')) { 50 51 $window.on('resize', function() { $window.trigger('scroll'); }); 52 53 $banner.scrollex({ 54 bottom: $header.outerHeight(), 55 terminate: function() { $header.removeClass('alt'); }, 56 enter: function() { $header.addClass('alt'); }, 57 leave: function() { $header.removeClass('alt'); $header.addClass('reveal'); } 58 }); 59 60 } 61 62 // Dropdowns. 63 $('#nav > ul').dropotron({ 64 alignment: 'right', 65 hideDelay: 350, 66 baseZIndex: 100000 67 }); 68 69 // Menu. 70 $('<a href="#navPanel" class="navPanelToggle">Menu</a>') 71 .appendTo($header); 72 73 $( '<div id="navPanel">' + 74 '<nav>' + 75 $('#nav') .navList() + 76 '</nav>' + 77 '<a href="#navPanel" class="close"></a>' + 78 '</div>') 79 .appendTo($body) 80 .panel({ 81 delay: 500, 82 hideOnClick: true, 83 hideOnSwipe: true, 84 resetScroll: true, 85 resetForms: true, 86 target: $body, 87 visibleClass: 'is-navPanel-visible', 88 side: 'right' 89 }); 90 91 if (skel.vars.os == 'wp' 92 && skel.vars.osVersion < 10) 93 $('#navPanel') 94 .css('transition', 'none'); 95 96 // Banner. 97 if ($banner.length > 0) { 98 99 // Edge + IE: Workaround for object-fit. 100 if (skel.vars.browser == 'edge' 101 || skel.vars.browser == 'ie') { 102 103 var $video = $banner.find('video'), 104 v = $video[0], 105 t, f; 106 107 // Handler function. 108 var f = function() { 109 110 var w = v.videoWidth, h = v.videoHeight, 111 pw = $window.width(), ph = $window.height(), 112 nw, nh, x; 113 114 // Calculate new width, height. 115 if (pw > ph) { 116 117 nw = pw; 118 nh = (nw / w) * h; 119 120 } 121 else { 122 123 nh = ph; 124 nw = (nh / h) * w; 125 126 } 127 128 // Set width, height. 129 if (nw < pw) { 130 131 v.style.width = '100vw'; 132 v.style.height = 'auto'; 133 134 } 135 else 136 v.style.width = nw + 'px'; 137 138 if (nh < ph) { 139 v.style.height = '100vh'; 140 v.style.width = 'auto'; 141 } 142 else 143 v.style.height = nh + 'px'; 144 145 // Set position (bottom-right). 146 v.style.top = v.style.bottom = v.style.left = v.style.right = 'auto'; 147 v.style.bottom = '0'; 148 v.style.right = '0'; 149 150 }; 151 152 // Do an initial call of the handler. 153 (f)(); 154 155 // Add event listeners. 156 $window.on('resize load', function() { 157 158 clearTimeout(t); 159 160 t = setTimeout(f, 125); 161 162 }); 163 164 } 165 166 } 167 168 // Tabs. 169 $('.tabs').selectorr({ 170 titleSelector: 'h3', 171 delay: 250 172 }); 173 174 }); 175 176})(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.