-
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.
Merge pull request #100 from tohit09Fst/main
Update :- Light and Dark mode & Dashboard
- Loading branch information
Showing
10 changed files
with
1,122 additions
and
107 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,42 +1,58 @@ | ||
/* Navbar.css */ | ||
.navbar { | ||
display: flex; | ||
justify-content: start; /* Center the links */ | ||
align-items: start; | ||
background-color: #f9cff2; /* Darker background */ | ||
padding: 0.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: 0.5rem 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: 0 20px; | ||
text-decoration: none; | ||
font-weight: bold; | ||
font-size: 1.1rem; | ||
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: 80px; /* 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
/* Dashboard.css */ | ||
* { | ||
margin: 0; | ||
padding: 0; | ||
box-sizing: border-box; | ||
} | ||
:root { | ||
--bg-color: #f0f0f0; | ||
--text-color: #111; | ||
--card-bg: white; | ||
--chart-bg: white; | ||
} | ||
|
||
/* Dark mode */ | ||
body.dark { | ||
--bg-color: #1e1e1e; | ||
--text-color: #f0f0f0; | ||
--card-bg: #333; | ||
--chart-bg: #444; | ||
} | ||
|
||
html, body { | ||
height: 100%; | ||
margin: 0; | ||
font-family: Arial, sans-serif; | ||
overflow: hidden; | ||
} | ||
|
||
.dashboard-container { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
height: 100vh; /* Full height of the viewport */ | ||
width: 100vw; /* Full width of the viewport */ | ||
padding: 10px; | ||
box-sizing: border-box; | ||
|
||
background-color: var(--bg-color); | ||
color: var(--text-color); | ||
} | ||
|
||
h1 { | ||
margin-top: 20px; | ||
margin-bottom: 20px; | ||
font-size: 2.5rem; | ||
text-align: center; | ||
} | ||
|
||
.cards-container { | ||
|
||
display: grid; | ||
grid-template-columns: repeat(4, 1fr); | ||
gap: 10px; | ||
width: 100%; | ||
height: 20%; /* Take up 20% of the viewport height */ | ||
} | ||
|
||
.card { | ||
background-color: var(--card-bg); /* Dynamic background color based on mode */ | ||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); | ||
border-radius: 10px; | ||
padding: 20px; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
flex-direction: column; | ||
min-height: 150px; | ||
width: 100%; | ||
} | ||
|
||
|
||
|
||
.charts-container { | ||
display: grid; | ||
grid-template-columns: repeat(3, 1fr); | ||
gap: 10px; | ||
width: 100%; | ||
height: 80%; /* Take up the remaining 80% of the viewport height */ | ||
} | ||
|
||
.chart { | ||
background-color: white; | ||
padding: 20px; | ||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); | ||
border-radius: 10px; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 70%; | ||
margin-top: 20px; | ||
background-color: var(--chart-bg); | ||
} | ||
|
||
|
||
@media (max-width: 1024px) { | ||
.cards-container { | ||
grid-template-columns: repeat(2, 1fr); | ||
} | ||
.charts-container { | ||
grid-template-columns: repeat(2, 1fr); | ||
} | ||
} | ||
|
||
@media (max-width: 768px) { | ||
.cards-container, .charts-container { | ||
grid-template-columns: 1fr; | ||
} | ||
} | ||
|
Oops, something went wrong.