-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update :- Light and Dark mode & Dashbord
- Loading branch information
Showing
5 changed files
with
185 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,58 @@ | ||
/* Navbar.css */ | ||
.navbar { | ||
display: flex; | ||
justify-content: start; /* Center the links */ | ||
align-items: start; | ||
background-color: #f9cff2; /* Darker background */ | ||
padding: 1.7rem; | ||
position: fixed; /* Fix the navbar at the top */ | ||
top: 0; | ||
left: 0; | ||
width: 100%; /* Stretch the navbar across the entire screen */ | ||
z-index: 1000; /* Ensure it stays on top */ | ||
} | ||
|
||
.navbar a { | ||
display: inline-block; | ||
padding: 0rem 0.9rem 0.5rem 0.9rem ; | ||
color: #111344; /* Light blue text */ | ||
font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif; | ||
margin: 0px 20px; | ||
text-decoration: none; | ||
font-weight: bold; | ||
font-size: 1.2rem; | ||
transition: background-color 0.3s ease; | ||
} | ||
|
||
.navbar a:hover { | ||
background-color: #eba6e6; /* Slightly brighter on hover */ | ||
border-radius: 8px; | ||
} | ||
|
||
.navbar a.active { | ||
color: #ffffff; /* White color for active link */ | ||
border-bottom: 2px solid #61dafb; | ||
} | ||
|
||
/* Add some margin to push content below the navbar */ | ||
.body-content { | ||
margin-top: 40px; /* Adjust this based on the height of your navbar */ | ||
} | ||
|
||
|
||
display: flex; | ||
justify-content: start; | ||
align-items: start; | ||
padding: 1.7rem; | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
z-index: 1000; | ||
} | ||
body.dark .navbar { | ||
background-color: #333; | ||
} | ||
|
||
body.dark .navbar a { | ||
color: #f0f0f0; | ||
} | ||
|
||
.navbar.light { | ||
background-color: #f9cff2; | ||
} | ||
|
||
.navbar.dark { | ||
background-color: #333333; | ||
} | ||
|
||
.navbar a { | ||
display: inline-block; | ||
padding: 0rem 0.9rem 0.5rem 0.9rem; | ||
margin: 0px 20px; | ||
text-decoration: none; | ||
font-weight: bold; | ||
font-size: 1.2rem; | ||
transition: background-color 0.3s ease; | ||
} | ||
|
||
.navbar a.light { | ||
color: #111344; | ||
} | ||
|
||
.navbar a.dark { | ||
color: #f9f9f9; | ||
} | ||
|
||
.navbar a:hover { | ||
background-color: #eba6e6; | ||
border-radius: 8px; | ||
} | ||
|
||
.navbar a.active { | ||
border-bottom: 2px solid #61dafb; | ||
} | ||
|
||
.body-content { | ||
margin-top: 40px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
body.light { | ||
background-color: #ffffff; | ||
color: #111344; | ||
} | ||
|
||
body.dark { | ||
background-color: #1e1e1e; | ||
color: #f9f9f9; | ||
} | ||
|
||
.navbar.light { | ||
background-color: #f9cff2; /* Light mode background */ | ||
} | ||
|
||
.navbar.dark { | ||
background-color: #333333; /* Dark mode background */ | ||
} | ||
|
||
.navbar a.light { | ||
color: #111344; /* Light mode text */ | ||
} | ||
|
||
.navbar a.dark { | ||
color: #f9f9f9; /* Dark mode text */ | ||
} | ||
|
||
/* Wheel styling */ | ||
.wheel { | ||
width: 100px; /* Diameter of the wheel */ | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
cursor: pointer; | ||
margin-left: 33vw; | ||
margin-bottom: 63vh; | ||
transition: transform 0.4s ease; /* smooth transition */ | ||
|
||
} | ||
|
||
/* Inner wheel styling */ | ||
.wheel-inner { | ||
width: 80%; /* Inner circle */ | ||
height: 80%; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: 2rem; /* Icon size */ | ||
transition: transform 0.4s ease; | ||
} | ||
|
||
/* Rotate effect on hover */ | ||
.wheel:hover { | ||
transform: rotate(360deg); /* full rotation */ | ||
} | ||
|
||
/* Wiggle effect on click */ | ||
.wheel:active .wheel-inner { | ||
animation: wiggle 0.5s ease; /* trigger wiggle when clicked */ | ||
} | ||
|
||
/* Keyframes for wiggle effect */ | ||
@keyframes wiggle { | ||
0% { transform: rotate(0deg); } | ||
25% { transform: rotate(10deg); } | ||
50% { transform: rotate(-10deg); } | ||
75% { transform: rotate(10deg); } | ||
100% { transform: rotate(0deg); } | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React, { useState, useEffect } from "react"; | ||
import "./ThemeToggle.css"; | ||
|
||
const ThemeToggle = () => { | ||
const [theme, setTheme] = useState(localStorage.getItem("theme") || "light"); | ||
|
||
useEffect(() => { | ||
document.body.className = theme; | ||
localStorage.setItem("theme", theme); | ||
}, [theme]); | ||
|
||
const toggleTheme = () => { | ||
setTheme((prevTheme) => (prevTheme === "light" ? "dark" : "light")); | ||
}; | ||
|
||
return ( | ||
<div className="wheel" onClick={toggleTheme}> | ||
<div className="wheel-inner"> | ||
{theme === "light" ? "🌚" : "🌞"} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ThemeToggle; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters