1var banner, 2 video, 3 wasFitToHeight = true, 4 pauseButton, 5 testimonialIndex = 0, 6 maxIndex; 7 8jQuery(document).ready(function($) { 9 10 // fit banner video 11 12 banner = $('.banner'); 13 var _window = $(window); 14 15 banner.addClass('visible'); 16 17 fitVideo(); 18 _window.resize(function() { 19 fitVideo(); 20 }); 21 22 video = $('video')[0]; 23 pauseButton = $('#pause_button'); 24 25 if ( !/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { 26 video.play(); 27 pauseButton.removeClass('paused'); 28 } 29 30 // pause video button 31 32 pauseButton.click(function() { 33 if (video.paused === false) { 34 video.pause(); 35 } else if (pauseButton.hasClass('paused')) { 36 video.play(); 37 } 38 pauseButton.toggleClass('paused'); 39 }); 40 pauseButton.on('keypress', function(event) { 41 if (event.key === 'Enter') { 42 pauseButton.click(); 43 } 44 }); 45 46 // testimonials controls 47 48 maxIndex = $('.testimonials .quote').length; 49 50 $('.testimonial_nav.back').click(function() { 51 navTestimonials(-1, null); 52 }); 53 $('.testimonials').on('swiperight', function(event) { 54 navTestimonials(-1, null); 55 }); 56 $('.testimonial_nav.forward').click(function() { 57 navTestimonials(1, null); 58 }); 59 $('.testimonials').on('swipeleft', function(event) { 60 navTestimonials(1, null); 61 }); 62 $('.testimonial_dots span').click(function() { 63 var x = $(this).index(); 64 navTestimonials(null, x); 65 }); 66 67}); 68 69function fitVideo() { 70 71 var isFitToHeight = banner.width() / banner.height() < 1920 / 730; 72 73 if (wasFitToHeight != isFitToHeight) { 74 banner.toggleClass('fit_to_height', isFitToHeight); 75 wasFitToHeight = isFitToHeight; 76 } 77 78} 79function navTestimonials(dir, index) { 80 (function($) { 81 82 if (dir !== null) { 83 testimonialIndex += dir; 84 if (testimonialIndex > maxIndex) testimonialIndex = 1; 85 if (testimonialIndex <= 0) testimonialIndex = maxIndex; 86 } else { 87 testimonialIndex = index + 1; 88 } 89 $('.testimonials .quotes, .testimonials .images').removeClass('active-1 active-2 active-3 active-4 active-5'); 90 $('.testimonials .quotes, .testimonials .images').addClass('active-' + testimonialIndex); 91 $('.testimonial_dots span').removeClass('active'); 92 $('.testimonial_dots span:nth-child(' + testimonialIndex + ')').addClass('active'); 93 94 })(jQuery); 95}
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.