-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
66 lines (57 loc) · 1.82 KB
/
index.js
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
$(document).ready(function() {
if($(window).width()<560)
{
$("#menu-bar").css({display: "none"});
$("#dropdown-menu-bar").css({display: "block"});
$("#icon").css({display: "none"});
}
else
{
$("#menu-bar").css({display: "block"});
$("#dropdown-menu-bar").css({display: "none"});
$("#icon").css({display: "block"});
}
const height = $(window).height();
const width = $(window).width();
const t = Math.max(Math.min((height - width + 250)/250,1),0);
const s = Math.max(Math.min((height - width)/100,1),0);
$(".hamburger-icon").click(function() {
const icon = $(this);
if(icon.attr("transitioning") == null)
{
icon.attr("transitioning", "");
icon.toggleClass("hamburger-change");
const items = $("#dropdown-menu-bar-items");
const h = icon.hasClass("hamburger-change") ? items.children().first().height() : 0;
items.animate({height: h + "px"}, { delay: 400, queue: false,
complete: function() {
icon.removeAttr("transitioning");
}
}
);
}
});
onResize();
});
$(window).resize(onResize);
function onResize() {
const height = $(window).height();
const width = $(window).width();
const t = Math.max(Math.min((height - width + 400)/800,1),0);
const s = Math.max(Math.min((height - width)/100,1),0);
$("#cover-flex").css({"padding-bottom": (48*(1+t)) + "px"});
$("#apply-link").css("margin-top", (Math.max(-200,Math.min(0,height-650)/1.4)-36*t) + "px");
$("#img_library").css("left", Math.max(24,600-width) + "px");
if(width<560)
{
$("#menu-bar").css({display: "none"});
$("#dropdown-menu-bar").css({display: "block"});
$("#icon").css({display: "none"});
}
else
{
$("#menu-bar").css({display: "block"});
$("#dropdown-menu-bar").css({display: "none"});
$("#icon").css({display: "block"});
}
}