Skip to content

Commit

Permalink
Merge pull request #850 from Priyanshi0112/active_link
Browse files Browse the repository at this point in the history
Add active link highlight in navbar for improved navigation
  • Loading branch information
ankit071105 authored Nov 1, 2024
2 parents af438dc + 132811e commit 4549850
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 7 deletions.
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 @@ -346,7 +346,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>
</div>
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

0 comments on commit 4549850

Please sign in to comment.