/* Author: Rigorous */ $.noConflict(); jQuery(document).ready(function ($) { // browser window scroll (in pixels) after which the "back to top" link is shown var offset = 300, //browser window scroll (in pixels) after which the "back to top" link opacity is reduced offset_opacity = 1200, //duration of the top scrolling animation (in ms) scroll_top_duration = 700, //grab the "back to top" link $back_to_top = $('.cd-top'); //hide or show the "back to top" link $(window).scroll(function(){ ( $(this).scrollTop() > offset ) ? $back_to_top.addClass('cd-is-visible') : $back_to_top.removeClass('cd-is-visible cd-fade-out'); if( $(this).scrollTop() > offset_opacity ) { $back_to_top.addClass('cd-fade-out'); } }); //smooth scroll to top $back_to_top.on('click', function(event){ event.preventDefault(); $('body,html').animate({ scrollTop: 0 , }, scroll_top_duration ); }); //Mean menu jQuery('#primary-menu').meanmenu(); //Banner Carousel jQuery('#banner-slider').flexslider({ animation: "slide", controlNav: true, animationSpeed: 1000 }); jQuery('.show-form').click(function(){ jQuery('.form-wrapper').toggle('slow'); }); jQuery('.meanmenu-reveal').click(function(){ jQuery('.menu-toggle').toggleClass('show'); }); /*Load Animation */ jQuery('#banner-slider').waypoint(function(){ var $items=$('.slider-content'); $items.each(function(i){ $(this).css('animation-delay', (i*0.3)+"s"); }); $items.addClass('animated zoomInUp'); }, {offset: 500}); jQuery('#main').waypoint(function(){ var $items=$('.service-col'); $items.each(function(i){ $(this).css('animation-delay', (i*0.5)+"s"); }); $items.addClass('animated fadeInUp'); }, {offset: 0}); jQuery('#home-page-about').waypoint(function(){ var $items=$('.about-me'); var $figure=$('.about-figure'); $items.each(function(i){ $(this).css('animation-delay', (i*0.3)+"s"); }); $figure.each(function(i){ $(this).css('animation-delay', (i*0.3)+"s"); }); $items.addClass('animated slideInLeft'); $figure.addClass('animated slideInRight'); }, {offset: 500}); jQuery('#home-page-blog').waypoint(function(){ var $items=$('.home-posts'); $items.each(function(i){ $(this).css('animation-delay', (i*0.3)+"s"); }); $items.addClass('animated shake'); }, {offset: 0}); jQuery('#colophon').waypoint(function(){ var $items=$('#top-footer'); $items.each(function(i){ $(this).css('animation-delay', (i*0.3)+"s"); }); $items.addClass('animated rotateIn'); }, {offset: 500}); jQuery('#top-footer').waypoint(function(){ var $items=$('.site-info'); $items.each(function(i){ $(this).css('animation-delay', (i*0.3)+"s"); }); $items.addClass('animated zoomIn'); }, {offset: 0}); jQuery('.skillbar').each(function(){ jQuery(this).find('.skillbar-bar').animate({ width:jQuery(this).attr('data-percent') },6000); jQuery(this).find('.skill-bar-percent').animate({ html:jQuery(this) }, 6000); }); });