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 active link functionality in navbar for accurate page indication #2567

Merged
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 about.html
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
🏑</a>
</li>
<li class="nav-item">
<a class="page-scroll" href="./about.html" style="color: rgb(237, 242, 244);">About Us πŸ“–</a>
<a class="page-scroll active-link" href="./about.html" style="color: rgb(237, 242, 244);">About Us πŸ“–</a>
</li>
<li class="nav-item">
<a class="page-scroll" href="./finance.html" style="color: rgb(237, 242, 244);">Courses πŸ“š</a>
Expand Down
10 changes: 8 additions & 2 deletions assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -866,8 +866,14 @@ p {
.navbar-nav .nav-item a:hover {
text-decoration: none !important;
}


.active-link {
background-color: rgba(255, 99, 71, 0.2);
border-radius: 5px;
color: #ffffff;
transform: scale(0.95);
border-bottom: 2px solid #edf2f4;
transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}
.sticky {
position: fixed;
z-index: 99;
Expand Down
4 changes: 2 additions & 2 deletions contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@
</div>
<ul id="nav" class="navbar-nav ml-auto" style="margin: auto;">
<li class="nav-item">
<a class="page-scroll active-link" href="./index.html" style="color: rgb(237, 242, 244);">Home
<a class="page-scroll" href="./index.html" style="color: rgb(237, 242, 244);">Home
🏑</a>
</li>
<li class="nav-item">
Expand All @@ -371,7 +371,7 @@
<a class="page-scroll" href="./finance.html" style="color: rgb(237, 242, 244);">Courses πŸ“š</a>
</li>
<li class="nav-item">
<a class="page-scroll" href="./contact.html" style="color: rgb(237, 242, 244);">ContactπŸ“ž</a>
<a class="page-scroll active-link" href="./contact.html" style="color: rgb(237, 242, 244);">ContactπŸ“ž</a>
</li>
<li class="nav-item">
<a class="page-scroll" href="./faq.html" style="color: rgb(237, 242, 244);">Help πŸ™‹β€β™‚οΈ</a>
Expand Down
2 changes: 1 addition & 1 deletion finance.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<a class="page-scroll" href="./about.html" style="color: rgb(237, 242, 244);">About Us πŸ“–</a>
</li>
<li class="nav-item">
<a class="page-scroll" href="./finance.html" style="color: rgb(237, 242, 244);">Courses πŸ“š</a>
<a class="page-scroll active-link" href="./finance.html" style="color: rgb(237, 242, 244);">Courses πŸ“š</a>
</li>
<li class="nav-item">
<a class="page-scroll" href="./contact.html" style="color: rgb(237, 242, 244);">ContactπŸ“ž</a>
Expand Down
14 changes: 0 additions & 14 deletions navbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,6 @@ z
-ms-transition: background-color 0.3s ease-in-out;
-o-transition: background-color 0.3s ease-in-out;
} */
.active-link {
background-color: rgba(255, 99, 71, 0.2);
/* Soft coral with slight transparency */
border-radius: 5px;
color: #ffffff;
/* White text for contrast */
transform: scale(0.95);
border-bottom: 2px solid #edf2f4;
}

.navbar-nav {

Expand Down Expand Up @@ -492,11 +483,6 @@ z
width: 0;
}

.mobile-menu .active-link {
background:
linear-gradient(black) bottom/ 100% 2px no-repeat,
transparent;
}

.mobile-menu__trigger {
cursor: pointer;
Expand Down
Loading