Skip to content

Commit f996723

Browse files
committed
css updated
1 parent e819c82 commit f996723

3 files changed

Lines changed: 34 additions & 31 deletions

File tree

Projects/Calculator/index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
</head>
1414

1515
<body>
16+
<div class="desktop-message">
17+
Please switch to the desktop version for a better experience.
18+
</div>
19+
1620
<section class="main">
1721
<header class="top">
1822
<nav>

Projects/Calculator/js/script.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ for (item of buttons) {
3232
result.innerHTML = "";
3333
break;
3434

35+
case "+":
36+
inputValue += "+";
37+
input.innerHTML += "+";
38+
break;
39+
40+
case "-":
41+
inputValue += "-";
42+
input.innerHTML += "-";
43+
break;
44+
3545
case "*":
3646
inputValue += "*";
3747
input.innerHTML += "*";

Projects/Calculator/style.css

Lines changed: 20 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ body {
5353
margin: 0 auto;
5454
max-width: 400px;
5555
border-radius: 10px;
56-
margin-top: 65px;
56+
margin-top: 60px;
5757
height: 100%;
5858
}
5959

6060
#screen {
6161
position: relative;
62-
top: -70px;
62+
top: -93px;
6363
margin: 4px auto;
6464
width: 120%;
6565
left: -60px;
@@ -195,7 +195,7 @@ td {
195195

196196
#calc {
197197
position: relative;
198-
top: -70px;
198+
top: -95px;
199199
left: -250px;
200200
height: 10rem;
201201
}
@@ -212,43 +212,32 @@ td {
212212
background-color: #ff5151;
213213
}
214214

215-
@media only screen and (max-width: 768px) {
216215

217-
.main {
218-
left: 0px;
219-
}
220-
221-
#screen {
222-
width: 100%;
223-
left: 0px;
216+
/* Responsive message for screens below 893px width */
217+
@media only screen and (max-width: 893px) {
218+
.top {
219+
position: relative;
224220
}
225221

226-
#calc {
227-
left: 0px;
222+
header {
223+
color: azure;
228224
}
229-
}
230-
231-
@media only screen and (max-width: 480px) {
232225

233226
.header_title {
234-
font-size: x-large;
235-
}
236-
237-
#screen {
238-
height: 4rem;
239-
font-size: 16px;
227+
text-align: center;
228+
font-size: xxx-large;
240229
}
241230

242-
#input,
243-
#result {
244-
height: 2rem;
245-
font-size: 16px;
231+
.main {
232+
position: relative;
233+
left: 30px;
234+
display: none;
246235
}
247236

248-
button,
249-
.bottom-buttons {
250-
width: 4.5rem;
251-
height: 2.5rem;
252-
font-size: 14px;
237+
.desktop-message {
238+
display: block;
239+
text-align: center;
240+
font-size: 24px;
241+
background-color: #f9f9f9;
253242
}
254243
}

0 commit comments

Comments
 (0)