1/* Template: Evolo - StartUp HTML Landing Page Template 2 Author: Inovatik 3 Created: June 2019 4 Description: Custom JS file 5*/ 6 7 8(function($) { 9 "use strict"; 10 11 /* Preloader */ 12 // $(window).on('load', function() { 13 // var preloaderFadeOutTime = 200; 14 // function hidePreloader() { 15 // var preloader = $('.spinner-wrapper'); 16 // setTimeout(function() { 17 // preloader.fadeOut(preloaderFadeOutTime); 18 // }, 200); 19 // } 20 // hidePreloader(); 21 // }); 22 23 24 /* Navbar Scripts */ 25 // jQuery to collapse the navbar on scroll 26 $(window).on('scroll load', function() { 27 if ($(".navbar").offset().top > 60) { 28 $(".fixed-top").addClass("top-nav-collapse"); 29 } else { 30 $(".fixed-top").removeClass("top-nav-collapse"); 31 } 32 }); 33 34 // jQuery for page scrolling feature - requires jQuery Easing plugin 35 $(function() { 36 $(document).on('click', 'a.page-scroll', function(event) { 37 var $anchor = $(this); 38 $('html, body').stop().animate({ 39 scrollTop: $($anchor.attr('href')).offset().top 40 }, 600, 'easeInOutExpo'); 41 event.preventDefault(); 42 }); 43 }); 44 45 // closes the responsive menu on menu item click 46 $(".navbar-nav li a").on("click", function(event) { 47 if (!$(this).parent().hasClass('dropdown')) 48 $(".navbar-collapse").collapse('hide'); 49 }); 50 51 52 /* Image Slider - Swiper */ 53 var imageSlider = new Swiper('.image-slider', { 54 autoplay: { 55 delay: 2000, 56 disableOnInteraction: false 57 }, 58 loop: true, 59 spaceBetween: 30, 60 slidesPerView: 5, 61 breakpoints: { 62 // when window is <= 580px 63 580: { 64 slidesPerView: 1, 65 spaceBetween: 10 66 }, 67 // when window is <= 768px 68 768: { 69 slidesPerView: 2, 70 spaceBetween: 20 71 }, 72 // when window is <= 992px 73 992: { 74 slidesPerView: 3, 75 spaceBetween: 20 76 }, 77 // when window is <= 1200px 78 1200: { 79 slidesPerView: 4, 80 spaceBetween: 20 81 }, 82 83 } 84 }); 85 86 87 /* Card Slider - Swiper */ 88 var cardSlider = new Swiper('.card-slider', { 89 autoplay: { 90 delay: 4000, 91 disableOnInteraction: false 92 }, 93 loop: true, 94 navigation: { 95 nextEl: '.swiper-button-next', 96 prevEl: '.swiper-button-prev' 97 } 98 }); 99 100 101 /* Video Lightbox - Magnific Popup */ 102 $('.popup-youtube, .popup-vimeo').magnificPopup({ 103 disableOn: 700, 104 type: 'iframe', 105 mainClass: 'mfp-fade', 106 removalDelay: 160, 107 preloader: false, 108 fixedContentPos: false, 109 iframe: { 110 patterns: { 111 youtube: { 112 index: 'youtube.com/', 113 id: function(url) { 114 var m = url.match(/[\\?\\&]v=([^\\?\\&]+)/); 115 if ( !m || !m[1] ) return null; 116 return m[1]; 117 }, 118 src: 'https://www.youtube.com/embed/%id%?autoplay=1' 119 }, 120 vimeo: { 121 index: 'vimeo.com/', 122 id: function(url) { 123 var m = url.match(/(https?:\/\/)?(www.)?(player.)?vimeo.com\/([a-z]*\/)*([0-9]{6,11})[?]?.*/); 124 if ( !m || !m[5] ) return null; 125 return m[5]; 126 }, 127 src: 'https://player.vimeo.com/video/%id%?autoplay=1' 128 } 129 } 130 } 131 }); 132 133 134 /* Lightbox - Magnific Popup */ 135 $('.popup-with-move-anim').magnificPopup({ 136 type: 'inline', 137 fixedContentPos: false, /* keep it false to avoid html tag shift with margin-right: 17px */ 138 fixedBgPos: true, 139 overflowY: 'auto', 140 closeBtnInside: true, 141 preloader: false, 142 midClick: true, 143 removalDelay: 300, 144 mainClass: 'my-mfp-slide-bottom' 145 }); 146 147 148 /* Move Form Fields Label When User Types */ 149 // for input and textarea fields 150 $("input, textarea").keyup(function(){ 151 if ($(this).val() != '') { 152 $(this).addClass('notEmpty'); 153 } else { 154 $(this).removeClass('notEmpty'); 155 } 156 }); 157 158 159 /* Request Form */ 160 $("#requestForm").validator().on("submit", function(event) { 161 if (event.isDefaultPrevented()) { 162 // handle the invalid form... 163 rformError(); 164 rsubmitMSG(false, "Por favor, preencha todos os campos!"); 165 } else { 166 // everything looks good! 167 event.preventDefault();
168 rsubmitForm(); 169 } 170 }); 171 172 function rsubmitForm() { 173 // initiate variables with form content 174 var url = $("#contactForm").attr("data-url"); 175 var name = $("#rname").val(); 176 var email = $("#remail").val(); 177 var phone = $("#rphone").val(); 178 var company = $("#rcompany").val(); 179 var tk_name = $("#_tk_name_r").val(); 180 var tk_value = $("#_tk_value_r").val(); 181 182 $.ajax({ 183 type: "POST", 184 url: url, 185 data: "name=" + name + "&email=" + email + "&phone=" + phone + "&company=" + company + "&type=i" + "&" + tk_name + "=" + tk_value, 186 success: function(text) { 187 if (text == "success") { 188 rformSuccess(); 189 } else { 190 rformError(); 191 rsubmitMSG(false, text); 192 } 193 } 194 }); 195 } 196 197 function rformSuccess() { 198 $("#requestForm")[0].reset(); 199 rsubmitMSG(true, "Mensagem enviada!"); 200 $("input").removeClass('notEmpty'); // resets the field label after submission 201 } 202 203 function rformError() { 204 $("#requestForm").removeClass().addClass('shake animated').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() { 205 $(this).removeClass(); 206 }); 207 } 208 209 function rsubmitMSG(valid, msg) { 210 if (valid) { 211 var msgClasses = "h3 text-center tada animated"; 212 } else { 213 var msgClasses = "h3 text-center"; 214 } 215 $("#rmsgSubmit").removeClass().addClass(msgClasses).text(msg); 216 } 217 218 219 /* Contact Form */ 220 $("#contactForm").validator().on("submit", function(event) { 221 if (event.isDefaultPrevented()) { 222 // handle the invalid form... 223 cformError(); 224 csubmitMSG(false, "Por favor! Preencha todos os campos!"); 225 } else { 226 // everything looks good! 227 event.preventDefault(); 228 csubmitForm(); 229 } 230 }); 231 232 function csubmitForm() { 233 // initiate variables with form content 234 var url = $("#contactForm").attr("data-url"); 235 var name = $("#cname").val(); 236 var email = $("#cemail").val(); 237 var phone = $("#cphone").val(); 238 var message = $("#cmessage").val(); 239 var tk_name = $("#_tk_name_c").val(); 240 var tk_value = $("#_tk_value_c").val(); 241 $.ajax({ 242 type: "POST", 243 url: url, 244 data: "name=" + name + "&email=" + email + "&phone=" + phone + "&message=" + message + "&type=c" + "&" + tk_name + "=" + tk_value, 245 success: function(text) { 246 if (text == "success") { 247 cformSuccess(); 248 } else { 249 cformError(); 250 csubmitMSG(false, text); 251 } 252 } 253 }); 254 } 255 256 function cformSuccess() { 257 $("#contactForm")[0].reset(); 258 csubmitMSG(true, "Mensagem enviada!"); 259 $("input").removeClass('notEmpty'); // resets the field label after submission 260 $("textarea").removeClass('notEmpty'); // resets the field label after submission 261 } 262 263 function cformError() { 264 $("#contactForm").removeClass().addClass('shake animated').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() { 265 $(this).removeClass(); 266 }); 267 } 268 269 function csubmitMSG(valid, msg) { 270 if (valid) { 271 var msgClasses = "h3 text-center tada animated"; 272 } else { 273 var msgClasses = "h3 text-center"; 274 } 275 $("#cmsgSubmit").removeClass().addClass(msgClasses).text(msg); 276 } 277 278 279 /* Back To Top Button */ 280 // create the back to top button 281 $('body').prepend('<a href="body" class="back-to-top page-scroll">Back to Top</a>'); 282 var amountScrolled = 700; 283 $(window).scroll(function() { 284 if ($(window).scrollTop() > amountScrolled) { 285 $('a.back-to-top').fadeIn('500'); 286 } else { 287 $('a.back-to-top').fadeOut('500'); 288 } 289 }); 290 291 292 /* Removes Long Focus On Buttons */ 293 $(".button, a, button").mouseup(function() { 294 $(this).blur(); 295 }); 296 297})(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.