-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
67 lines (50 loc) · 1.79 KB
/
script.js
File metadata and controls
67 lines (50 loc) · 1.79 KB
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
document.addEventListener("DOMContentLoaded", function () {
const dropdown = document.querySelector(".dropdown");
const socialButton = dropdown.querySelector(".dropdown-btn");
const dropdownContent = dropdown.querySelector(".dropdown-content");
socialButton.addEventListener("click", function () {
dropdown.classList.toggle("flip");
dropdownContent.classList.toggle("show");
});
// Close the dropdown when clicking outside of it
window.addEventListener("click", function (event) {
if (!event.target.matches(".social-button") && !event.target.matches(".dropdown-content")) {
dropdownContent.classList.remove("show");
}
});
});
// Function to toggle the visibility of the dropdown content
function toggleDropdown() {
var dropdownContent = document.getElementById("dropdownContent");
dropdownContent.classList.toggle("show");
}
// Add an event listener to the button to toggle the dropdown when clicked
var dropdownButton = document.querySelector(".dropdown-btn");
dropdownButton.addEventListener("click", toggleDropdown);
const menuButton = document.getElementById('menuButton');
const mobileNav = document.getElementById('mobileMenu');
function toggleMobileNav() {
mobileNav.classList.toggle('show');
}
menuButton.addEventListener('click', toggleMobileNav);
function hideMobileNavOnDesktop() {
if (window.innerWidth >= 768) {
mobileNav.classList.remove('show');
}
}
window.addEventListener('resize', hideMobileNavOnDesktop);
function Home() {
window.location.href = 'index.php';
}
function Project() {
window.location.href = 'Project.php';
}
function About() {
window.location.href = 'About.php';
}
function GitHub() {
// No navigation for now
}
function EsphomePage() {
// No navigation for now
}