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

fix: Fixed the navbar #202

Merged
merged 1 commit into from
May 10, 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 @@ -90,7 +90,7 @@
</div>

<!-- nav bar -->
<nav>
<nav id = "main_navbar">
<div class="container main-nav flex">
<a href="./index.html" class="company-logo">
<img src="./assets/asset 41.png" alt="company logo" />
Expand Down
6 changes: 5 additions & 1 deletion mode-switch.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ var darkModeEnabled = localStorage.getItem("dark-mode") === "true";

// Function to toggle dark mode
function toggleDarkMode() {
var nav = document.getElementById("main_navbar")
var footer = document.querySelector("footer");
var tables = document.querySelectorAll(".wrapper .table");
var linksTitle = document.querySelectorAll(".links-title");
Expand All @@ -25,7 +26,8 @@ function toggleDarkMode() {

if (darkModeEnabled) {
document.body.style.backgroundColor = "#111111";

nav.style.backgroundColor = "#111111";
companyLogo.style = " -webkit-filter: invert(100%);";
footer.style.backgroundColor = "#242525";
tables.forEach(function (table) {
table.style.backgroundColor = "#242426";
Expand Down Expand Up @@ -58,6 +60,8 @@ function toggleDarkMode() {
});
} else {
document.body.style.backgroundColor = "#ffffff";
nav.style.backgroundColor = "#ffffff";
companyLogo.style = " fill : black;"

footer.style.backgroundColor = "#ebf2fa";
tables.forEach(function (table) {
Expand Down
6 changes: 6 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ body {
}
nav {
text-align: center;
position: sticky;
top:2px;
background-color: #fefefe;
z-index: 1;
}

nav ul{
Expand Down Expand Up @@ -187,6 +191,8 @@ ul {
.nav-menu{
display: flex;
align-items: center;
column-gap: 15px;
width: max-content;
}

.nav-links ul {
Expand Down
Loading