-
Notifications
You must be signed in to change notification settings - Fork 0
/
styles.css
154 lines (129 loc) · 2.9 KB
/
styles.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
body {
font-family: 'Roboto', sans-serif;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: flex-start;
height: 100vh;
margin: 0;
padding-top: 20px;
color: var(--text-color);
background-color: var(--background-color);
transition: background-color 0.3s ease, color 0.3s ease;
}
h1 {
color: var(--text-color);
transition: color 0.3s ease;
}
p {
font-size: 16px; /* change this to adjust the size of the paragraph text */
color: var(--text-color);
transition: color 0.3s ease;
}
.content {
margin: 5% auto; /* top and bottom margins 5%, left and right margins auto for centering */
width: 90%; /* it will take 90% of the viewport width */
max-width: 600px; /* it will not go beyond 600px even on wider screens */
text-align: left;
}
.floating-box {
position: absolute;
width: 50px;
height: 50px;
background-color: #000;
animation: float 5s infinite;
}
.box {
position: absolute;
width: 50px;
height: 50px;
background-color: #333;
opacity: 0.5;
animation: float 5s infinite linear;
}
@keyframes float {
0% {
transform: translate(0, 0) rotate(0deg);
}
50% {
transform: translate(100px, 100px) rotate(180deg);
}
100% {
transform: translate(0, 0) rotate(360deg);
}
}
.toggle-container i {
font-size: 30px;
color: var(--text-color); /* Make sure to transition the color */
transition: color 0.3s ease;
}
.toggle-container label .fa-sun {
transform: translateX(0); /* Modify this line */
}
.toggle-container input:checked + label .fa-sun {
transform: translateX(26px);
}
.toggle-container input:checked + label .fa-moon {
transform: translateX(0);
}
.toggle-container label::before {
content: '';
position: absolute;
left: 0;
top: 0;
width: 60px;
height: 34px;
background-color: #1da1f2;
border-radius: 34px;
transition: background-color 0.2s;
}
.toggle-container label::after {
content: '';
position: absolute;
left: 0;
top: 0;
width: 34px;
height: 34px;
background-color: white;
border-radius: 50%;
transition: transform 0.2s;
}
.toggle-container input:checked + label::before {
background-color: #111;
}
.toggle-container input:checked + label::after {
transform: translateX(26px);
}
:root {
--text-color: #333;
--background-color: #f3f3f3;
}
/* body {
color: var(--text-color);
background-color: var(--background-color);
} */
body[data-theme="dark"] {
--text-color: #f3f3f3;
--background-color: #333;
}
/* Add media query for smaller devices */
@media (max-width: 800px) {
.content {
width: 90vw;
}
p {
font-size: 18px;
}
.toggle-container {
top: 50px;
right: 120px;
}
}
.toggle-container {
position: absolute;
top: 80px;
right: 35%; /* Adjust this to position the icon properly */
/* z-index: 100; */
cursor: pointer; /* Make it look clickable */
}