File tree Expand file tree Collapse file tree 2 files changed +100
-1
lines changed Expand file tree Collapse file tree 2 files changed +100
-1
lines changed Original file line number Diff line number Diff line change 17
17
< body >
18
18
< nav class ="navbar ">
19
19
< p > Chryz-Hub</ p >
20
+ < input type ="checkbox " class ="checkbox " id ="chk " />
21
+ < label class ="label " for ="chk ">
22
+ < i class ="fas fa-moon "> </ i >
23
+ < i class ="fas fa-sun "> </ i >
24
+ < div class ="ball "> </ div >
25
+ </ label >
20
26
</ nav >
21
27
< div class ="container ">
22
28
< div class ="row ">
78
84
< footer >
79
85
< p class ="footer-bottom "> Made with ❤️ by < a href ="https://github.com/chryz-hub "> ChryzHub</ a > </ p >
80
86
</ footer >
87
+ < script >
88
+ const chk = document . getElementById ( 'chk' ) ;
89
+ chk . addEventListener ( 'change' , ( ) => {
90
+ document . body . classList . toggle ( 'dark' ) ;
91
+ } ) ;
92
+ </ script >
81
93
</ body >
82
94
</ html >
Original file line number Diff line number Diff line change 5
5
font-family : "Open Sans" ;
6
6
}
7
7
8
+ .label {
9
+ background-color : # 111 ;
10
+ border-radius : 50px ;
11
+ justify-content : space-between;
12
+ position : relative;
13
+ height : 26px ;
14
+ width : 50px ;
15
+ float : right;
16
+ padding : 5px ;
17
+ align-items : center;
18
+ display : flex;
19
+ transform : scale (1.2 );
20
+ }
21
+
22
+ .checkbox {
23
+ opacity : 0 ;
24
+ position : absolute;
25
+ }
26
+
27
+ .label .ball {
28
+ background-color : # fff ;
29
+ border-radius : 50% ;
30
+ position : absolute;
31
+ top : 2px ;
32
+ left : 2px ;
33
+ height : 22px ;
34
+ width : 22px ;
35
+ transition : transform 0.2s linear;
36
+ }
37
+
38
+ .checkbox : checked + .label .ball {
39
+ transform : translateX (22px );
40
+ }
41
+
42
+ .fa-moon {
43
+ color : # f1c40f ;
44
+ font-size : 15px ;
45
+ }
46
+
47
+ .fa-sun {
48
+ color : # f39c12 ;
49
+ padding-left : 10px ;
50
+ font-size : 15px ;
51
+ }
52
+
53
+
8
54
body {
9
- background : white;
10
55
width : 100% ;
56
+ margin : 0 ;
57
+ background-color : # fafafa ;
58
+ height : 100% ;
59
+ transition : background 0.2s linear;
60
+ }
61
+
62
+ body .dark {
63
+ background : # 292C35 ;
64
+ }
65
+
66
+ body .dark nav {
67
+ background : white;
68
+ }
69
+
70
+ body .dark nav p {
71
+ color : black;
72
+ }
73
+
74
+ body .dark nav {
75
+ background : white;
76
+ }
77
+
78
+ body .dark .list {
79
+ color : white;
80
+ border : 1px solid white;
81
+ }
82
+
83
+ body .dark .about_chryzhub {
84
+ color : white;
85
+ }
86
+
87
+ body .dark footer {
88
+ background : white;
89
+ }
90
+
91
+ body .dark .footer-bottom {
92
+ color : black;
93
+ }
94
+
95
+ body .dark .footer-bottom a {
96
+ color : black;
11
97
}
12
98
13
99
.row {
33
119
color : white;
34
120
margin-left : auto;
35
121
margin-right : auto;
122
+ padding-left : 50px ;
36
123
}
37
124
38
125
.about_chryzhub {
You can’t perform that action at this time.
0 commit comments