-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
44 lines (43 loc) · 1.22 KB
/
script.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
function toggleMenu() {
const menu = document.querySelector(".menu-links");
const icon = document.querySelector(".hamburger-icon");
menu.classList.toggle("open");
icon.classList.toggle("open");
}
if (window.matchMedia("(max-width: 600px)").matches) {
const text = document.querySelector(".sec-text");
const textload = () => {
setTimeout(() => {
text.textContent = "a Web Developer";
}, 0);
setTimeout(() => {
text.textContent = "an Application Programmer";
}, 5100);
setTimeout(() => {
text.textContent = "a Systems Programmer";
}, 10000);
setTimeout(() => {
text.textContent = "an Open source enthusiast";
}, 15000);
};
textload();
setInterval(textload, 20000); //1s =1000ms
} else {
const text = document.querySelector(".sec-text");
const textload = () => {
setTimeout(() => {
text.textContent = "a Web Developer";
}, 0);
setTimeout(() => {
text.textContent = "an Application Programmer";
}, 4000);
setTimeout(() => {
text.textContent = "a Systems Programmer";
}, 8000);
setTimeout(() => {
text.textContent = "an Open source enthusiast";
}, 12000);
};
textload();
setInterval(textload, 16000); //1s =1000ms
}