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

Add active link highlight in navbar for improved navigation #850

Merged
merged 1 commit into from
Nov 1, 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 about.html
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
<div class="logo" style="margin-right: 200px; font-size: 20px;">Ticket Marketplace</div>
<div>
<a href="index.html"><i class="fas fa-home"></i> Home</a>
<a href="about.html"><i class="fas fa-info-circle"></i> About</a>
<a href="about.html" class="active"><i class="fas fa-info-circle"></i> About</a>
<a href="buy.html"><i class="fas fa-ticket-alt"></i> Buy Ticket</a>
<a href="sell.html"><i class="fas fa-tags"></i> Sell</a>
<a href="contactus.html"><i class="fas fa-envelope"></i> Contact</a>
Expand Down
2 changes: 1 addition & 1 deletion buy.html
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@
<div>
<a href="index.html"><i class="fas fa-home"></i> Home</a>
<a href="about.html"><i class="fas fa-info-circle"></i> About</a>
<a href="buy.html"><i class="fas fa-ticket-alt"></i> Buy Ticket</a>
<a href="buy.html" class="active"><i class="fas fa-ticket-alt"></i> Buy Ticket</a>
<a href="sell.html"><i class="fas fa-tags"></i> Sell</a>
<a href="contactus.html"><i class="fas fa-envelope"></i> Contact</a>
<a href="contributor.html"><i class="fas fa-users"></i> Contributors</a>
Expand Down
2 changes: 1 addition & 1 deletion contactus.html
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@
<a href="about.html"><i class="fas fa-info-circle"></i> About</a>
<a href="buy.html"><i class="fas fa-ticket-alt"></i> Buy Ticket</a>
<a href="sell.html"><i class="fas fa-tags"></i> Sell</a>
<a href="#contact"><i class="fas fa-envelope"></i> Contact</a>
<a href="#contact" class="active"><i class="fas fa-envelope"></i> Contact</a>
<a href="contributor.html"><i class="fas fa-users"></i> Contributors</a>
<a href="register.html"><i class="fas fa-sign-in-alt"></i> Login</a>

Expand Down
2 changes: 1 addition & 1 deletion contributor.html
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@
<a href="buy.html"><i class="fas fa-ticket-alt"></i> Buy Ticket</a>
<a href="sell.html"><i class="fas fa-tags"></i> Sell</a>
<a href="contactus.html"><i class="fas fa-envelope"></i> Contact</a>
<a href="contributor.html"><i class="fas fa-users"></i> Contributors</a>
<a href="contributor.html" class="active"><i class="fas fa-users"></i> Contributors</a>
<a href="register.html"><i class="fas fa-sign-in-alt"></i> Login</a>

</div>
Expand Down
31 changes: 29 additions & 2 deletions index.css
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,39 @@ p {
text-decoration: none;
margin-right: 20px;
font-weight: 600;
position: relative; /* Needed for the underline to position correctly */
}

/* Hover Effect */
.navbar a:hover {
text-decoration: underline;
color: #ffd700; /* Change text color on hover */
font-weight: bold; /* Optional: make hover link bold */
}

/* Active Link Styles */
.navbar a.active {
color: #ffd700;
font-weight: bold;
}

/* Underline effect for active link */
.navbar a.active::after,
.navbar a:hover::after {
content: "";
position: absolute;
left: 0;
right: 0;
bottom: -5px;
height: 2px;
background-color: #ffd700;
transform: scaleX(1);
transition: transform 0.3s ease;
}

/* Optional: Remove underline on hover if you want to keep it only for active */
.navbar a:hover::after {
transform: scaleX(1); /* Keep underline visible on hover */
}
.logo {
font-size: 1.5rem;
font-weight: bold;
Expand Down Expand Up @@ -749,4 +776,4 @@ button:hover {
.faq-heading {
font-size: 20px;
}
}
}
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ <h2>What type of transportation do you prefer for your travels?</h2>

<!-- Navbar Links -->
<div id="navLinks">
<a href="index.html"><i class="fas fa-home"></i> Home</a>
<a href="index.html" class="active"><i class="fas fa-home"></i> Home</a>
<a href="about.html"><i class="fas fa-info-circle"></i> About</a>
<a href="buy.html"><i class="fas fa-ticket-alt"></i> Buy Ticket</a>
<a href="sell.html"><i class="fas fa-tags"></i> Sell</a>
Expand Down
Loading