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

Corrected Address #770

Merged
merged 2 commits into from
Aug 11, 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
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<source src="./assets/videos/1.mp4" type="video/mp4" />
</video>

<div id="nav-placeholder"></div>
<div id="home-nav-placeholder"></div>

<div class="settings">
<div class="whole-background">
Expand Down
47 changes: 46 additions & 1 deletion js/nav.footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,54 @@ const footer = `
</div>
`;

const home_navbar = `

<!-- Since the relative address of other pages is different for home page, so it needs its own custom path, and hence own nav-bar -->

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" />
<nav class="navbarr" style="color: white">
<div class="logo">
<a href="./index.html">Dots & Boxes βš„</a>
</div>

<ul class="nav-links" id="nav-links-toggled">
<li>
<a href="./index.html"><i class="fas fa-home"></i>Home</a>
</li>
<li>
<a href="./pages/about.html"><i class="fas fa-info-circle"></i>About Us</a>
</li>
<li>
<a href="./pages/FAQs.html"><i class="fas fa-question-circle"></i>FAQs</a>
</li>
<li>
<a href="./pages/contributors.html"><i class="fas fa-users"></i>Contributors</a>
</li>
<li>
<a href="pages/testimonials.html"><i class="fas fa-users"></i>Testimonials</a>
</li>

</ul>

<nav class="mobile-menu">
<div class="mobile-menu__trigger"><span></span></div>
<a class="page-scroll active-link" href="./index.html">Home </a>
<a class="page-scroll" href="./pages/about.html">About Us </a>
<a class="page-scroll" href="./pages/FAQs.html">FAQs</a>
<a class="page-scroll" href="/pages/contributors.html">Contributors</a>
</nav>
</nav>
`;

document.addEventListener("DOMContentLoaded", () => {
document.getElementById("nav-placeholder").innerHTML = navbar;
document.getElementById("footer-placeholder").innerHTML = footer;
try {
document.getElementById("nav-placeholder").innerHTML = navbar;
}
// For home-page
catch(err) {
document.getElementById("home-nav-placeholder").innerHTML = home_navbar;
}

const mobile_menu = document.querySelector(".mobile-menu"),
mobile_trigger = document.querySelector(".mobile-menu__trigger");
Expand Down
Loading