Skip to content

Commit

Permalink
Merge pull request #86 from amaansyed27/main
Browse files Browse the repository at this point in the history
#69 Completed
  • Loading branch information
Jyotibrat authored Jan 28, 2025
2 parents 01032ea + be229dd commit e117ee0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/navbar.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<div class="navbar">
<a href="index.html">
<img src="logo1.png" alt="img" class="logo"></a>
<a href="index.html"><img src="logo1.png" alt="img" class="logo"></a>
<button class="hamburger" aria-label="Menu">
<span></span>
<span></span>
Expand All @@ -10,7 +9,7 @@
<nav class="nav-links">
<a href="index.html">Home</a>
<a href="about.html">About</a>
<a href="file_upload.html">Upload File</a>
<a href="file_upload.html" id="upload-link">Upload File</a>
</nav>
<!-- Toggle switch for theme -->
<label class="switch">
Expand Down
17 changes: 17 additions & 0 deletions src/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ function initializeApp() {
localStorage.setItem('theme', theme);
});
}

// Hide the "Upload File" link if on the About page
adjustPageSpecificContent();
}

function applyTheme(theme) {
Expand Down Expand Up @@ -64,10 +67,24 @@ function loadNavbar() {
document.querySelector('.header-actions')?.classList.remove('active');
}
});

// Call adjustPageSpecificContent again after navbar is loaded
adjustPageSpecificContent();
})
.catch(error => console.error('Error loading navbar:', error));
}

function adjustPageSpecificContent() {
// Hide the "Upload File" link if on the About page
const currentPage = window.location.pathname.split('/').pop();
if (currentPage === 'about.html') {
const uploadLink = document.getElementById('upload-link');
if (uploadLink) {
uploadLink.style.display = 'none';
}
}
}

// Load the footer dynamically
function loadFooter() {
const footerPlaceholder = document.getElementById('footer-placeholder');
Expand Down
3 changes: 2 additions & 1 deletion src/styles/themes.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* themes.css */

/* Base Light Theme */
body.theme-light {
--background-color: #ffffff;
Expand Down Expand Up @@ -28,7 +30,6 @@ body.theme-dark {
--highlight-color: #406896;
}


/* Apply the variables to elements */
body {
background-color: var(--background-color);
Expand Down

0 comments on commit e117ee0

Please sign in to comment.