/*
Luck -Resposive Coming Soon Page
Author: ProwebTheme
Version: 1.0
Email: Masudzakaria2@gmail.com
*/
(function($){
'use strict';	

/*============= Full page scroll ===========*/
	function fullPageSectiona(){
		$('#fullpage').fullpage({
			anchors: ['firstPage', 'secondPage', '3rdPage', '4thpage', 'lastPage'],
			menu: '#menu',
			scrollingSpeed:800,
			autoScrolling: true,
			scrollBar: false,
			easing: 'easeInQuart',
			resize : false,
			responsiveWidth: 970
		});
	}

/*============= Welcome section text fade Effect ===========*/
function TextfadeEffect(){
	 var quotes = $(".fade-text");
    var quoteIndex = -1;
    
    function showNextQuote() {
        ++quoteIndex;
        quotes.eq(quoteIndex % quotes.length)
            .fadeIn(2000)
            .delay(2000)
            .fadeOut(2000, showNextQuote);
    }
    
    showNextQuote();
}

/*============= progressbar ===========*/
function AniProgressBar(){
	$('  .skills .progress').each(function () {
        $(this).appear(function() {
          $(this).animate({opacity:1,left:"0px"},500);
          var b = $(this).find(".progress-bar").attr("data-width");
          $(this).find(".progress-bar").animate({
            width: b + "%"
          }, 1000, "linear");
        }); 
    });   
$('.counter').counterUp({
            delay:10,
            time: 800
        });
}
	
/*============= Wlcome section count down ===========*/
	
	function countDown(){
		$("#count-down-wrapper").countdown({
			date: "8 September 2017 09:00:00", // Change this to your desired date to countdown to
			format: "on"
		});
	} 
 /*=============*******************===========*/

/*============= Css main color change ===========*/
function colorChange(){
	 $(".color-list ul li").on("click",function(){
		 var Color = $(this).attr("class");
		 $("#colors_option").attr("href","css/colors/"+Color+"-color.css");
	 });
 }

/*============= All function variable call ===========*/	 
$(function(){	
	 if (typeof countDown == 'function'){ 
			countDown(); 
		}
	 if (typeof TextfadeEffect == 'function'){ 
			TextfadeEffect(); 
		}
	 if (typeof colorChange == 'function'){ 
			colorChange(); 
		}
	 if (typeof fullPageSectiona == 'function'){ 
			fullPageSectiona(); 
		}
	if (typeof AniProgressBar == 'function'){ 
			AniProgressBar(); 
		}
});

/*============= preloder ===========*/	
$(window).load(function(){
	$("#loader-wrapper").delay(350).fadeOut("slow"); // will fade out the white DIV that covers the website.
	$("body").removeClass("preloder_priview");
});

})(jQuery);  