-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
50 lines (42 loc) · 1.25 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
45
46
47
48
49
50
const slid = document.getElementById("slider");
const header = document.getElementById("header");
const slider_a = document.getElementById("slider_a");
function slider() {
// Toggle slider visibility
slid.style.display = slid.style.display === "flex" ? "none" : "flex";
}
// Hide slider and reset background when screen width is above 992px
window.addEventListener("resize", () => {
if (window.innerWidth > 992) {
slid.style.display = "none";
}
});
function sliderhide() {
setTimeout(() => {
slid.style.display = "none";
}, 500);
}
var typed = new Typed(".text", {
strings: [
"Frontend Developer",
"App Developer",
"Backend Developer",
"UI/UX Designer",
],
typeSpeed: 100,
backSpeed: 100,
delay: 1000,
loop: true,
});
// Get all links in the navbar
const navbarLinks = document.querySelectorAll(".navbar a");
// Loop through each link and add a click event listener
navbarLinks.forEach((link) => {
link.addEventListener("click", function (event) {
event.preventDefault();
// Remove active class from all links
navbarLinks.forEach((link) => link.classList.remove("active"));
// Add active class to the clicked link
this.classList.add("active");
});
});