-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed copyright year and added respective JS files (#146)
* Updating copyright year and adding JS files * Fixed placing of script tags
- Loading branch information
Showing
4 changed files
with
108 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
const showPopupButtons = document.querySelectorAll(".showPopupButton"); | ||
const closePopupButton = document.querySelector(".closePopupButton"); | ||
const popup = document.querySelector(".popup"); | ||
const overlay = document.getElementById("overlay"); | ||
// showPopupButton.addEventListener("click", function() { | ||
// popup.style.display = "block"; | ||
// overlay.style.display = "block"; | ||
// }); | ||
showPopupButtons.forEach((button) => { | ||
button.addEventListener("click", function () { | ||
// Determine which button was clicked and show the popup accordingly | ||
const trigger = button.getAttribute("data-popup-trigger"); | ||
if ( | ||
trigger === "donate" || | ||
trigger === "cover-page" || | ||
trigger === "navbar" | ||
) { | ||
popup.style.display = "block"; | ||
overlay.style.display = "block"; | ||
} | ||
}); | ||
}); | ||
|
||
closePopupButton.addEventListener("click", function () { | ||
popup.style.display = "none"; | ||
overlay.style.display = "none"; | ||
}); | ||
|
||
const close = document.querySelectorAll(".navclose"); | ||
document.getElementById("openMenu").addEventListener("click", function () { | ||
document.getElementById("menuContainer").style.display = "flex"; | ||
}); | ||
|
||
document.getElementById("closeMenu").addEventListener("click", function () { | ||
document.getElementById("menuContainer").style.display = "none"; | ||
}); | ||
document.querySelectorAll(".close").addEventListener("click", function () { | ||
document.getElementById("menuContainer").style.display = "none"; | ||
}); | ||
|
||
function handleClose() { | ||
document.getElementById("menuContainer").style.display = "none"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
const showPopupButtons = document.querySelectorAll(".showPopupButton"); | ||
const closePopupButton = document.querySelector(".closePopupButton"); | ||
const popup = document.querySelector(".popup"); | ||
const overlay = document.getElementById("overlay"); | ||
// showPopupButton.addEventListener("click", function() { | ||
// popup.style.display = "block"; | ||
// overlay.style.display = "block"; | ||
// }); | ||
showPopupButtons.forEach((button) => { | ||
button.addEventListener("click", function () { | ||
// Determine which button was clicked and show the popup accordingly | ||
const trigger = button.getAttribute("data-popup-trigger"); | ||
if ( | ||
trigger === "donate" || | ||
trigger === "cover-page" || | ||
trigger === "navbar" | ||
) { | ||
popup.style.display = "block"; | ||
overlay.style.display = "block"; | ||
} | ||
}); | ||
}); | ||
|
||
closePopupButton.addEventListener("click", function () { | ||
popup.style.display = "none"; | ||
overlay.style.display = "none"; | ||
}); | ||
|
||
const close = document.querySelectorAll(".navclose"); | ||
document.getElementById("openMenu").addEventListener("click", function () { | ||
document.getElementById("menuContainer").style.display = "flex"; | ||
}); | ||
|
||
document.getElementById("closeMenu").addEventListener("click", function () { | ||
document.getElementById("menuContainer").style.display = "none"; | ||
}); | ||
document.querySelectorAll(".close").addEventListener("click", function () { | ||
document.getElementById("menuContainer").style.display = "none"; | ||
}); | ||
|
||
function handleClose() { | ||
document.getElementById("menuContainer").style.display = "none"; | ||
} | ||
|
||
|
||
// functionality of the scroll effect for the navbar | ||
const nav = document.querySelector('nav'); | ||
const whereWePlantSection = document.querySelector('.locations'); | ||
|
||
// Function to add/remove dark background | ||
function handleScroll() { | ||
const sectionTop = whereWePlantSection.getBoundingClientRect().top; | ||
const threshold = window.innerHeight * 0.1; | ||
|
||
if (sectionTop <= threshold) { | ||
nav.classList.add('dark'); | ||
} else { | ||
nav.classList.remove('dark'); | ||
} | ||
} | ||
|
||
window.addEventListener('scroll', handleScroll); |