Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed copyright year and added respective JS files #146

Merged
merged 5 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 1 addition & 45 deletions about.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,50 +265,6 @@ <h2 class="quick-links">Quick Links</h2>
<button class="closePopupButton">Close</button>
</div>
</div>
<script src="./scripts/about.js"></script>
</body>
<script>
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";
}
</script>
</html>
71 changes: 2 additions & 69 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ <h2 class="quick-links">Quick Links</h2>
</div>
<div class="lower_part">
<div class="copyright-disclaimer">
©2023 - Tree2Hope All rights reserved
©2024 - Tree2Hope All rights reserved
</div>
</div>
</div>
Expand All @@ -349,73 +349,6 @@ <h2 class="quick-links">Quick Links</h2>
<button class="closePopupButton">Close</button>
</div>
</div>
<script src="./scripts/index.js"></script>
</body>
<script>
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";
}
</script>


<!-- functionality of the scroll effect for the navbar -->
<script>
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);
</script>


</html>
43 changes: 43 additions & 0 deletions scripts/about.js
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";
}
62 changes: 62 additions & 0 deletions scripts/index.js
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);