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

enhance the navbar andding hover animation logo with all nav itesm #316

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
91 changes: 91 additions & 0 deletions src/components/shared/Navbar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@

.navbar {
padding: 60px 0;
transition: background-color 0.5s ease, box-shadow 0.3s ease;
}


.navbar-brand img {
width: 80px;
height: 80px;
transition: transform 0.4s ease-in-out;
transform-style: preserve-3d;
perspective: 1000px;
}

.navbar-brand img:hover {
transform: rotateX(15deg) rotateY(15deg) translateZ(20px);
}


.navbar-brand span {
font-size: 1.8rem;
font-weight: bold;
color: whitesmoke;
transition: color 0.5s ease, transform 0.5s ease;
}

.navbar-brand span:hover {
color: #f39c12;
transform: scale(1.2);
}

.navbar-brand span {
text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.navbar-brand span:hover {
text-shadow: 2px 2px 5px rgba(243, 156, 18, 0.8);
}


.nav-link {
font-size: 1.8rem;
padding: 20px 30px;
position: relative;
display: inline-block;
transition: color 0.3s ease-in-out;

}

.nav-link::before {
content: "";
position: absolute;
width: 0;
height: 3px;
bottom: 0;
left: 0;
background-color: #f39c12;
transition: width 0.3s ease-in-out;
}

.nav-link:hover::before {
width: 100%;
}

.nav-link:hover {
color: #f39c12;
}

.nav-item svg {
font-size: 2.5rem;
transition: transform 0.3s ease-in-out;
}

.nav-item svg:hover {
transform: scale(1.2);
}
.nav-item.nav-link {
padding: 0;
}

.nav-item.nav-link:hover::before {
content: none;
}

.navbar{
height: 70px;
}
.navbar-nav{
gap: 15px;
}
9 changes: 7 additions & 2 deletions src/components/shared/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Link } from "react-router-dom";
import { MdOutlineDarkMode, MdOutlineLightMode } from "react-icons/md";
import { Collapse } from "bootstrap"; // Ensure Bootstrap's JavaScript is loaded in your project
import { Context } from "../../context/Context";
import '../shared/Navbar.css'

const Navbar = () => {
const { isDarkMode, toggleTheme } = useContext(Context);
Expand Down Expand Up @@ -69,7 +70,7 @@ const Navbar = () => {
src="logo.webp"
alt="Chanakya Image"
className="me-2"
style={{ width: "30px", height: "30px" }}
style={{ width: "40px", height: "40px" }}
/>
<span style={{ fontSize: "1.2rem", fontWeight: "bold" }}>
चाणक्य नीति
Expand All @@ -88,7 +89,7 @@ const Navbar = () => {
<span className="navbar-toggler-icon"></span>
</button>

<div className="collapse navbar-collapse" id="navbarSupportedContent">
<div className=" navbar-collapse " id="navbarSupportedContent">
<ul className="navbar-nav ms-auto mb-2 mb-lg-0">
<li className="nav-item">
<Link className="nav-link" to="/about">
Expand Down Expand Up @@ -171,6 +172,10 @@ const Navbar = () => {
</div>
</div>
</nav>




);
};

Expand Down