1/*------------------------------------------------------------------ 2 * Website Name: Antler 3 * App URI: http://inebur.com/antler/template/ 4 * Author: inebur 5 * Author URI: http://inebur.com/ 6 * Copyright 2019 Antler 7 * Version: 1.5 8 -------------------------------------------------------------------*/ 9 10document.addEventListener('DOMContentLoaded', function() { 11 "use strict"; 12 loadWindowSettings(); 13 loadWindowEvents(); 14 loadMenu(); 15 loadTabs(); 16 izotope(); 17 popup(); 18 accordion(); 19 loadSwiper(); 20 loadTooltips(); 21 initSliderUI(); 22 loadCountdown(); 23 speacialCount(); 24 loadSkills(); 25 misc(); 26 slick(); 27 listenSlick(); 28 loader(); 29 backtotop(); 30 owldemo(); 31 isotope(); 32 livechat(); 33 contactform(); 34 popover(); 35 scrollgoto(); 36 active(); 37 display(); 38 switching(); 39 headerfooter(); 40 translate(); 41 switchVisible(); 42}); 43//----------------------------------------------------/ 44// SVG Change color style 45//----------------------------------------------------/ 46$("img.svg").each(function () { 47 var $img = jQuery(this); 48 var attributes = $img.prop("attributes"); 49 var imgURL = $img.attr("src"); 50 $.get(imgURL, function (data) { 51 var $svg = $(data).find('svg'); 52 $svg = $svg.removeAttr('xmlns:a'); 53 $.each(attributes, function() { 54 $svg.attr(this.name, this.value); 55 }); 56 $img.replaceWith($svg); 57 }); 58}); 59//----------------------------------------------------/ 60// Styleswitch color style 61//----------------------------------------------------/ 62(function($) { 63 $(document).ready(function() { 64 $(".styleswitch").click(function() { 65 switchStylestyle(this.getAttribute("data-rel")); 66 return false 67 }); 68 }); 69 70 function switchStylestyle(styleName) { 71 $("link[rel*=style][title]").each(function(i) { 72 this.disabled = true; 73 if (this.getAttribute("title") == styleName) this.disabled = false 74 }) 75 } 76})(jQuery); 77//----------------------------------------------------/ 78// Custom VPS - Periodicity 79//----------------------------------------------------/ 80function switchVisible() { 81 if (document.getElementById('price-val')) { 82 if (document.getElementById('price-val').style.display == 'none') { 83 document.getElementById('price-val').style.display = 'block'; 84 document.getElementById('priceon-val').style.display = 'none'; 85 } 86 else { 87 document.getElementById('price-val').style.display = 'none'; 88 document.getElementById('priceon-val').style.display = 'block'; 89 } 90 } 91} 92//----------------------------------------------------/ 93// Active Menu 94//----------------------------------------------------/ 95jQuery(function($) { 96 var path = window.location.href; 97 $('#menu ul li a').each(function() { 98 if (this.href === path) { 99 $(this).addClass('active'); 100 $( this ).parent().parent().closest("li").addClass('active2'); 101 $('.active2 a:first').addClass('active'); 102 } 103 }); 104}); 105//----------------------------------------------------/ 106// Open Menu Mobile 107//----------------------------------------------------/ 108$(".mobile .menu-item").on('click', 109 function() { 110 if ($(".sub-menu", this).css('display') === 'none') { 111 $(".sub-menu", this).css("display", "block"); 112 } else { 113 $(".sub-menu", this).css("display", "none"); 114 } 115 } 116); 117//----------------------------------------------------/ 118// i18next translate 119//----------------------------------------------------/ 120function translate(){ 121 $.getScript('js/lib/i18next.min.js', function() { 122 $.getScript('js/lib/i18nextXHRBackend.min.js', function() { 123 $.getScript('js/lib/jquery-i18next.min.js', function() { 124 var language = localStorage.getItem('lng'); 125 126 if (!language) { 127 localStorage.setItem('lng', 'en-US'); 128 language = 'en-US'; 129 } 130 i18next.use(i18nextXHRBackend).init({ 131 lng: language, 132 fallbackLng: 'en-US', 133 backend: { 134 loadPath: 'locales/{{lng}}/translations.json' 135 } 136 }, function(err, t) { 137 jqueryI18next.init(i18next, $, { 138 tName: 't', 139 i18nName: 'i18n', 140 handleName: 'localize', 141 selectorAttr: 'data-i18n', 142 targetAttr: 'i18n-target', 143 optionsAttr: 'i18n-options', 144 useOptionsAttr: false, 145 parseDefaultValueFromContent: true 146 }); 147 $(document).localize(); 148 }); 149 }); 150 }); 151 }); 152} 153/*---------------------------------*/ 154/* Load header and footer file */ 155/*---------------------------------*/ 156function headerfooter(){ 157 $("#header").load("header.html", function(res, status, xhr){ 158 $('#drop-lng [data-lng="' + localStorage.getItem('lng') + '"]').addClass('xpto active'); 159 $('#drop-lng label').click(function(e){ 160 e.preventDefault(); 161 localStorage.setItem('lng', $(this).attr('data-lng')); 162 location.reload(true); 163 }); 164 }); 165 $("#footer").load("footer.html", function(res, status, xhr){ 166 $('#drop-lng [data-lng="' + localStorage.getItem('lng') + '"]').addClass('xpto active'); 167 $('#drop-lng label').click(function(e){ 168 e.preventDefault(); 169 localStorage.setItem('lng', $(this).attr('data-lng')); 170 location.reload(true); 171 }); 172 }); 173} 174/*----------------------*/ 175/* Switch */ 176/*----------------------*/ 177function switching(){ 178 $(window).on('load',function(){ 179 var dToggle = $('#run-switch'); 180 var planPeriod = $('.price-content .period', '.price-container'); 181 dToggle.on('click', function(){ 182 $('.mo',this).toggleClass('active'); 183 $('.an',this).toggleClass('active'); 184 $('.month',this).toggleClass('active'); 185 $('.switch',this).toggleClass('on'); 186 $('.year',this).toggleClass('active'); 187 188 if(planPeriod.hasClass('annually')){ 189 planPeriod.text('month'); 190 for(var i=0;i<=2;i++){ 191 $('.price-container:eq('+i+') .value').text(parseFloat(Number($('.price-container:eq('+i+') .value').text())/12).toFixed(2)); 192 } 193 }else{ 194 planPeriod.text('year'); 195 for(var i=0;i<=2;i++){ 196 $('.price-container:eq('+i+') .value').text(parseFloat(Number($('.price-container:eq('+i+') .value').text())*12).toFixed(2)); 197 } 198 } 199 planPeriod.toggleClass('annually'); 200 }); 201 }); 202} 203/*----------------------*/ 204/* Full Nav Open */ 205/*----------------------*/ 206function openNav() { 207 document.getElementById('myNav').style.display = 'block'; 208 } 209function closeNav() { 210 document.getElementById('myNav').style.display = 'none'; 211} 212/*----------------------*/ 213/* Display & Hide */ 214/*----------------------*/ 215function display() { 216 $('#showall').on("click", function(){ 217 $('.targetDiv').show(); 218 }); 219 $('.showSingle').on("click", function(){ 220 $('.targetDiv').hide(); 221 $('#div'+$(this).attr('target')).show(); 222 }); 223} 224/*----------------------*/ 225/* Active Button */ 226/*----------------------*/ 227function active() { 228 $(".heading a").on("click", function(){ 229 $(".heading a").removeClass("active"); 230 $(this).addClass("active"); 231 }); 232} 233/*----------------------*/ 234/* Scroll Goto */ 235/*----------------------*/ 236function scrollgoto(){ 237 $('.gocheck').on('click', function(event) { 238 var target = $(this.getAttribute('href')); 239 if( target.length ) { 240 event.preventDefault(); 241 $('html, body').stop().animate({ 242 scrollTop: target.offset().top 243 }, 1000); 244 } 245 }); 246} 247/*----------------------*/ 248/* Popover */ 249/*----------------------*/ 250function popover(){ 251 $('[data-toggle="popover"]').popover() 252} 253/*----------------------*/ 254/* Contact Form */ 255/*----------------------*/ 256function contactform() { 257 $('#contactForm').on('submit', function(e) { 258 $.ajax({ 259 type: "POST", 260 url:'php/form-process.php', 261 data: $(this).serialize(), 262 success: function() { 263 $('#msgSubmit').fadeIn(100).show(); 264 } 265 }); 266 e.preventDefault(); 267 }); 268}; 269/*----------------------*/ 270/* Live Chat */ 271/*----------------------*/ 272function livechat(){ 273 var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date(); 274 (function(){ 275 var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0]; 276 s1.async=true; 277 s1.src='https://embed.tawk.to/58127f62c7829d0cd36c88a9/default'; 278 s1.charset='UTF-8'; 279 s1.setAttribute('crossorigin','*'); 280 s0.parentNode.insertBefore(s1,s0); 281 })(); 282} 283/*----------------------*/ 284/* Isotope */ 285/*----------------------*/ 286function isotope(){ 287 $(window).on('load', function(){ 288 var selectedCategory; 289 var $grid = $('.featured').isotope({ 290 itemSelector: '.isotope-item', 291 masonry: { 292 columnWidth: '.isotope-item', 293 }, 294 getSortData: { 295 selectedCategory: function( itemElem ) { 296 return $( itemElem ).hasClass( selectedCategory ) ? 0 : 1; 297 } 298 } 299 }); 300 var $items = $('.featured').find('.featured-items'); 301 $('.sort-button-group').on( 'click', '.button', function() { 302 selectedCategory = $( this ).attr('data-category'); 303 if ( selectedCategory === 'all' ) { 304 $grid.isotope({ 305 sortBy: 'original-order' 306 }); 307 $items.css({ 308 opacity: 1 309 }); 310 return; 311 } 312 var selectedClass = '.' + selectedCategory; 313 $items.filter( selectedClass ).css({ 314 opacity: 1 315 }); 316 $items.not( selectedClass ).css({ 317 opacity: 0 318 }); 319 $grid.isotope('updateSortData'); 320 $grid.isotope({ sortBy: 'selectedCategory' }); 321 }); 322 323 $('.button-group').each( function( i, buttonGroup ) { 324 var $buttonGroup = $( buttonGroup ); 325 $buttonGroup.on( 'click', 'li', function() { 326 $buttonGroup.find('.active').removeClass('active'); 327 $( this ).addClass('active'); 328 }); 329 }); 330 331 }); 332} 333/*----------------------*/ 334/* OWL */ 335/*----------------------*/ 336function owldemo(){ 337$('.owl-carousel').owlCarousel({ 338 onInitialized:theThing, 339 nav:false, 340 singleItem:true, 341 autoHeight:true, 342 dots:true, 343 center:true, 344 margin:0, 345 padding:0, 346 animateOut: 'fadeOut', 347 348 items:1, 349 autoPlay:5500, 350 stopOnHover:true, 351 center:true, 352 navigation:false, 353 pagination:false, 354 goToFirstSpeed : 1300, 355 singleItem:true, 356 autoHeight:true, 357 responsive:true, 358 responsiveRefreshRate:200, 359 responsiveBaseWidth: window, 360 video:true, 361 362 autoplay:true, 363 autoplayTimeout:9000, 364 autoplayHoverPause:true, 365 navText: [ 366 "<i class='fa fa-chevron-left'></i>", 367 "<i class='fa fa-chevron-right'></i>" 368 ], 369 responsive:{ 370 0:{ 371 items:1 372 }, 373 } 374}); 375function theThing(event){ 376 $(".active .owl-video-play-icon").trigger("click") 377} 378} 379/*----------------------*/ 380/* Back to top */ 381/*----------------------*/ 382function backtotop(){ 383 // browser window scroll (in pixels) after which the "back to top" link is shown
384 var offset = 300, 385 //browser window scroll (in pixels) after which the "back to top" link opacity is reduced 386 offset_opacity = 1200, 387 //duration of the top scrolling animation (in ms) 388 scroll_top_duration = 700, 389 //grab the "back to top" link 390 $back_to_top = $('.cd-top'); 391 //hide or show the "back to top" link 392 $(window).scroll(function(){ 393 ( $(this).scrollTop() > offset ) ? $back_to_top.addClass('cd-is-visible') : $back_to_top.removeClass('cd-is-visible cd-fade-out'); 394 if( $(this).scrollTop() > offset_opacity ) { 395 $back_to_top.addClass('cd-fade-out'); 396 } 397 }); 398 //smooth scroll to top 399 $back_to_top.on('click', function(event){ 400 event.preventDefault(); 401 $('body,html').animate({ 402 scrollTop: 0 , 403 }, scroll_top_duration 404 ); 405 }); 406} 407/*----------------------*/ 408/* Loader */ 409/*----------------------*/ 410function loader() { 411 $(window).on('load', function() { 412 $("#spinner-area").fadeOut("slow"); 413 }) 414} 415/*----------------------*/ 416/* Listen Slick */ 417/*----------------------*/ 418function listenSlick(){ 419 $('.slick').on('unslick', function(){ 420 var resizeCheck = setInterval(function(){ 421 if ($(window).width() > 590) { 422 clearInterval(resizeCheck); 423 slick(); 424 } 425 },100); 426 }); 427} 428/*----------------------*/ 429/* Slick Slider */ 430/*----------------------*/ 431function slick() { 432 $('#slider').slick({ 433 centerMode: true, 434 centerPadding: '200px', 435 slidesToShow: 3, 436 infinite: true, 437 arrows: true, 438 responsive: [ 439 { 440 breakpoint: 1200, 441 settings: { 442 arrows: true, 443 centerMode: true, 444 centerPadding: '100px', 445 slidesToShow: 3 446 } 447 }, 448 { 449 breakpoint: 991, 450 settings: { 451 arrows: true, 452 centerMode: true, 453 centerPadding: '200px', 454 slidesToShow: 1 455 } 456 }, 457 { 458 breakpoint: 768, 459 settings: { 460 arrows: true, 461 centerMode: true, 462 centerPadding: '150px', 463 slidesToShow: 1 464 } 465 }, 466 { 467 breakpoint: 590, 468 settings: "unslick" 469 } 470 ] 471 }); 472} 473/*----------------------*/ 474/* Popup */ 475/*----------------------*/ 476function popup() { 477 if ($('.popup-with-form').length) { 478 $('.popup-with-form').magnificPopup({ 479 type: 'image', 480 preloader: true, 481 focus: '#name', 482 closeOnBgClick: true, 483 callbacks: { 484 beforeOpen: function() { 485 if ($(window).width() < 700) { 486 this.st.focus = false; 487 } else { 488 this.st.focus = '#name'; 489 } 490 } 491 } 492 493 }); 494 } 495 $('.gallery-item').magnificPopup({ 496 delegate: 'a', 497 type: 'image', 498 tLoading: 'Loading image #%curr%...', 499 mainClass: 'mfp-img-mobile', 500 gallery: { 501 enabled: true, 502 navigateByImgClick: true, 503 preload: [0, 1] 504 }, 505 }); 506 // Initialize popup as usual 507 $('.image-link').magnificPopup({ 508 type: 'image', 509 mainClass: 'mfp-with-zoom', 510 gallery: { 511 enabled: true, 512 navigateByImgClick: true, 513 preload: [0, 1] 514 }, 515 image: { 516 // options for image content type 517 titleSrc: 'title' 518 }, 519 zoom: { 520 enabled: true, 521 navigateByImgClick: true, 522 duration: 300, 523 easing: 'ease-in-out', 524 opener: function(openerElement) { 525 return openerElement.is('img') ? openerElement : openerElement.find('img'); 526 } 527 }, 528 529 }); 530} 531$(document).ready(function() { 532 $('.popup-youtube, .popup-vimeo, .popup-gmaps').magnificPopup({ 533 disableOn: 700, 534 type: 'iframe', 535 mainClass: 'mfp-fade', 536 removalDelay: 160, 537 preloader: false, 538
539 fixedContentPos: false 540 }); 541}); 542 543function misc() { 544 /*----------------------*/ 545 /* Modal */ 546 /*----------------------*/ 547 $('#myModal').on('shown.bs.modal', function() { 548 $('#myInput').focus() 549 }) 550} 551/*----------------------*/ 552/* Swiper */ 553/*----------------------*/ 554var swipers = []; 555function loadSwiper() { 556 $('.swiper-container').each(function(i) { 557 $(this).attr({ 558 'id': i + '-slider' 559 }); 560 }); 561 swiperInit(); 562 $('.slide-prev').on('click', function() { 563 swipers['swiper-' + $(this).closest('.slider-wrap').find('.swiper-container').attr('id')].swipePrev(); 564 return false; 565 }); 566 $('.slide-next').on('click', function() { 567 swipers['swiper-' + $(this).closest('.slider-wrap').find('.swiper-container').attr('id')].swipeNext(); 568 return false; 569 }); 570} 571/*-------------------------*/ 572/* Tooltips */ 573/*-------------------------*/ 574function loadTooltips() { 575 $('#element').tooltip('show') 576 $(function() { 577 $('[data-toggle="tooltip"]').tooltip() 578 }) 579} 580$(function () { 581 $('[data-toggle="tooltip"]').tooltip() 582}) 583/*-------------------------*/ 584/* Slider */ 585/*-------------------------*/ 586function initSliderUI() { 587 var initIterator = 0; 588 if ($(".slider-ui").length) { 589 $(".slider-ui").each(function() { 590 var self = $(this), 591 sliderUI = self.find('.slider-line'), 592 sliderInp = self.find('.slider-inp'), 593 sliderUniqueId = 'sliderUI' + initIterator, 594 inputUniqueId = 'inputUI' + initIterator, 595 start = parseInt(sliderInp.attr('data-start')), 596 count_step = parseInt(sliderInp.attr('data-count-step')); 597 sliderUI.attr('id', sliderUniqueId); 598 sliderInp.attr('id', inputUniqueId); 599 initIterator++; 600 count_step = count_step ? count_step : 300; 601 var keypressSlider = document.getElementById(sliderUniqueId), 602 input = document.getElementById(inputUniqueId); 603 noUiSlider.create(keypressSlider, { 604 start: start ? start : 1, 605 step: 1, 606 connect: "lower", 607 tooltips: true, 608 format: { 609 to: function(value) { 610 return "VPS" + value; 611 //return parseInt(value); 612 }, 613 from: function(value) { 614 return value; 615 } 616 }, 617 range: { 618 'min': 1, 619 'max': count_step 620 }, 621 pips: { 622 mode: 'values', 623 values: [1, 2, 3, 4, 5], 624 density: 5, 625 stepped: true 626 } 627 }); 628 629 // Calculate Docker Product second and third diagram 630 function getValue2(values, handle, unencoded, tap) { 631 var circle = $(this.target).closest('.sidebar').find('.circle'); 632 circle.attr('data-percent', parseInt(unencoded) / count_step * 100); 633 } 634 keypressSlider.noUiSlider.on('change', getValue2); 635 keypressSlider.noUiSlider.on('update', function(values, handle) { 636 refreshInfo(values[handle]); 637 input.value = values[handle]; 638 change_global_cloud_pkgs_href(values[handle]); 639 }); 640 input.addEventListener('change', function() { 641 keypressSlider.noUiSlider.set([null, this.value]); 642 }); 643 // Listen to keydown events on the input field. 644 input.addEventListener('keydown', function(e) { 645 // Convert the string to a number. 646 var value = Number(keypressSlider.noUiSlider.get()), 647 sliderStep = keypressSlider.noUiSlider.steps() 648 // Select the stepping for the first handle. 649 sliderStep = sliderStep[0]; 650 // 13 is enter, 651 // 38 is key up, 652 // 40 is key down. 653 switch (e.which) { 654 case 13: 655 keypressSlider.noUiSlider.set(this.value); 656 break; 657 case 38: 658 keypressSlider.noUiSlider.set(value + sliderStep[1]); 659 break; 660 case 40: 661 keypressSlider.noUiSlider.set(value - sliderStep[0]); 662 break; 663 } 664 }); 665 function getServicesInfo() { 666 var info = { 667 VPS1: { 668 name: "Service A", 669 disk: "100GB", 670 ram: "1GB", 671 cpu: "1 Core", 672 bandwith: "100GB", 673 setup: "8â¬", 674 ip: "2 IPs", 675 price: "99.09", 676 priceon: "8.26", 677 orderlink: "http://inebur.com/whmcs/cart.php?a=confproduct&i=0" 678 }, 679 VPS2: { 680 name: "Service B", 681 disk: "200GB", 682 ram: "4GB", 683 cpu: "2 Core", 684 setup: "15â¬", 685 ip: "4 IPs", 686 bandwith: "500GB", 687 price: "155.00", 688 priceon: "12.92", 689 orderlink: "http://inebur.com/whmcs/cart.php?a=confproduct&i=1" 690 }, 691 VPS3: { 692 name: "Service C", 693 disk: "300GB", 694 ram: "8GB", 695 cpu: "4 Core", 696 setup: "Free", 697 ip: "8 IPs", 698 bandwith: "2TB", 699 price: "299.99", 700 priceon: "25.00", 701 orderlink: "http://inebur.com/whmcs/cart.php?a=confproduct&i=2" 702 }, 703 VPS4: { 704 name: "Service D", 705 disk: "400GB", 706 ram: "12GB", 707 cpu: "4 Core", 708 setup: "Free", 709 ip: "8 IPs", 710 bandwith: "Unlimited", 711 price: "395.22", 712 priceon: "32.94", 713 orderlink: "http://inebur.com/whmcs/cart.php?a=confproduct&i=3" 714 }, 715 VPS5: { 716 name: "Service E", 717 disk: "500GB", 718 ram: "16GB", 719 cpu: "8 Core", 720 setup: "Free", 721 ip: "12 IPs", 722 bandwith: "Unlimited", 723 price: "545.00", 724 priceon: "45.42", 725 orderlink: "http://inebur.com/whmcs/cart.php?a=confproduct&i=4" 726 } 727 }; 728 return info; 729 } 730 function refreshInfo(key){ 731 var info = getServicesInfo(); 732 $("#disk-val").html(info[key].disk); 733 $("#cpu-val").html(info[key].cpu); 734 $("#ram-val").html(info[key].ram); 735 $("#setup-val").html(info[key].setup); 736 $("#ip-val").html(info[key].ip); 737 $("#bw-val").html(info[key].bandwith); 738 $("#price-val").html(info[key].price); 739 $("#priceon-val").html(info[key].priceon); 740 $("#orderlink-val").html(info[key].orderlink); 741 } 742 function change_global_cloud_pkgs_href(key) { 743 var info = getServicesInfo(); 744 $("#orderlink").attr("href", info[key].orderlink); 745 } 746 }); 747 } 748} 749/*-------------------------*/ 750/* Menu */ 751/*-------------------------*/ 752function loadMenu() { 753 $(".nav-menu .menu-toggle").on("click", function() { 754 $(this).closest(".menu-wrap").toggleClass("active"); 755 }); 756 $('.btn-scroll').on("click", function() { 757 $('html, body').animate({ 758 scrollTop: $($.attr(this, 'href')).offset().top - 10 759 }, 500); 760 return false;
761 }); 762} 763/*-------------------------*/ 764/* Izotope */ 765/*-------------------------*/ 766function izotope() { 767 if ($('.izotope-container').length) { 768 var $container = $('.izotope-container'); 769 $container.isotope({ 770 itemSelector: '.item', 771 layoutMode: 'masonry', 772 masonry: { 773 columnWidth: '.item' 774 } 775 }); 776 } 777 $('#filters').on('click', '.but', function() { 778 $('.izotope-container').each(function() { 779 $(this).find('.item').removeClass('animated'); 780 }); 781 $('#filters .but').removeClass('activbut'); 782 $(this).addClass('activbut'); 783 var filterValue = $(this).attr('data-filter'); 784 $container.isotope({ 785 filter: filterValue 786 }); 787 }); 788} 789/*-------------------------*/ 790/* Tabs */ 791/*-------------------------*/ 792function loadTabs() { 793 $('.tabs-header').on('click', 'li:not(.active)', function() { 794 var index_el = $(this).index(); 795 $(this).addClass('active').siblings().removeClass('active'); 796 $(this).closest('.tabs').find('.tabs-item').removeClass('active').eq(index_el).addClass('active'); 797 }); 798} 799/*----------------------*/ 800/* Accordion */ 801/*----------------------*/ 802function accordion() { 803 $('.accordion').on('click', '.panel-title', function() { 804 var self = $(this); 805 var panelWrap = self.parent(); 806 panelWrap.find('.panel-collapse').slideToggle('200'); 807 self.toggleClass('active'); 808 panelWrap.siblings().find('.panel-collapse').slideUp('200'); 809 panelWrap.siblings().find('.panel-title').removeClass('active'); 810 }); 811 accordHeight(); 812} 813function accordHeight() { 814 $(".accordion.faq .square").each(function() { 815 $(this).css({ 816 "height": $(this).parent().outerHeight(true), 817 "padding-top": $(this).parent().outerHeight(true) / 2 - 20 818 }); 819 }); 820} 821/*-------------------------*/ 822/* SKILLS */ 823/*-------------------------*/ 824function loadSkills() { 825 //Circle skills 826 $('.circle').not('.animated').each(function() { 827 if ($(window).scrollTop() >= $(this).offset().top - $(window).height() * 0.7) { 828 $(this).addClass('animated').circliful(); 829 } 830 }); 831} 832/*-------------------------*/ 833/* Select */ 834/*-------------------------*/ 835function selectInit() { 836 $('.selectpicker').each(function() { 837 var self = $(this); 838 var selectStyle = self.attr('data-class'); //additional style attribute, not required 839 self.selectpicker({ 840 style: 'cst-select ' + selectStyle //add classes to customize select field 841 }); 842 }); 843} 844function loadWindowEvents() { 845 /*-------------------------*/ 846 /* Run Resize Functions */ 847 /*-------------------------*/ 848 $(window).on("resize", function() { 849 offheight(); 850 accordHeight(); 851 }); 852 /*-------------------------*/ 853 /* RUN SCROLL FUNCTIONS */ 854 /*-------------------------*/ 855 $(window).on("scroll", function() { 856 loadSkills(); 857 }); 858 /*-------------------------*/ 859 /* RUN SCROLL FUNCTIONS */ 860 /*-------------------------*/ 861 $(window).on('scroll', function(){ 862 if ($(window).scrollTop() >= 100) { 863 $('.menu-wrap').addClass('fixed'); 864 } else { 865 $('.menu-wrap').removeClass('fixed'); 866 } 867 }); 868} 869/*-------------------------*/ 870/* Countdown */ 871/*-------------------------*/ 872function loadCountdown() { 873 $('#clock').countdown('2022/04/01 00:00', function(event) { 874 var $this = $(this).html(event.strftime('' + 875 '<div>%w <span class="title">Weeks</span></div>' + 876 '<div>%d <span class="title">days</span></div>' + 877 '<div>%H <span class="title">
877hours</span></div>' + 878 '<div>%S <span class="title">seconds</span></div>')); 879 }); 880} 881function speacialCount() { 882 $('#specialclock').countdown('2020/01/11', function(event) { 883 $(this).html(event.strftime('Time left: [ %D days %H:%M:%S ]')); 884 }); 885} 886function offheight() { 887 if ($(window).width() > 750) { 888 var offerHeight = $(".offers").outerHeight(true); 889 $(".offers.light").css("height", offerHeight + 1); 890 } 891} 892/*-------------------------*/ 893/* Fixed Menu */ 894/*-------------------------*/ 895function loadWindowSettings() { 896 offheight(); 897 if ($(window).width() < 750) { 898 $(".nav-menu .main-menu > .menu-item-has-children > a").on("click", function() { 899 if ($(this).attr('href') !== '#') { 900 $(this).next().slideToggle(0); 901 return false; 902 } 903 }); 904 } 905} 906/*----------------------*/ 907/* Swiper */ 908/*----------------------*/ 909function swiperInit() { 910 var initIterator = 0; 911 var _this, 912 spanwipers = $('.swiper-container'); 913 for (var i = spanwipers.length - 1; i >= 0; i--) { 914 _this = spanwipers[i]; 915 var $th = $(_this); 916 var $t = $th; 917 var index = $th.attr('id'); 918 $th.addClass('swiper-' + index + ' initialized').attr('init-attr', 'swiper-' + index); 919 $th.find('.pagination').addClass('pagination-' + index); 920 var autoPlayVar = parseInt($th.attr('data-autoplay'), 10); 921 var slidesPerViewVar = $th.attr('data-slides-per-view'); 922 var loopVar = parseInt($th.attr('data-loop'), 10); 923 var mouseVar = parseInt($th.attr('data-mouse'), 10); 924 var sliderSpeed = parseInt($th.attr('data-speed'), 10); 925 var touchVar = parseInt($th.attr('data-touch'), 10); 926 var mode = $th.attr('data-mode'); 927 var xsValue, smValue, mdValue, lgValue; 928 var slideMode = $th.attr('data-mode'); 929 var centerVar = parseInt($t.attr('data-center'), 10); 930 if (slidesPerViewVar === 'responsive') { 931 xsValue = parseInt($th.attr('data-xs-slides'), 10); 932 smValue = parseInt($th.attr('data-sm-slides'), 10); 933 mdValue = parseInt($th.attr('data-md-slides'), 10); 934 lgValue = parseInt($th.attr('data-lg-slides'), 10); 935 slidesPerViewVar = updateSlidesPerView(xsValue, smValue, mdValue, lgValue); 936 } else slidesPerViewVar = parseInt(slidesPerViewVar, 10); 937 swipers['swiper-' + index] = new Swiper('.swiper-' + index, { 938 speed: sliderSpeed, 939 pagination: '.pagination-' + index, 940 loop: loopVar, 941 paginationClickable: true, 942 autoplay: 5000, 943 slidesPerView: slidesPerViewVar, 944 keyboardControl: true, 945 calculateHeight: true, 946 mode: mode || 'horizontal', 947 //initialSlide: initialSlideVar, 948 //simulateTouch: simVar, 949 centeredSlides: centerVar, 950 roundLengths: true, 951 onSlideChangeEnd: function(swiper) { 952 $t.find('.swiper-slide.active').show(); 953 var activeIndex = (loopVar === true) ? swiper.activeIndex : swiper.activeLoopIndex; 954 var qVal = $t.find('.swiper-slide-active').attr('data-val'); 955 $t.find('.swiper-slide[data-val="' + qVal + '"]').addClass('active'); 956 }, 957 onSlideChangeStart: function(swiper) { 958 var activeIndex = (loopVar === true) ? swiper.activeIndex : swiper.activeLoopIndex; 959 $th.find('.count span i').text(activeIndex + 1); 960 $t.find('.swiper-slide.active').removeClass('active'); 961 $t.find('.swiper-slide.active').hide(); 962 963 if ($('.testimonials').length) { 964 965 $('.wrap-info').css('display', 'none').removeClass('active'); 966 $('.wrap-info').eq(activeIndex).css({ 967 'display': 'block', 968 'opacity': 0 969 }).animate({ 970 'opacity': 1, 971 'transform': 'translateY(0)', 972 'MozTransform': 'translateY(0)', 973 'WebkitTransform': 'translateY(0)' 974 }, 500, 975 function() { 976 $(this).addClass('active'); 977 }); 978 } 979 }, 980 onSlideClick: function(swiper) {} 981 }); 982 swipers['swiper-' + index].reInit(); 983 if ($t.find('.default-active').length) { 984 swipers['swiper-' + $t.attr('id')].swipeTo($t.find('.swiper-slide').index($t.find('.default-active')), 0); 985 } 986 initIterator++; 987 $('.img-person').on('click', function() { 988 var $t = $(this); 989 if ($t.hasClass('default-active')) return false;
990 $t.closest('.testimonials').find('.img-person').removeClass('default-active'); 991 var index = $t.closest('.testimonials').find('.img-person').index(this); 992 swipers['swiper-' + $(this).closest('.swiper-container').attr('id')].swipeTo(index); 993 }); 994 }; 995 $('.full-height-slider .slide-grid').each(function(i, el) { 996 swiper_content[i] = swipers['swiper-' + $(el).find('.swiper-container').attr('id')]; 997 }); 998} 999function updateSlidesPerView(xsValue, smValue, mdValue, lgValue) { 1000 var winW = $(window).width(); 1001 var winH = $(window).height(); 1002 var xsPoint = 700, 1003 smPoint = 991, 1004 mdPoint = 1199; 1005 1006 if (winW > mdPoint) return lgValue; 1007 else if (winW > smPoint) return mdValue; 1008 else if (winW > xsPoint) return smValue; 1009 else return xsValue; 1010}
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.