1(function( $ ) { 2 3 window.btGetNavHTML = function( count ) { 4 var html = '<div class="btAnimNavHolder"><ul class="btAnimNav">'; 5 html += '<li class="btAnimNavPrev"></li>'; 6 for ( var i = 0; i < count; i++ ) { 7 html += '<li class="btAnimNavDot" data-count="' + i + '"><span>' + ( i + 1 ) + '/' + count + '<span></li>'; 8 } 9 html += '<li class="btAnimNavNext"></li>'; 10 html += '</ul></div>'; 11 12 return html; 13 } 14 15 /* Animate elements */ 16 17 function btAnimateElements() { 18 var $elems = $( '.btCounter:not(.animated), .btProgressBar:not(.animated)' ); 19 // classic animations 20 $elems.each(function() { 21 $elm = $( this ); 22 if ( 23 ( $elm.isOnScreen() && ! $( 'body' ).hasClass( 'impress-enabled' ) ) || 24 ( $elm.isOnScreen() && $( 'body' ).hasClass( 'impress-enabled' ) && $elm.closest( '.boldSection' ).hasClass( 'active' ) ) 25 ) { 26 $elm.addClass( 'animated' ); 27 if ( $elm.hasClass( 'btCounter' ) ) { 28 btAnimateCounter( $elm ); 29 } 30 if ( $elm.hasClass( 'btProgressBar' ) ) { 31 btAnimateProgress( $elm ); 32 } 33 } 34 }); 35 } 36 37 function btAnimateCounter( elm ) { 38 var number_length = elm.data( 'digit-length' ); 39 for ( var i = parseInt( number_length ); i > 0; i-- ) { 40 var digit = parseInt( elm.children( '.p' + i ).data( 'digit' ) ); 41 if ( digit == 0 || isNaN( digit ) ) digit = 10; 42 for ( var j = 0; j <= digit; j++ ) { 43 //elm.children( '.p' + i ).children( '.n' + j ).css( 'transform', 'translateY(-' + digit * elm.height() + 'px)' ); 44 elm.children( '.p' + i ).css( 'transform', 'translateY(-' + digit * elm.height() + 'px)' ); 45 } 46 47 } 48 return false; 49 } 50 51 function btAnimateCounterReset( elm ) { 52 var number_length = elm.data( 'digit-length' ); 53 for ( var i = parseInt( number_length ); i > 0; i-- ) { 54 var digit = elm.children( '.p' + i ).data( 'digit' ); 55 if ( digit == 0 || isNaN( digit ) ) digit = 10; 56 for ( var j = 0; j <= parseInt( digit ); j++ ) { 57 //elm.children( '.p' + i ).children( '.n' + j ).css( 'transform', 'translateY(0px)' ); 58 elm.children( '.p' + i ).css( 'transform', 'translateY(0px)' ); 59 } 60 61 } 62 return false; 63 } 64 65 function btAnimateProgress( elm ) { 66 elm.find( '.btProgressAnim' ).css( 'transition-delay', Math.round( Math.random() * 250 ) + 'ms' ); 67 elm.find( '.btProgressAnim' ).css( 'transform', 'translateX(-' + ( 100 - elm.find( '.btProgressAnim' ).data( 'percentage' ) ) + '%)' ); 68 return false; 69 } 70 71 function btAnimateProgressReset( elm ) { 72 elm.find( '.btProgressAnim' ).css( 'transition-delay', Math.round( Math.random() * 250 ) + 'ms' ); 73 elm.find( '.btProgressAnim' ).css( 'transform', 'translateX(-100%)' ); 74 return false; 75 } 76 77 $( window ).on( 'btload', function() { 78 if ( ! $( 'body' ).hasClass( 'btPageTransitions' ) ) { 79 btAnimateElements(); 80 $( window ).scroll(function(){ 81 btAnimateElements(); 82 }); 83 } 84 }); 85 86 $( window ).on( 'boldthemes_section_animation_end', function( e, el ) { 87 var $elems = $( el ).find( '.btCounter, .btProgressBar, span.headline .animate' ); 88 // classic animations 89 $elems.each(function() { 90 $elm = $( this ); 91 $elm.addClass( 'animated' ); 92 if ( $elm.hasClass( 'btCounter' ) ) { 93 btAnimateCounter( $elm ); 94 } 95 if ( $elm.hasClass( 'btProgressBar' ) ) { 96 btAnimateProgress( $elm ); 97 } 98 }); 99 }); 100 101 $( window ).on( 'boldthemes_section_animation_out', function( e, el ) { 102 var $elems = $( el ).find( '.btCounter, .btProgressBar, span.headline .animate' ); 103 // classic animations 104 $elems.each(function() { 105 $elm = $( this ); 106 $elm.removeClass( 'animated' ); 107 if ( $elm.hasClass( 'btCounter' ) ) { 108 btAnimateCounterReset( $elm ); 109 } 110 if ( $elm.hasClass( 'btProgressBar' ) ) { 111 btAnimateProgressReset( $elm ); 112 } 113 }); 114 }); 115 116 function bt_video_background() { 117 $( '.boldSection.video' ).each(function() { 118 var video = $( this ).find( 'video' ); 119 var w = $( this ).outerWidth(); 120 var h = $( this ).outerHeight(); 121 if ( w / h > 16 / 9 ) { 122 video.css( 'width', '105%' ); 123 video.css( 'height', '' ); 124 } else { 125 video.css( 'width', '' ); 126 video.css( 'height', '105%' ); 127 } 128 }); 129 } 130 131 window.bt_video_callback = function( v ) { 132 $( v ).parent().addClass( 'video_on' ); 133 } 134 135 $( window ).on( 'resize', function( e ) { 136 var $elems = $( '.btCounter' ); 137 // classic animations 138 /*$elems.each(function() { 139 $elm = $( this ); 140 if ( $elm.hasClass( 'btCounter' ) ) { 141 btAnimateCounterReset( $elm ); 142 } 143 });*/ 144 setTimeout( function() { 145 var $elems = $( '.btCounter' ); 146 $elems.each(function() { 147 $elm = $( this ); 148 btAnimateCounter( $elm ); 149 }); 150 }, 1000 ); 151 152 bt_video_background(); 153 154 }); 155 156 /* Accordions and tabs */ 157 158 $( document ).ready(function () { 159 160 /* Accordions */ 161 162 $( '.tabsVertical .tabAccordionContent' ).hide(); 163 164 $( '.tabsVertical .tabAccordionTitle' ).click(function() { 165 if ( $( this ).hasClass( 'on' ) ) { 166 $( this ).removeClass( 'on' ).next().slideUp( 250 ); 167 } else { 168 $( this ).closest( '.tabsVertical' ).find( '.tabAccordionTitle' ).removeClass( 'on' ); 169 $( this ).closest( '.tabsVertical' ).find( '.tabAccordionContent' ).delay( 250 ).slideUp( 250 ); 170 $( this ).addClass( 'on' ).next().slideDown( 250 ); 171 } 172 }); 173 174 $( '.tabsVertical' ).each(function(){ 175 $( this ).find( '.tabAccordionTitle' ).first().click(); 176 }); 177 178 /* Tabs */ 179 180 $( '.tabsHorizontal ul.tabsHeader li' ).click(function() { 181 $(this).siblings().removeClass( 'on' ); 182 $( this ).addClass( 'on' ); 183 $( this ).parent().parent().find( '.tabPanes .tabPane' ).removeClass( 'on' ); 184 $( this ).parent().parent().find( '.tabPanes .tabPane' ).eq( $(this).index() ).addClass( 'on' ); 185 }); 186 187 $( '.tabsHorizontal ul.tabsHeader' ).each(function(){ 188 $( this ).find( 'li' ).first().click(); 189 }); 190 191 // Wrap inline row 192 $( '.btIconImageRow > div' ).wrap( '<div class="btIconImageCell"></div>' ); 193 $.each( $( '.btIconImageRow' ), function() { 194 if( $( this ).children( 'div.btIconImageCell' ).length > 0 ) { 195 $( this ).addClass( 'btHasRows btCells-' + $( this ).children( 'div.btIconImageCell' ).length ); 196 } 197 198 }); 199 200 // Countdown 201 202 $( '.btCountdownHolder' ).each(function() { 203 204 var cd = $( this ); 205 var s = cd.data( 'init-seconds' ); 206 if ( cd.data( 'init-target-seconds' ) ) { 207 var now_utc_seconds = Math.floor( new Date().getTime() / 1000);; 208 var s = cd.data( 'init-target-seconds' ) - now_utc_seconds; 209 if ( s < 0 ) { 210 s = 0; 211 } 212 } 213 214 var seconds_arr = ['', '']; 215 var seconds_arr_prev = ['', '']; 216 217 var minutes_arr = ['', '']; 218 var minutes_arr_prev = ['', '']; 219 220 var hours_arr = ['', '']; 221 var hours_arr_prev = ['', '']; 222 223 var days_prev = 0; 224 225 var countdown = function( selector, i, arr, arr_prev ) { 226 if ( arr[ i ] !== arr_prev[ i ] ) { 227 cd.find( selector ).children().addClass( 'countdown_anim' ); 228 cd.find( selector ).children().eq( 0 ).html( arr[ i ] ); 229 cd.find( selector ).children().eq( 1 ).html( arr_prev[ i ] ); 230 setTimeout(function() { 231 cd.find( selector ).children().eq( 1 ).html( cd.find( selector ).children().eq( 0 ).html() ); 232 cd.find( selector ).children().removeClass( 'countdown_anim' ); 233 }, 300 ); 234 } 235 } 236 237 var output = function() { 238 s = s - 1; 239 if ( s < 0 ) { 240 s = 0; 241 } 242 243 var delta = s; 244 245 var days = Math.floor( delta / 86400 ); 246 delta -= days * 86400; 247 248 var hours = Math.floor( delta / 3600 ) % 24; 249 delta -= hours * 3600; 250 251 var minutes = Math.floor( delta / 60 ) % 60; 252 delta -= minutes * 60; 253 254 var seconds = delta; 255 256 if ( hours < 10 ) { 257 hours = '0' + hours; 258 } 259 260 if ( minutes < 10 ) { 261 minutes = '0' + minutes; 262 } 263 264 if ( seconds < 10 ) { 265 seconds = '0' + seconds; 266 } 267 268 seconds_arr = seconds.toString().split( '' ); 269 minutes_arr = minutes.toString().split( '' ); 270 hours_arr = hours.toString().split( '' ); 271 272 for ( var i = 0; i <= 1; i++ ) { 273 countdown( '.seconds .n' + i, i, seconds_arr, seconds_arr_prev ); 274 countdown( '.minutes .n' + i, i, minutes_arr, minutes_arr_prev ); 275 countdown( '.hours .n' + i, i, hours_arr, hours_arr_prev ); 276 } 277 278 if ( days != days_prev ) { 279 days_arr = days.toString().split( '' ); 280 281 var days_html = ''; 282 for ( var i = 0; i < days_arr.length; i++ ) { 283 days_html += '<span><span>' + days_arr[ i ] + '</span></span>'; 284 } 285 286 cd.find( '.days .numbers' ).html( days_html ); 287 } 288 289 days_prev = days; 290 291 setTimeout(function() { 292 seconds_arr_prev = seconds_arr; 293 minutes_arr_prev = minutes_arr; 294 hours_arr_prev = hours_arr; 295 }, 400 ); 296 297 } 298 299 output(); 300 301 setInterval(function() { 302 output(); 303 }, 1000 ); 304 }); 305 306 // Video 307 308 bt_video_background(); 309 310 // Video pop-up 311 312 $( '.btSinglePostTemplate.video .btSinglePostFormat' ).on( 'click', function() { 313 $( 'body > .btMediaBoxPopup' ).remove(); 314 var $popup = $( this ).closest( '.btSinglePostTemplate' ).find( '.btMediaBoxPopup' ).clone(); 315 var source = $popup.find( 'iframe' ).data( 'src' ); 316 $popup.find( 'iframe' ).attr( 'src', source ); 317 $popup.appendTo( 'body' ); 318 }); 319 320 $( 'body' ).on( 'click', '.btMediaBoxPopupClose', function() { 321 $( 'body > .btMediaBoxPopup' ).remove(); 322 }); 323 324 }); 325 326})( 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.