//Page loader jQuery(function($) { $("#page").fadeIn("slow"); }); //Home page triangles jQuery(function($) { function homeTriangles() { var width = $(window).innerWidth(); var rawHeight = $(window).height(); var height = Math.round(rawHeight); $('.wrapper').css('min-height', rawHeight*2); $('.arrow-right, .arrow-down, .arrow-left').css('border-top-width', height); $('.arrow-right, .arrow-down, .arrow-up').css('border-left-width', width); $('.arrow-down, .arrow-up, .arrow-left').css('border-right-width', width); $('.arrow-up, .arrow-left, .arrow-right').css('border-bottom-width', height); $('.arrow-down span').css('bottom', height/2); $('.arrow-up span').css('top', height/2); $('.arrow-left span').css('left', width/2); $('.arrow-right span').css('right', width/2); } $(document).on("ready", homeTriangles); $(window).on("resize", homeTriangles); }); //Menu dropdown animation jQuery(function($) { $('.sub-menu').hide(); $('.main-navigation .children').hide(); $('.menu-item').hover( function() { $(this).children('.sub-menu').slideDown(); }, function() { $(this).children('.sub-menu').hide(); } ); $('.main-navigation li').hover( function() { $(this).children('.main-navigation .children').slideDown(); }, function() { $(this).children('.main-navigation .children').hide(); } ); }); //Header search form jQuery(function($) { $('.site-header .amplify-search').click(function() { $('.site-header .search-field').toggleClass('search-expanded'); }); }); //Fit Vids jQuery(function($) { $("body").fitVids(); }); //Mobile menu jQuery(function($) { $('.main-navigation .menu').slicknav({ label: '', prependTo: '.mobile-nav', closedSymbol: '+', openedSymbol: '-' }); $('.info-close').click(function(){ $(this).parent().fadeOut(); return false; }); }); //Smooth scrolling jQuery(function($) { $('a[href*=#]:not([href=#])').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top }, 800); return false; } } }); }); //Open social links in a new tab jQuery(function($) { $( '.social-navigation li a' ).attr( 'target','_blank' ); }); //Resume page jQuery(function($) { $('.nav-experience').click(function() { $('.schools').fadeOut('fast'); $('.skills').fadeOut('fast'); $('.jobs').fadeIn('slow'); }); $('.nav-education').click(function() { $('.schools').fadeIn('slow'); $('.jobs').fadeOut('fast'); $('.skills').fadeOut('fast'); }); $('.nav-skills').click(function() { $('.skills').fadeIn('slow'); $('.jobs').fadeOut('fast'); $('.schools').fadeOut('fast'); }); }); jQuery(function($) { $('.nav-skills').click(function() { $('.skillbar').each(function(){ jQuery(this).find('.skillbar-bar').css({ width: $(this).attr('data-percent') }); }); }); }); //Mobile sidebar toggle jQuery(function($) { $('.sidebar-toggle').click(function() { $('.widget-area').fadeToggle(); }); });