-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
52 lines (44 loc) · 2.28 KB
/
main.js
File metadata and controls
52 lines (44 loc) · 2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
$(document).ready(function() {
$('a.blog-button').click(function() {
// If already in blog, return early without animate overlay panel again.
if (location.hash && location.hash == "#blog") return;
if ($('.panel-cover').hasClass('panel-cover--collapsed')) return;
$('.main-post-list').removeClass('hidden');
currentWidth = $('.panel-cover').width();
if (currentWidth < 960) {
$('.panel-cover').addClass('panel-cover--collapsed');
} else {
$('.panel-cover').css('max-width',currentWidth);
$('.panel-cover').animate({'max-width': '700px', 'width': '30%'}, 400, swing = 'swing', function() {} );
}
});
if (window.location.hash && window.location.hash == "#blog") {
$('.panel-cover').addClass('panel-cover--collapsed');
$('.main-post-list').removeClass('hidden');
}
if (window.location.pathname.substring(0, 5) == "/tag/") {
$('.panel-cover').addClass('panel-cover--collapsed');
}
$('.btn-mobile-menu__icon').click(function() {
if ($('.navigation-wrapper').css('display') == "block") {
$('.navigation-wrapper').on('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() {
$('.navigation-wrapper').toggleClass('visible animated bounceOutUp');
$('.navigation-wrapper').off('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend');
});
$('.navigation-wrapper').toggleClass('animated bounceInDown animated bounceOutUp');
} else {
$('.navigation-wrapper').toggleClass('visible animated bounceInDown');
}
$('.btn-mobile-menu__icon').toggleClass('fa fa-list fa fa-angle-up animated fadeIn');
});
$('.navigation-wrapper .blog-button').click(function() {
if ($('.navigation-wrapper').css('display') == "block") {
$('.navigation-wrapper').on('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() {
$('.navigation-wrapper').toggleClass('visible animated bounceOutUp');
$('.navigation-wrapper').off('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend');
});
$('.navigation-wrapper').toggleClass('animated bounceInDown animated bounceOutUp');
}
$('.btn-mobile-menu__icon').toggleClass('fa fa-list fa fa-angle-up animated fadeIn');
});
});