-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
293 lines (242 loc) · 12.9 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
var TxtType = function(el, toRotate, period) {
this.toRotate = toRotate;
this.el = el;
this.loopNum = 0;
this.period = parseInt(period, 10) || 2000;
this.txt = '';
this.tick();
this.isDeleting = false;
};
TxtType.prototype.tick = function() {
var i = this.loopNum % this.toRotate.length;
var fullTxt = this.toRotate[i];
if (this.isDeleting) {
this.txt = fullTxt.substring(0, this.txt.length - 1);
} else {
this.txt = fullTxt.substring(0, this.txt.length + 1);
}
this.el.innerHTML = '<span class="wrap">' + this.txt + '</span>';
var that = this;
var delta = 200 - Math.random() * 100;
if (this.isDeleting) {
delta /= 2;
}
if (!this.isDeleting && this.txt === fullTxt) {
delta = this.period;
this.isDeleting = true;
} else if (this.isDeleting && this.txt === '') {
this.isDeleting = false;
this.loopNum++;
delta = 500;
}
setTimeout(function() {
that.tick();
}, delta);
};
window.onload = function() {
var elements = document.getElementsByClassName('typewrite');
for (var i = 0; i < elements.length; i++) {
var toRotate = elements[i].getAttribute('data-type');
var period = elements[i].getAttribute('data-period');
if (toRotate) {
new TxtType(elements[i], JSON.parse(toRotate), period);
}
}
// INJECT CSS
var css = document.createElement("style");
css.type = "text/css";
css.innerHTML = ".typewrite > .wrap { border-right: 0.08em solid #334}";
document.body.appendChild(css);
};
function d1() {
document.getElementById('jt1-div').classList.add("active");
document.getElementById('jt11').classList.add("active");
document.getElementById('jt1-div').classList.remove("not-active");
document.getElementById('jt12').classList.add("active");
document.getElementById('jt1').style.borderBottom = "2px solid rgb(233, 99, 12)";
document.getElementById('jt1').style.color = "rgb(233, 99, 12)";
document.getElementById('jt2').style.borderBottom = "none"
document.getElementById('jt2').style.color = "black";
document.getElementById('jt2-div').classList.add("not-active");
document.getElementById('jt2-div').classList.remove("active");
document.getElementById('jt3').style.borderBottom = "none"
document.getElementById('jt3').style.color = "black";
document.getElementById('jt3-div').classList.add("not-active");
document.getElementById('jt3-div').classList.remove("active");
document.getElementById('jt4').style.borderBottom = "none"
document.getElementById('jt4').style.color = "black";
document.getElementById('jt4-div').classList.add("not-active");
document.getElementById('jt4-div').classList.remove("active");
document.getElementById('jt5').style.borderBottom = "none"
document.getElementById('jt5').style.color = "black";
document.getElementById('jt5-div').classList.add("not-active");
document.getElementById('jt5-div').classList.remove("active");
document.getElementById('jt6').style.borderBottom = "none"
document.getElementById('jt6').style.color = "black";
document.getElementById('jt6-div').classList.add("not-active");
document.getElementById('jt6-div').classList.remove("active");
};
function d2() {
document.getElementById('jt2-div').classList.add("active");
document.getElementById('jt21').classList.add("active");
document.getElementById('jt22').classList.add("active");
document.getElementById('jt2').style.color = "rgb(233, 99, 12)";
document.getElementById('jt2').style.borderBottom = "2px solid rgb(233, 99, 12)";
document.getElementById('jt2-div').classList.remove("not-active");
document.getElementById('jt1-div').classList.add("not-active");
document.getElementById('jt1-div').classList.remove("active");
document.getElementById('jt1').style.borderBottom = "none";
document.getElementById('jt1').style.color = "black";
document.getElementById('jt3-div').classList.add("not-active");
document.getElementById('jt3-div').classList.remove("active");
document.getElementById('jt3').style.borderBottom = "none";
document.getElementById('jt3').style.color = "black";
document.getElementById('jt4-div').classList.add("not-active");
document.getElementById('jt4-div').classList.remove("active");
document.getElementById('jt4').style.borderBottom = "none";
document.getElementById('jt4').style.color = "black";
document.getElementById('jt5-div').classList.add("not-active");
document.getElementById('jt5-div').classList.remove("active");
document.getElementById('jt5').style.borderBottom = "none";
document.getElementById('jt5').style.color = "black";
document.getElementById('jt6-div').classList.add("not-active");
document.getElementById('jt6-div').classList.remove("active");
document.getElementById('jt6').style.borderBottom = "none";
document.getElementById('jt6').style.color = "black";
};
function d3() {
document.getElementById('jt3-div').classList.add("active");
document.getElementById('jt31').classList.add("active");
document.getElementById('jt32').classList.add("active");
document.getElementById('jt3').style.color = "rgb(233, 99, 12)";
document.getElementById('jt3').style.borderBottom = "2px solid rgb(233, 99, 12)";
document.getElementById('jt3-div').classList.remove("not-active");
document.getElementById('jt1-div').classList.add("not-active");
document.getElementById('jt1-div').classList.remove("active");
document.getElementById('jt1').style.borderBottom = "none";
document.getElementById('jt1').style.color = "black";
document.getElementById('jt2-div').classList.add("not-active");
document.getElementById('jt2-div').classList.remove("active");
document.getElementById('jt2').style.borderBottom = "none";
document.getElementById('jt2').style.color = "black";
document.getElementById('jt4-div').classList.add("not-active");
document.getElementById('jt4-div').classList.remove("active");
document.getElementById('jt4').style.borderBottom = "none";
document.getElementById('jt4').style.color = "black";
document.getElementById('jt5-div').classList.add("not-active");
document.getElementById('jt5-div').classList.remove("active");
document.getElementById('jt5').style.borderBottom = "none";
document.getElementById('jt5').style.color = "black";
document.getElementById('jt6-div').classList.add("not-active");
document.getElementById('jt6-div').classList.remove("active");
document.getElementById('jt6').style.borderBottom = "none";
document.getElementById('jt6').style.color = "black";
};
function d4() {
document.getElementById('jt4-div').classList.add("active");
document.getElementById('jt41').classList.add("active");
document.getElementById('jt42').classList.add("active");
document.getElementById('jt4').style.color = "rgb(233, 99, 12)";
document.getElementById('jt4').style.borderBottom = "2px solid rgb(233, 99, 12)";
document.getElementById('jt4-div').classList.remove("not-active");
document.getElementById('jt1-div').classList.add("not-active");
document.getElementById('jt1-div').classList.remove("active");
document.getElementById('jt1').style.borderBottom = "none";
document.getElementById('jt1').style.color = "black";
document.getElementById('jt3-div').classList.add("not-active");
document.getElementById('jt3-div').classList.remove("active");
document.getElementById('jt3').style.borderBottom = "none";
document.getElementById('jt3').style.color = "black";
document.getElementById('jt2-div').classList.add("not-active");
document.getElementById('jt2-div').classList.remove("active");
document.getElementById('jt2').style.borderBottom = "none";
document.getElementById('jt2').style.color = "black";
document.getElementById('jt5-div').classList.add("not-active");
document.getElementById('jt5-div').classList.remove("active");
document.getElementById('jt5').style.borderBottom = "none";
document.getElementById('jt5').style.color = "black";
document.getElementById('jt6-div').classList.add("not-active");
document.getElementById('jt6-div').classList.remove("active");
document.getElementById('jt6').style.borderBottom = "none";
document.getElementById('jt6').style.color = "black";
};
function d5() {
document.getElementById('jt5-div').classList.add("active");
document.getElementById('jt51').classList.add("active");
document.getElementById('jt52').classList.add("active");
document.getElementById('jt5').style.color = "rgb(233, 99, 12)";
document.getElementById('jt5').style.borderBottom = "2px solid rgb(233, 99, 12)";
document.getElementById('jt5-div').classList.remove("not-active");
document.getElementById('jt1-div').classList.add("not-active");
document.getElementById('jt1-div').classList.remove("active");
document.getElementById('jt1').style.borderBottom = "none";
document.getElementById('jt1').style.color = "black";
document.getElementById('jt3-div').classList.add("not-active");
document.getElementById('jt3-div').classList.remove("active");
document.getElementById('jt3').style.borderBottom = "none";
document.getElementById('jt3').style.color = "black";
document.getElementById('jt4-div').classList.add("not-active");
document.getElementById('jt4-div').classList.remove("active");
document.getElementById('jt4').style.borderBottom = "none";
document.getElementById('jt4').style.color = "black";
document.getElementById('jt2-div').classList.add("not-active");
document.getElementById('jt2-div').classList.remove("active");
document.getElementById('jt2').style.borderBottom = "none";
document.getElementById('jt2').style.color = "black";
document.getElementById('jt6-div').classList.add("not-active");
document.getElementById('jt6-div').classList.remove("active");
document.getElementById('jt6').style.borderBottom = "none";
document.getElementById('jt6').style.color = "black";
};
function d6() {
document.getElementById('jt6-div').classList.add("active");
document.getElementById('jt61').classList.add("active");
document.getElementById('jt62').classList.add("active");
document.getElementById('jt6').style.color = "rgb(233, 99, 12)";
document.getElementById('jt6').style.borderBottom = "2px solid rgb(233, 99, 12)";
document.getElementById('jt6-div').classList.remove("not-active");
document.getElementById('jt1-div').classList.add("not-active");
document.getElementById('jt1-div').classList.remove("active");
document.getElementById('jt1').style.borderBottom = "none";
document.getElementById('jt1').style.color = "black";
document.getElementById('jt3-div').classList.add("not-active");
document.getElementById('jt3-div').classList.remove("active");
document.getElementById('jt3').style.borderBottom = "none";
document.getElementById('jt3').style.color = "black";
document.getElementById('jt4-div').classList.add("not-active");
document.getElementById('jt4-div').classList.remove("active");
document.getElementById('jt4').style.borderBottom = "none";
document.getElementById('jt4').style.color = "black";
document.getElementById('jt5-div').classList.add("not-active");
document.getElementById('jt5-div').classList.remove("active");
document.getElementById('jt5').style.borderBottom = "none";
document.getElementById('jt5').style.color = "black";
document.getElementById('jt2-div').classList.add("not-active");
document.getElementById('jt2-div').classList.remove("active");
document.getElementById('jt2').style.borderBottom = "none";
document.getElementById('jt2').style.color = "black";
};
function card1() {
document.getElementById('btn-card1').classList.remove("job-but1");
document.getElementById('btn-card1').classList.add("job-but2");
}
function cardn1() {
document.getElementById('btn-card1').classList.add("job-but1");
document.getElementById('btn-card1').classList.remove("job-but2");
}
function card2() {
document.getElementById('btn-card2').classList.add("job-but2");
document.getElementById('btn-card2').classList.remove("job-but1");
}
function cardn2() {
document.getElementById('btn-card2').classList.add("job-but1");
document.getElementById('btn-card2').classList.remove("job-but2");
}
function card3() {
document.getElementById('btn-card3').classList.add("job-but2");
document.getElementById('btn-card3').classList.remove("job-but1");
}
function cardn3() {
document.getElementById('btn-card3').classList.add("job-but1");
document.getElementById('btn-card3').classList.remove("job-but2");
}