123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226 |
- /*========================================================================
- EXCLUSIVE ON themeforest.net
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Template Name : AppLite
- Author : mital_04
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Copyright (c) 2018 - mital_04
- ========================================================================*/
-
- (function($){
- "use strict"
- var LITE = {};
- /*--------------------
- * Pre Load
- ----------------------*/
- LITE.WebLoad = function(){
- document.getElementById("loading").style.display = "none";
- }
- /*--------------------
- * Header Class
- ----------------------*/
- LITE.HeaderSticky = function(){
- $(".navbar-toggler").on("click", function(a) {
- a.preventDefault(),
- $(".navbar").addClass("fixed-header")
- });
- }
- /*--------------------
- * Menu Close
- ----------------------*/
- LITE.MenuClose = function(){
- $('.navbar-nav .nav-link').on('click', function() {
- var toggle = $('.navbar-toggler').is(':visible');
- if (toggle) {
- $('.navbar-collapse').collapse('hide');
- }
- });
- }
- /*--------------------
- * Smooth Scroll
- ----------------------*/
- LITE.HeaderScroll = function(){
- $('header a[href*="#"]:not([href="#"])').on('click', function() {
- var PathName = location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') || location.hostname == this.hostname;
- if (PathName) {
- var target = $(this.hash);
- target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
- if (target.length) {
- $('html,body').animate({
- scrollTop: target.offset().top - 65,
- }, 1000);
- return false;
- }
- }
- });
- }
- /*--------------------
- * Header Fixed
- ----------------------*/
- LITE.HeaderFixed = function(){
- var varHeaderFix = $(window).scrollTop() >= 60;
- if (varHeaderFix) {
- $('.navbar').addClass('fixed-header');
- }
- else {
- $('.navbar').removeClass('fixed-header');
- }
- }
- /*--------------------
- * owl Slider
- ----------------------*/
- LITE.ClientSlider = function(){
- var testimonials_slider = $('#client-slider-single');
- testimonials_slider.owlCarousel({
- loop: true,
- margin: 0,
- nav:false,
- dots:true,
- responsive: {
- 0: {
- items: 1
- },
- 600: {
- items: 1
- },
- 768: {
- items: 2
- },
- 991: {
- items: 3
- },
- 1140: {
- items: 3
- }
- }
- });
- }
- LITE.WorkSlider = function(){
- var work_slider = $('#work-slider-single');
- work_slider.owlCarousel({
- loop: true,
- margin: 0,
- nav:false,
- dots:true,
- responsive: {
- 0: {
- items: 1
- },
- 600: {
- items: 1
- },
- 768: {
- items: 2
- },
- 991: {
- items: 3
- },
- 1140: {
- items: 3
- }
- }
- });
- }
- LITE.PopupVideo = function(){
- $('.popup-video').magnificPopup({
- disableOn: 700,
- type: 'iframe',
- mainClass: 'mfp-fade',
- removalDelay: 160,
- preloader: false,
- fixedContentPos: false
- });
- }
- LITE.LightboxGallery = function(){
- $('.portfolio-col').magnificPopup({
- delegate: '.lightbox-gallery',
- type: 'image',
- tLoading: '#%curr%',
- mainClass: 'mfp-fade',
- fixedContentPos: true,
- closeBtnInside: true,
- gallery: {
- enabled: true,
- navigateByImgClick: true,
- preload: [0, 1] // Will preload 0 - before current, and 1 after the current image
- }
- });
- }
-
- /*--------------------
- * Progress Bar
- ----------------------*/
- LITE.ProgressBar = function(){
- $(".progress .progress-bar").each(function () {
- var bottom_object = $(this).offset().top + $(this).outerHeight();
- var bottom_window = $(window).scrollTop() + $(window).height();
- var progressWidth = $(this).attr('aria-valuenow') + '%';
- if(bottom_window > bottom_object) {
- $(this).css({
- width : progressWidth
- });
- }
- });
- }
- /*--------------------
- * Counter JS
- ----------------------*/
- var a = 0;
- LITE.Counter = function(){
- var oTop = $('.counter-box').offset().top - window.innerHeight;
- if (a == 0 && $(window).scrollTop() > oTop) {
- $('.count').each(function () {
- $(this).prop('Counter',0).animate({
- Counter: $(this).text()
- }, {
- duration: 4000,
- easing: 'swing',
- step: function (now) {
- $(this).text(Math.ceil(now));
- }
- });
- });
- a = 1;
- }
- }
- // Window on Load
- $(window).on("load", function(){
- LITE.WebLoad();
- });
- $(document).on("ready", function(){
- LITE.WorkSlider(),
- LITE.PopupVideo(),
- LITE.ClientSlider(),
- LITE.LightboxGallery(),
- LITE.MenuClose(),
- LITE.HeaderScroll(),
- LITE.Counter(),
- LITE.ProgressBar(),
- LITE.HeaderSticky();
- });
- $(window).on("scroll", function(){
- LITE.Counter(),
- LITE.ProgressBar(),
- LITE.HeaderFixed();
- });
- })(jQuery);
|