-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.js
120 lines (111 loc) · 2.17 KB
/
main.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
var cur = 1, uc = 0;
function updateI(){
var i = $("#indicator");
switch (cur) {
case 1:
i.html("INTRO");
break;
case 2:
i.html("SKILLS");
break;
case 3:
i.html("WORK");
break;
case 4:
i.html("BIO");
break;
}
}
function switchNav(){
if(uc==0){
uc++;
}
$("#nav").toggleClass("active");
$("#link-list").toggleClass("active");
$("#indicator").toggleClass("active");
}
function openNav(){
if(uc==0){
$("#nav").addClass("active");
$("#link-list").addClass("active");
$("#indicator").removeClass("active");
}
}
function slideTo(id){
openNav();
switch (cur){
case 1:
$("#toIntro").removeClass("active");
$("#slider").removeClass("page1");
break;
case 2:
$("#toSkills").removeClass("active");
$("#slider").removeClass("page2");
break;
case 3:
$("#toWork").removeClass("active");
$("#slider").removeClass("page3");
break;
case 4:
$("#toBio").removeClass("active");
$("#slider").removeClass("page4");
break;
}
switch (id) {
case "#intro":
$("#slider").addClass("page1");
$("#toIntro").addClass("active");
cur = 1;
break;
case "#skills":
$("#slider").addClass("page2");
$("#toSkills").addClass("active");
cur = 2;
break;
case "#work":
$("#slider").addClass("page3");
$("#toWork").addClass("active");
cur = 3;
break;
case "#bio":
$("#slider").addClass("page4");
$("#toBio").addClass("active");
cur = 4;
break;
}
updateI();
}
function toPrev(){
switch (cur){
case 1:
slideTo("#bio","#toBio");
break;
case 2:
slideTo("#intro","#toIntro");
break;
case 3:
slideTo("#skills","#toSkills");
break;
case 4:
slideTo("#work","#toWork");
break;
}
updateI();
}
function toNext(){
switch (cur){
case 3:
slideTo("#bio","#toBio");
break;
case 4:
slideTo("#intro","#toIntro");
break;
case 1:
slideTo("#skills","#toSkills");
break;
case 2:
slideTo("#work","#toWork");
break;
}
updateI();
}