-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
executable file
·56 lines (48 loc) · 1.4 KB
/
app.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
const url = 'https://briellelaw.github.io/CubByte/';
const urlTemp = 'http://127.0.0.1:5500/';
const navSlide = () => {
const burger = document.querySelector('.burger');
const nav = document.querySelector('.nav-links');
burger.addEventListener('click', ()=> {
nav.classList.toggle('nav-active');
});
}
function moveTitleSmall() {
var pos = 50;
var id = setInterval(frame, 2);
function frame() {
const title = document.getElementById('Title');
const tag = document.getElementById('Tag');
if (pos == 150) {
clearInterval(id);
} else {
pos++;
tag.style.top = pos + 270 + "px";
title.style.top = pos + "px";
}
}
}
function moveTitleLarge() {
var pos = 0;
var id = setInterval(frame, 2);
function frame() {
const title = document.getElementById('Title');
const tag = document.getElementById('Tag');
if (pos == 150) {
clearInterval(id);
} else {
pos++;
tag.style.top = pos + 270 + "px";
title.style.top = pos + "px";
}
}
}
if (document.referrer === urlTemp + 'html/hardware.html' ||
document.referrer === urlTemp + 'html/software.html' ||
document.referrer === urlTemp + 'html/databases.html') {
moveTitleSmall();
}
else {
moveTitleLarge();
}
navSlide();