-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyle.css
209 lines (178 loc) · 3.98 KB
/
style.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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
text-decoration: none;
list-style: none;
}
html {
font-size: 62.5%;
scroll-behavior: smooth; /* Add smooth scrolling */
}
body {
font-family: 'Poppins', sans-serif;
background-color: #f0f0f0;
height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
/* Header Section */
header {
width: 100%;
height: 13vh;
background-color: #007bff;
}
nav {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 5rem;
}
nav > a {
display: inline-block;
font-size: 3.5rem;
color: white;
position: relative;
}
nav > a::before,
nav > a::after {
content: '';
position: absolute;
background-color: white;
height: .3rem;
transition: all .3s ease;
}
nav > a::before {
left: 0;
bottom: 0;
width: 0;
}
nav > a::after {
right: 0;
top: 0;
width: 0;
}
nav > a:hover::before,
nav > a:hover::after {
width: 100%;
}
nav ol {
display: flex;
align-items: center;
justify-content: center;
gap: 3rem;
}
nav a {
font-size: 1.6rem;
position: relative;
color: white;
letter-spacing: 1px;
}
nav a:hover {
color: wheat;
}
/* Main Section */
main {
width: 100%;
height: calc(100vh - 13vh);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
padding: 2rem; /* Add some padding */
}
h1 {
font-size: 4rem; /* Increased title size */
color: gray;
margin-bottom: 3rem; /* Use margin for spacing */
}
.input {
width: clamp(30rem, 50rem, 80%);
display: flex;
align-items: center;
justify-content: center;
gap: 2rem;
}
.input-group {
position: relative;
height: 4rem;
flex: 1 0 30rem;
}
input {
height: 100%;
width: 100%;
padding: 0 3rem 0 1.5rem;
border: none;
font-size: 1.6rem;
letter-spacing: 1px;
outline: none; /* Removed outline */
background-color: transparent;
position: relative; /* Position relative for pseudo-element */
}
input::after {
content: '';
position: absolute;
left: 50%; /* Start from the middle */
bottom: -2px; /* Position just below the input */
width: 100%;
height: 2px; /* Height of the underline */
background-color: #0056b3; /* Blue color */
transform: translateX(-50%); /* Center it */
transition: width 0.4s ease, left 0.4s ease; /* Transition for width and left */
width: 0; /* Initially hidden */
}
input:focus::after {
left: 50%; /* Keep centered */
width: 100%; /* Expand to full width */
transform: translateX(-50%); /* Keep it centered */
}
input:focus {
border-bottom-color: transparent; /* Hide the default border when focused */
}
label {
position: absolute;
left: 1.5rem;
top: 50%;
transition: all .3s ease;
transform: translateY(-50%);
font-size: 1.5rem;
}
input:focus + label,
input:valid + label {
top: -.5rem;
left: 1rem;
font-size: 1.3rem;
}
/* Result Styling */
#result {
margin-top: 1rem; /* Adjusted space above the result */
font-size: 2rem; /* Larger font size for visibility */
font-weight: 600; /* Make it bold */
color: #333; /* Dark color for contrast */
text-align: center; /* Center the result */
padding: 1rem; /* Add some padding for better visibility */
background-color: #e7f1ff; /* Light background for contrast */
border-radius: 0.5rem; /* Rounded corners */
}
/* Responsive Design for Mobile */
@media (max-width: 768px) {
nav {
padding: 0 2rem;
}
main {
padding: 2rem;
}
h1 {
font-size: 3.2rem; /* Adjusted for smaller screens */
}
input {
font-size: 1.4rem;
}
#result {
font-size: 1.8rem; /* Slightly smaller on mobile */
}
}