Skip to content

Commit

Permalink
Fixed copyright year and added respective JS files (#146)
Browse files Browse the repository at this point in the history
* Updating copyright year and adding JS files

* Fixed placing of script tags
  • Loading branch information
Maaz-Code authored Oct 15, 2024
1 parent 45f8d2a commit 88babad
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 114 deletions.
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 @@ -339,7 +339,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 @@ -351,73 +351,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);

0 comments on commit 88babad

Please sign in to comment.