1/* 2 * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3 * 4 * Template Name: Appmyil - Business Consulting Bootstrap4 Template 5 * Template URI: https://thememarch.com/demo/html/appmyil/ 6 * Description: Appmyil is a business consulting HTML template which comes with the unique and clean design. It helps you to create a beautiful business consulting HTML website. It has also e-commerce support. E-commerce pages are included on this template. 7 * Author: Thememarch 8 * Author URI: https://thememarch.com 9 * Version: 2.0 10 * 11 * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 12 */ 13 14 15/* 16=========================================================== 17 #INDEX# 18=========================================================== 19 20 --> Custom Functions 21 --> Preloader Activation 22 --> Preloader Cancellation 23 --> Inline Background Image 24 --> Slider Activation 25 -> Sreenshot Slider 26 -> Team Slider 27 -> Blog Slider 28 -> Testimonial Slider 29 -> Slider Initializer 30 --> CounterUp Activation 31 --> Funfact Masonry 32 --> Dynamic Pricebox 33 --> Contact Form Effect 34 --> Scroll To Section 35 --> Sticky Header 36 --> Meanmenu Active 37 --> Breadcrumb Padding 38 --> Scrollspy Active 39 --> Fancybox Init 40 --> Mailchimp Activation 41 --> Scorll Up Implememt 42 --> Ease Scroll 43 --> Heroslider ScrollMagic 44 --> Blog Masonry Active 45 --> Ajax Mailer 46 --> Initializer 47 48=========================================================== 49 #END INDEX# 50=========================================================== 51*/ 52 53 54 55(function ($) { 56 "use strict"; 57 58 /* Custom Functions */ 59 jQuery.fn.exists = function () { 60 return this.length > 0; 61 }; 62 63 /* Preloader Activation */ 64 $(window).on('load', function () { 65 $('.tm-preloader').delay(150).fadeOut('slow'); 66 }); 67 68 var smController = new ScrollMagic.Controller(); 69 70 var appmyil = { 71 72 /* Preloader Cancellation */ 73 preloaderCancellation: function () { 74 $('.tm-preloader').find('.tm-button').on('click', function () { 75 $(this).parent('.tm-preloader').fadeOut('slow'); 76 }); 77 }, 78 79 /* Inline Background Image */ 80 dataBgImage: function () { 81 $('[data-bgimage]').each(function () { 82 var imageUrl = $(this).data('bgimage'); 83 $(this).css({ 84 'background-image': 'url(' + imageUrl + ')' 85 }); 86 }); 87 }, 88 89 /* Slider Activation */ 90 sliderActivation: { 91 92 /* Sreenshot Slider */ 93 screenshotSlider: function () { 94 var tmsreenshotSlider = $('.tm-screenshots-slider').slick({ 95 infinite: true, 96 autoplay: false, 97 autoplaySpeed: 5000, 98 slidesToScroll: 1, 99 slidesToShow: 3, 100 centerMode: true, 101 centerPadding: '0', 102 focusOnSelect: true, 103 arrows: true, 104 prevArrow: '<button class="tm-slider-arrow-prev"><i class="zmdi zmdi-long-arrow-left"></i></button>', 105 nextArrow: '<button class="tm-slider-arrow-next"><i class="zmdi zmdi-long-arrow-right"></i></button>', 106 dots: false, 107 responsive: [{ 108 breakpoint: 992, 109 settings: { 110 slidesToShow: 3, 111 slidesToScroll: 1, 112 } 113 }, 114 { 115 breakpoint: 576, 116 settings: { 117 slidesToShow: 1, 118 slidesToScroll: 1 119 } 120 } 121 ] 122 }); 123 }, 124 125 /* Team Slider */ 126 teamMemberSlider: function () { 127 $('.tm-team-slider').slick({ 128 infinite: true, 129 autoplay: true, 130 autoplaySpeed: 5000, 131 slidesToShow: 4, 132 slidesToScroll: 1, 133 arrows: true, 134 prevArrow: '<button class="tm-slider-arrow-prev"><i class="zmdi zmdi-long-arrow-left"></i></button>', 135 nextArrow: '<button class="tm-slider-arrow-next"><i class="zmdi zmdi-long-arrow-right"></i></button>', 136 dots: false, 137 responsive: [{ 138 breakpoint: 1200, 139 settings: { 140 slidesToShow: 3, 141 slidesToScroll: 1, 142 } 143 }, 144 { 145 breakpoint: 992, 146 settings: { 147 slidesToShow: 2, 148 slidesToScroll: 1 149 } 150 }, 151 { 152 breakpoint: 768, 153 settings: { 154 slidesToShow: 1, 155 slidesToScroll: 1 156 } 157 } 158 ] 159 }); 160 }, 161 162 /* Blog Slider */ 163 blogSlider: function () { 164 $('.tm-blog-slider').slick({ 165 infinite: true, 166 autoplay: true, 167 autoplaySpeed: 5000, 168 slidesToShow: 3, 169 slidesToScroll: 1, 170 centerMode: true, 171 centerPadding: '0', 172 focusOnSelect: true, 173 arrows: true, 174 prevArrow: '<button class="tm-slider-arrow-prev"><i class="zmdi zmdi-long-arrow-left"></i></button>', 175 nextArrow: '<button class="tm-slider-arrow-next"><i class="zmdi zmdi-long-arrow-right"></i></button>', 176 dots: false, 177 responsive: [{ 178 breakpoint: 992, 179 settings: { 180 slidesToShow: 2, 181 slidesToScroll: 1, 182 } 183 }, 184 { 185 breakpoint: 768, 186 settings: { 187 slidesToShow: 1, 188 slidesToScroll: 1, 189 adaptiveHeight: true, 190 } 191 } 192 ] 193 }); 194 }, 195 196 /* Testimonial Slider */ 197 testimonialSlider: function () { 198 $('.tm-testimonial-contents').slick({ 199 slidesToShow: 1, 200 slidesToScroll: 1, 201 fade: true, 202 asNavFor: '.tm-testimonial-authors', 203 autoplay: true, 204 arrows: true, 205 prevArrow: '<button class="tm-slider-arrow-prev"><i class="zmdi zmdi-long-arrow-left"></i></button>', 206 nextArrow: '<button class="tm-slider-arrow-next"><i class="zmdi zmdi-long-arrow-right"></i></button>', 207 }); 208 209 $('.tm-testimonial-authors').slick({ 210 slidesToShow: 3, 211 slidesToScroll: 1, 212 asNavFor: '.tm-testimonial-contents', 213 dots: false, 214 centerMode: true, 215 centerPadding: 0, 216 focusOnSelect: true, 217 autoplay: true, 218 }); 219 }, 220 221 /* Slider Initializer */ 222 init: function () { 223 appmyil.sliderActivation.screenshotSlider(); 224 appmyil.sliderActivation.teamMemberSlider(); 225 appmyil.sliderActivation.blogSlider(); 226 appmyil.sliderActivation.testimonialSlider(); 227 } 228 }, 229 230 /* CounterUp Activation */ 231 counterupActivation: function () { 232 if ($('.odometer').length) { 233 $(window).on('scroll', function () { 234 function winScrollPosition() { 235 var scrollPos = $(window).scrollTop(), 236 winHeight = $(window).height(); 237 var scrollPosition = Math.round(scrollPos + (winHeight / 1.2)); 238 return scrollPosition; 239 } 240 var elemOffset = $('.odometer').offset().top; 241 if (elemOffset < winScrollPosition()) { 242 243 $('.odometer').each(function () { 244 $(this).html($(this).data('count-to')); 245 }); 246 } 247 }); 248 } 249 }, 250 251 /* Funfact Masonry */ 252 funfactMasonryActive: function () { 253 $('.tm-funfact-wrapper').masonry({ 254 itemSelector: '.tm-funfact-masonryitem', 255 columnWidth: 1, 256 }); 257 }, 258 259 /* Dynamic Pricebox */ 260 dynamicPricebox: function () { 261 262 function activeKey() { 263 $('.tm-pricebox-switchbuttons').find('button').on('click', function () { 264 $(this).addClass('is-active').siblings('button').removeClass('is-active'); 265 }); 266 return $('.tm-pricebox-switchbuttons').find('button.is-active').data('keyvalue'); 267 } 268 269 function priceChanger() { 270 $('.tm-pricebox-price-digit').each(function () { 271 var monthlyPrice = $(this).data('pricebox-price-monthly'); 272 var yearlyPrice = $(this).data('pricebox-price-yearly'); 273 274 if (activeKey() === 'monthly') { 275 $(this).text(monthlyPrice); 276 } else { 277 $(this).text(yearlyPrice); 278 } 279 }); 280 281 } 282 priceChanger(); 283 284 function textChanger() { 285 $('.tm-pricebox-price-time').each(function () { 286 var monthlyText = $(this).data('monthly-text'); 287 var yearlyText = $(this).data('yearly-text'); 288 289 if (activeKey() === 'monthly') { 290 $(this).text(monthlyText); 291 } else { 292 $(this).text(yearlyText); 293 } 294 }); 295 } 296 textChanger(); 297 298 $('.tm-pricebox-switchbuttons').find('button').on('click', function () { 299 priceChanger(); 300 textChanger(); 301 }); 302 303 }, 304 305 /* Contact Form Effect */ 306 contactFormEffect: function () { 307 $('.tm-form-field').on('focus', 'input, textarea', function () { 308 $(this).siblings('.tm-form-animatedline').css('width', '100%'); 309 }); 310 $('.tm-form-field').on('focusout', 'input, textarea', function () { 311 $(this).siblings('.tm-form-animatedline').css('width', 0); 312 var $this = $(this); 313 if ($this.val().trim().length !== 0) { 314 $(this).siblings('.tm-form-animatedline').css('width', '100%'); 315 } 316 }); 317 }, 318 319 /* Scroll To Section */ 320 scrollToSection: function () { 321 $('.tm-heroslider-scrolldown').on('click', function (event) { 322 event.preventDefault(); 323 var $anchor = $(this); 324 $('html, body').stop().animate({ 325 scrollTop: ($($anchor.attr('href')).offset().top - 65) 326 }, 1000); 327 }); 328 }, 329 330 /* Sticky Header */ 331 stickyHeaderActive: function () { 332 $(window).on('scroll', function () { 333 if ($(this).scrollTop() >= 1) { 334 $('.tm-sticky-header').addClass('is-sticky'); 335 } else { 336 $('.tm-sticky-header').removeClass('is-sticky'); 337 } 338 }); 339 }, 340 341 /* Meanmenu Active */ 342 meanmenuActive: function () { 343 $('nav.tm-navigation').meanmenu({ 344 meanMenuContainer: '.tm-mobilenav', 345 meanScreenWidth: '991', 346 meanMenuOpen: '<i class="zmdi zmdi-menu"></i>', 347 meanMenuClose: '<i class="zmdi zmdi-close"></i>', 348 }); 349 350 $('.tm-mobilenav nav.mean-nav li a').on('click', function (event) { 351 event.preventDefault(); 352 var $anchor = $(this); 353 $('html, body').stop().animate({ 354 scrollTop: ($($anchor.attr('href')).offset().top - 65) 355 }, 1000); 356 }); 357 }, 358 359 /* Breadcrumb Padding */ 360 breadcrumbPadding: function () { 361 if ($('.tm-header-fixed').exists()) { 362 var headerHeight = $('.tm-header-fixed').innerHeight(); 363 $('.tm-breadcrumb').css({ 364 'paddingTop': headerHeight + 'px' 365 }); 366 } 367 }, 368 369 /* Scrollspy Active */ 370 scrollSpyActive: function () { 371 $('.tm-navigation').scrollspy({ 372 offset: -65, 373 activeClass: 'current', 374 animate: 'swing', 375 }); 376 }, 377 378 /* Fancybox Init */ 379 fancyboxInit: function () { 380 $('[data-fancybox]').fancybox(); 381 }, 382 383 /* Mailchimp Activation */ 384 ajaxMailchimp: function () { 385 $('#tm-mailchimp-form').ajaxChimp({ 386 language: 'en', 387 callback: mailChimpResponse, 388 // ADD YOUR MAILCHIMP URL BELOW HERE! 389 url: 'YOUR_MAILCHIMP_URL_HERE' 390 }); 391 392 function mailChimpResponse(resp) { 393 if (resp.result === 'success') { 394 $('.tm-mailchimp-success').html('' + resp.msg).fadeIn(900);
395 $('.tm-mailchimp-error').fadeOut(400); 396 } else if (resp.result === 'error') { 397 $('.tm-mailchimp-error').html('' + resp.msg).fadeIn(900); 398 } 399 } 400 }, 401 402 /* Scorll Up Implememt */ 403 scrollUpActive: function () { 404 $('<button id="scrollUp"><i class="zmdi zmdi-chevron-up"></i></button>').appendTo('body'); 405 $(window).on('scroll', function () { 406 var winHeight = $(this).height(); 407 var winScrollPos = $(this).scrollTop(); 408 if (winScrollPos > winHeight + 100) { 409 $('#scrollUp').addClass('is-visible'); 410 } else { 411 $('#scrollUp').removeClass('is-visible'); 412 } 413 }); 414 $('#scrollUp').on('click', function () { 415 $('html, body').animate({ 416 scrollTop: 0 417 }, 'slow'); 418 return false; 419 }); 420 }, 421 422 /* Ease Scroll */ 423 easeScrollActive: function () { 424 $('html').easeScroll(); 425 }, 426 427 /* Heroslider ScrollMagic */ 428 herosliderScrollMagic: function () { 429 var winWidth = $(window).width(); 430 if (winWidth >= 992) { 431 new ScrollMagic.Scene({ 432 duration: 0, 433 offset: 0 434 }).setPin('.tm-heroslider-inner', { 435 pushFollowers: false 436 }).addTo(smController); 437 438 $(window).on('scroll', function () { 439 var winScrollPos = $(this).scrollTop(); 440 var opacity = 1 - (winScrollPos / 750); 441 $('.tm-heroslider-content, .tm-heroslider-mobileshow ').css({ 442 'opacity': opacity, 443 }); 444 }); 445 } 446 }, 447 448 /* Blog Masonry Active */ 449 blogMasonryActive: function () { 450 $('.blog-masonry-active').masonry({ 451 itemSelector: '.blog-masonry-item' 452 }); 453 }, 454 455 /* Ajax Mailer */ 456 ajaxMailer: function () { 457 // Get the form. 458 var form = $('#tm-contactform'); 459 460 // Get the messages div. 461 var formMessages = $('.form-messages'); 462 463 // TODO: The rest of the code will go here... 464 465 // Set up an event listener for the contact form. 466 $(form).submit(function (event) { 467 // Stop the browser from submitting the form. 468 event.preventDefault(); 469 470 // Serialize the form data. 471 var formData = $(form).serialize(); 472 473 // Submit the form using AJAX. 474 $.ajax({
475 type: 'POST', 476 url: $(form).attr('action'), 477 data: formData 478 }) 479 480 481 .done(function (response) { 482 // Make sure that the formMessages div has the 'success' class. 483 $(formMessages).removeClass('error'); 484 $(formMessages).addClass('success'); 485 486 // Set the message text. 487 $(formMessages).text(response); 488 489 // Clear the form. 490 $('#tm-contactform input:not([type="submit"]), #tm-contactform textarea').val(''); 491 }) 492 493 .fail(function (data) { 494 // Make sure that the formMessages div has the 'error' class. 495 $(formMessages).removeClass('success'); 496 $(formMessages).addClass('error'); 497 498 // Set the message text. 499 if (data.responseText !== '') { 500 $(formMessages).text(data.responseText); 501 } else { 502 $(formMessages).text('Oops! An error occured and your message could not be sent.'); 503 } 504 }); 505 }); 506 }, 507 508 /* Service Image Anim */ 509 serviceImageAnim: function () { 510 setInterval(function () { 511 $('.tm-service-image-1').toggleClass('is-visible'); 512 $('.tm-service-image-2').toggleClass('is-visible'); 513 }, 5000); 514 }, 515 516 /* Initializer */ 517 init: function () { 518 appmyil.preloaderCancellation(); 519 appmyil.dataBgImage(); 520 appmyil.sliderActivation.init(); 521 appmyil.counterupActivation(); 522 appmyil.funfactMasonryActive(); 523 appmyil.dynamicPricebox(); 524 appmyil.contactFormEffect(); 525 appmyil.scrollToSection(); 526 appmyil.stickyHeaderActive(); 527 appmyil.meanmenuActive(); 528 appmyil.breadcrumbPadding(); 529 appmyil.scrollSpyActive(); 530 appmyil.fancyboxInit(); 531 appmyil.ajaxMailchimp(); 532 appmyil.scrollUpActive(); 533 appmyil.easeScrollActive(); 534 appmyil.herosliderScrollMagic(); 535 appmyil.blogMasonryActive(); 536 appmyil.ajaxMailer(); 537 appmyil.serviceImageAnim(); 538 } 539 }; 540 541 appmyil.init(); 542 543 544})(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.