Skip to content

Commit 4fb6c60

Browse files
committed
updated for small screens
1 parent f5fb1a0 commit 4fb6c60

File tree

1 file changed

+61
-40
lines changed

1 file changed

+61
-40
lines changed

tools/circle-area-calculator/circle-area-calculator.css

+61-40
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ body {
77
align-items: center;
88
height: 100vh;
99
margin: 0;
10+
padding: 0; /* Add padding for smaller screens */
1011
}
1112

1213
.calculator-container {
@@ -17,13 +18,14 @@ body {
1718
max-width: 400px;
1819
width: 100%;
1920
text-align: center;
20-
color: #333; /* Text color aligned with the main site */
21+
color: #333;
22+
box-sizing: border-box; /* Ensure padding is considered in width calculation */
2123
}
2224

2325
h1 {
2426
font-size: 2em;
2527
margin-bottom: 15px;
26-
color: #333; /* Heading color */
28+
color: #333;
2729
}
2830

2931
p {
@@ -34,23 +36,22 @@ p {
3436

3537
/* Form Styling */
3638
.calculator-form .form-group {
37-
margin-bottom: 25px; /* Add extra margin */
39+
margin-bottom: 25px;
3840
margin-right: 26px;
3941
}
4042

4143
.calculator-form input {
4244
width: 100%;
43-
padding: 12px;
45+
padding: 12px;
4446
border-radius: 10px;
4547
border: 1px solid #ddd;
4648
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
4749
transition: all 0.2s ease-in-out;
48-
font-size: 0.9em;
4950
}
5051

5152
.calculator-form input:focus {
5253
border-color: #333;
53-
box-shadow: 0 4px 12px rgba(51, 51, 51, 0.2); /* Focus shadow adjusted */
54+
box-shadow: 0 4px 12px rgba(51, 51, 51, 0.2);
5455
outline: none;
5556
}
5657

@@ -62,15 +63,15 @@ p {
6263
border: none;
6364
cursor: pointer;
6465
font-size: 1.1em;
65-
box-shadow: 0 4px 10px rgba(0, 123, 255, 0.2); /* Button shadow */
66-
transition: background-color 0.3s ease, transform 0.2s ease;
66+
box-shadow: 0 4px 10px rgba(0, 123, 255, 0.2);
67+
transition: background-color 0.3s ease;
6768
}
6869

6970
.calculate-btn:hover {
70-
background-color: #007bff; /* Hover effect on button */
71-
transform: scale(1.05); /* Slight animation on hover */
71+
background-color: #007bff;
7272
}
7373

74+
/* Result Display */
7475
.result-display {
7576
margin-top: 20px;
7677
padding: 15px;
@@ -79,21 +80,11 @@ p {
7980
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
8081
font-size: 1.2em;
8182
color: #333;
82-
animation: fadeIn 0.5s ease-in-out;
83-
}
84-
85-
@keyframes fadeIn {
86-
from {
87-
opacity: 0;
88-
}
89-
to {
90-
opacity: 1;
91-
}
9283
}
9384

9485
.result-display p {
95-
margin: 0; /* Remove default paragraph margin */
96-
padding: 0; /* Ensure no padding inside the paragraph */
86+
margin: 0;
87+
padding: 0;
9788
line-height: 1.5;
9889
}
9990

@@ -103,35 +94,65 @@ p {
10394

10495
/* Spacer */
10596
.spacer {
106-
height: 10px; /* Adds space after label */
97+
height: 10px;
10798
}
10899

100+
/* Signature Styling */
109101
.signature {
110-
font-size: 0.9em;
111-
color: #888888;
102+
font-size: 0.8em;
103+
color: #888888;
112104
text-align: center;
113-
margin-top: 20px;
114-
font-style: italic;
105+
margin-top: 20px;
106+
font-style: italic;
115107
}
116108

117109
.signature-link {
118-
color: #888888;
119-
text-decoration: none;
120-
font-style: italic;
110+
color: #888888;
111+
text-decoration: none;
112+
font-style: italic;
121113
}
122114

123115
.signature-link:hover {
124-
color: #F86709;
116+
color: #F86709;
125117
}
126118

127-
/* Input and Button Width */
128-
.calculator-form input,
129-
.calculate-btn {
130-
width: 100%;
131-
}
119+
/* Mobile Responsiveness */
120+
@media only screen and (max-width: 600px) {
121+
body {
122+
padding: 10px;
123+
height: 100vh; /* Ensure full height is used for centering */
124+
}
132125

133-
/* Accessibility and Focus States */
134-
.calculator-form input:focus,
135-
.calculate-btn:focus {
136-
outline: none;
126+
.calculator-container {
127+
max-width: 100%;
128+
padding: 20px;
129+
margin: auto; /* Center the container horizontally */
130+
}
131+
132+
h1 {
133+
font-size: 1.5em;
134+
}
135+
136+
p {
137+
font-size: 1em;
138+
}
139+
140+
.calculator-form input {
141+
font-size: 1em;
142+
padding: 10px;
143+
}
144+
145+
.calculate-btn {
146+
font-size: 1em;
147+
padding: 10px 15px;
148+
}
149+
150+
.result-display {
151+
font-size: 1em;
152+
padding: 12px;
153+
}
154+
155+
.signature {
156+
font-size: 0.7em;
157+
}
137158
}

0 commit comments

Comments
 (0)