-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implemented dark mode and side navigation
- Loading branch information
1 parent
dff2354
commit 023f0b4
Showing
19 changed files
with
355 additions
and
287 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
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 |
---|---|---|
@@ -0,0 +1,117 @@ | ||
body { | ||
background-color: rgb(59 130 246); | ||
color: #fff; | ||
align-items: center; | ||
text-align: center; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
width: 100%; | ||
height: 100%; | ||
overflow: hidden; | ||
} | ||
|
||
.lds-roller { | ||
display: inline-block; | ||
position: relative; | ||
width: 80px; | ||
height: 80px; | ||
} | ||
|
||
.lds-roller div { | ||
animation: lds-roller 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite; | ||
transform-origin: 40px 40px; | ||
} | ||
|
||
.lds-roller div:after { | ||
content: " "; | ||
display: block; | ||
position: absolute; | ||
width: 7px; | ||
height: 7px; | ||
border-radius: 50%; | ||
background: #fff; | ||
margin: -4px 0 0 -4px; | ||
} | ||
|
||
.lds-roller div:nth-child(1) { | ||
animation-delay: -0.036s; | ||
} | ||
|
||
.lds-roller div:nth-child(1):after { | ||
top: 63px; | ||
left: 63px; | ||
} | ||
|
||
.lds-roller div:nth-child(2) { | ||
animation-delay: -0.072s; | ||
} | ||
|
||
.lds-roller div:nth-child(2):after { | ||
top: 68px; | ||
left: 56px; | ||
} | ||
|
||
.lds-roller div:nth-child(3) { | ||
animation-delay: -0.108s; | ||
} | ||
|
||
.lds-roller div:nth-child(3):after { | ||
top: 71px; | ||
left: 48px; | ||
} | ||
|
||
.lds-roller div:nth-child(4) { | ||
animation-delay: -0.144s; | ||
} | ||
|
||
.lds-roller div:nth-child(4):after { | ||
top: 72px; | ||
left: 40px; | ||
} | ||
|
||
.lds-roller div:nth-child(5) { | ||
animation-delay: -0.18s; | ||
} | ||
|
||
.lds-roller div:nth-child(5):after { | ||
top: 71px; | ||
left: 32px; | ||
} | ||
|
||
.lds-roller div:nth-child(6) { | ||
animation-delay: -0.216s; | ||
} | ||
|
||
.lds-roller div:nth-child(6):after { | ||
top: 68px; | ||
left: 24px; | ||
} | ||
|
||
.lds-roller div:nth-child(7) { | ||
animation-delay: -0.252s; | ||
} | ||
|
||
.lds-roller div:nth-child(7):after { | ||
top: 63px; | ||
left: 17px; | ||
} | ||
|
||
.lds-roller div:nth-child(8) { | ||
animation-delay: -0.288s; | ||
} | ||
|
||
.lds-roller div:nth-child(8):after { | ||
top: 56px; | ||
left: 12px; | ||
} | ||
|
||
@keyframes lds-roller { | ||
0% { | ||
transform: rotate(0deg); | ||
} | ||
|
||
100% { | ||
transform: rotate(360deg); | ||
} | ||
} |
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,27 @@ | ||
<!DOCTYPE html> | ||
<html lang="bal" dir="rtl"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Sayad Ganj - Splash Screen</title> | ||
<link rel="stylesheet" href="splash.css"> | ||
</head> | ||
|
||
<body> | ||
<h1>سیدگَنج</h1> | ||
<h2>بلوچی ءِ اوّلی بزانت بلد</h2> | ||
<div class="lds-roller"> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
</div> | ||
</body> | ||
|
||
</html> |
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,23 +1,53 @@ | ||
import React from 'react'; | ||
import React,{useState, useEffect} from 'react'; | ||
import { | ||
Route, | ||
Routes | ||
Routes, | ||
} from 'react-router-dom'; | ||
import Home from './components/Home/Home'; | ||
import Navigation from './components/Navigation/Navigation'; | ||
import SearchResults from './components/Search/SearchResults'; | ||
import WordDetail from './components/WordDetail/WordDetail'; | ||
|
||
const App = () => { | ||
const prefersDarkMode = window.matchMedia( | ||
'(prefers-color-scheme: dark)' | ||
).matches | ||
|
||
const App = () => ( | ||
<div className='ُh-[800px] overflow:hidden flex flex-col items-center justify-center'> | ||
<div className='h-[550px] mt-[110px] w-screen overflow-auto'> | ||
<Routes> | ||
<Route path="/" element={<Home />} /> | ||
<Route path="/search/:query" element={<SearchResults />} /> | ||
<Route path="/word/:id" element={<WordDetail />} /> | ||
</Routes> | ||
const [isDarkMode, setIsDarkMode] = useState( | ||
localStorage.getItem('theme') | ||
? localStorage.getItem('theme') === 'dark' | ||
: prefersDarkMode | ||
? true | ||
: false | ||
) | ||
|
||
useEffect(() => { | ||
if (isDarkMode) { | ||
document.documentElement.classList.add('dark') | ||
} else { | ||
document.documentElement.classList.remove('dark') | ||
} | ||
}, [isDarkMode]) | ||
|
||
const handleDarkMode = (isDarkMode) => { | ||
setIsDarkMode(isDarkMode) | ||
localStorage.setItem('theme', isDarkMode ? 'dark' : 'light') | ||
} | ||
|
||
return ( | ||
<div className='ُmin-h-screen relative'> | ||
<div className='min-h-[calc(100vh-28px)] h-[calc(100vh-28px)] absolute top-0 bottom-0 right-0 border-l dark:border-gray-700 w-12'> | ||
<Navigation isDarkMode={isDarkMode} handleDarkMode={handleDarkMode}/> | ||
</div> | ||
<div className='h-[calc(100vh-28px)] absolute top-0 bottom-0 left-0 right-12 overflow-auto'> | ||
<Routes> | ||
<Route path="/" element={<Home />} /> | ||
<Route path="/search/:query" element={<SearchResults />} /> | ||
<Route path="/word/:id" element={<WordDetail />} /> | ||
</Routes> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
) | ||
} | ||
|
||
export default App; |
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
Oops, something went wrong.