blog/bonifacelabs/public/js/main.js

39 lines
1.3 KiB
JavaScript
Raw Normal View History

2016-08-21 23:47:24 -04:00
$(document).ready(function() {
$('body').removeClass('no-js');
$('a.blog-button').click(function() {
if ($('.panel-cover').hasClass('panel-cover--collapsed')) return;
currentWidth = $('.panel-cover').width();
if (currentWidth < 960) {
$('.panel-cover').addClass('panel-cover--collapsed');
$('.content-wrapper').addClass('animated slideInRight');
} else {
$('.panel-cover').css('max-width',currentWidth);
$('.panel-cover').animate({'max-width': '530px', 'width': '40%'}, 400, swing = 'swing', function() {} );
}
});
if (window.location.hash && window.location.hash == "#blog") {
$('.panel-cover').addClass('panel-cover--collapsed');
}
if (window.location.pathname.substring(0, 5) == "/tag/") {
$('.panel-cover').addClass('panel-cover--collapsed');
}
$('.btn-mobile-menu').click(function() {
$('.navigation-wrapper').toggleClass('visible animated bounceInDown');
$('.btn-mobile-menu__icon').toggleClass('hidden');
$('.btn-mobile-close__icon').toggleClass('hidden');
});
$('.navigation-wrapper .blog-button').click(function() {
$('.navigation-wrapper').toggleClass('visible');
$('.btn-mobile-menu__icon').toggleClass('hidden');
$('.btn-mobile-close__icon').toggleClass('hidden');
});
});