File tree Expand file tree Collapse file tree 8 files changed +6272
-840
lines changed Expand file tree Collapse file tree 8 files changed +6272
-840
lines changed Original file line number Diff line number Diff line change 2424 "@types/mongodb" : " ^4.0.7" ,
2525 "@types/node" : " ^18.11.15" ,
2626 "@types/react" : " ^18.0.26" ,
27+ "@types/styled-components" : " ^5.1.26" ,
2728 "axios" : " ^1.2.1" ,
2829 "react-icons" : " ^4.7.1" ,
2930 "sass" : " ^1.56.2" ,
31+ "styled-components" : " ^5.3.6" ,
3032 "typescript" : " ^4.9.4"
3133 }
3234}
Original file line number Diff line number Diff line change 1+ // icons
2+ import { BiMoon , BiSun } from "react-icons/bi"
3+
4+ function ToggleTheme ( { theme, onClick } ) {
5+ return (
6+ < button
7+ onClick = { ( ) => onClick ( ) }
8+ style = { {
9+ width : '30px' ,
10+ height : '30px' ,
11+ color : '#000' ,
12+ background : '#fff4' ,
13+ borderRadius : "60%" ,
14+ position : "fixed" ,
15+ zIndex : 100 ,
16+ border : 'none' ,
17+ cursor : "pointer" ,
18+ margin : '9px'
19+ } } >
20+ { theme == 'dark' ? < BiSun /> : < BiMoon /> }
21+ </ button >
22+ )
23+ }
24+
25+ export default ToggleTheme
Original file line number Diff line number Diff line change 11// styles
2+ import { useEffect , useState } from 'react'
3+ import ToggleTheme from '../components/toggleTheme/ToggleTheme'
24import '../styles/globals.scss'
5+ import StyleDark from "../styles/themes/dark"
6+ import StyleLight from "../styles/themes/light"
37
48function App ( { Component, pageProps } ) {
9+ const [ theme , setTheme ] = useState ( 'dark' )
10+
11+ function onClickToggle ( ) {
12+ if ( theme == 'dark' ) {
13+ setTheme ( 'light' )
14+
15+ } else {
16+ setTheme ( 'dark' )
17+ }
18+ }
519
620 return (
7- < Component { ...pageProps } />
21+ < >
22+ { theme == 'dark' ? < StyleLight /> : < StyleDark /> }
23+ < ToggleTheme onClick = { onClickToggle } theme = { theme } />
24+ < Component { ...pageProps } />
25+ </ >
826 )
927}
1028
Original file line number Diff line number Diff line change 44 margin : 0 ;
55 padding : 0 ;
66 box-sizing : border-box ;
7+ transition : 0.1s ;
78}
89
910body {
@@ -20,17 +21,15 @@ body {
2021 overflow-x : hidden ;
2122
2223 background-color : var (--primaryColor );
23-
2424}
2525
26-
2726:root {
2827 --menuWidth : 50px ;
2928}
3029
31- // @import "themes/light.scss";
32- @import " themes/dark.scss" ;
33-
3430.active {
3531 color : #ff9f19 ;
36- }
32+ }
33+
34+ // @import 'themes/dark.scss';
35+ // @import 'themes/light.scss';
Original file line number Diff line number Diff line change 1+ import { createGlobalStyle } from "styled-components" ;
2+
3+ export default createGlobalStyle `
4+ :root{
5+ --primaryColor: #ff9f19;
6+ --secondaryColor: #1f1f1e;
7+
8+ --primaryColorPastelDark25opacity: #715e438a;
9+
10+ --primaryColorPastelDark: #7b6240;
11+ --primaryColorPastelLight: #c4a67d;
12+
13+ --primaryColorPastel: #f8b557;
14+
15+
16+ --primaryColorVivid: #ff9500;
17+
18+ --labelColor: #8e8e8e;
19+ --h1Color: #f3f3f3;
20+ --h2Color: #8e8d8d;
21+ }
22+ ` ;
Original file line number Diff line number Diff line change 1+ import { createGlobalStyle } from "styled-components" ;
2+
3+ export default createGlobalStyle `
4+ :root{
5+ --primaryColor: #f4a73a;
6+ --secondaryColor: #ffffff;
7+
8+ --primaryColorPastelDark25opacity: #e19c3b8a;
9+
10+ --primaryColorPastelDark: #877762;
11+ --primaryColorPastelLight: #c4a67d;
12+
13+ --primaryColorPastel: #f8b557;
14+
15+
16+ --primaryColorVivid: #ff9500;
17+
18+ --labelColor: #8e8e8e;
19+ --h1Color: #202020;
20+ --h2Color: #555555;
21+ ` ;
You can’t perform that action at this time.
0 commit comments