Skip to content

Commit ec098a9

Browse files
committed
Resize components
1 parent b9d6623 commit ec098a9

File tree

3 files changed

+46
-17
lines changed

3 files changed

+46
-17
lines changed

index.html

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,16 @@
4949
<link rel='icon' type='image/x-icon' href='./images/favicon.ico' />
5050
</head>
5151
<body>
52-
<div class="toggle-container">
53-
<label class="toggle-switch">
54-
<input type="checkbox" id="toggle-mode" />
55-
<span class="toggle-slider"></span>
56-
</label>
57-
</div>
52+
5853
<div class="container">
5954
<h1>
60-
<a style="text-decoration: none; color: #f1c40f; margin-left: 1.25rem; cursor: pointer;" onclick="location.reload();">CALCULATOR</a>
55+
<div class="toggle-container">
56+
<label class="toggle-switch">
57+
<input type="checkbox" id="toggle-mode" />
58+
<span class="toggle-slider"></span>
59+
</label>
60+
</div>
61+
<a class="tittle" onclick="location.reload();">CALCULATOR</a>
6162
<img id="historybutton" src="./images/history.png">
6263
</h1>
6364
<div class="calculator">
@@ -69,10 +70,10 @@ <h1>
6970
<td>
7071
<div class="row">
7172
<div class="col">
72-
<button style="background-color: #f01600; font-weight: bold; color: #ecf0f1; width: 8vw;" onclick="clearAll()">C</button>
73+
<button onclick="clearAll()">C</button>
7374
</div>
7475
<div class="col">
75-
<button style="background-color: #f01600; font-weight: bold; color: #ecf0f1;width: 8vw;" onclick="deleteLastEntry()">CE</button>
76+
<button onclick="deleteLastEntry()">CE</button>
7677
</div>
7778
</div>
7879
</td>

scripts/hist.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ let historybutton = document.getElementById('historybutton');
22
let history = document.getElementById('history');
33
let bar1 = document.getElementById('bar1');
44
let bar2 = document.getElementById('bar2');
5-
let dis=document.getElementById('answer');
5+
let dis = document.getElementById('answer');
66

77
function showHistory() {
88
let calcHistory = JSON.parse(localStorage.getItem("calcHistory")) || [];
@@ -19,7 +19,7 @@ function showHistory() {
1919
historyItem.style.fontSize = '25px';
2020
history.appendChild(historyItem);
2121
} else {
22-
for (let index = len-1; index >=0; index--) {
22+
for (let index = len-1; index >= 0; index--) {
2323
const element = calcHistory[index];
2424
let historyItem = document.createElement('div');
2525
historyItem.className = 'historyelement';
@@ -35,7 +35,7 @@ function showHistory() {
3535
historybutton.addEventListener('click', showHistory);
3636

3737
function clearAll(){
38-
dis.value=''
38+
dis.value = '';
3939
}
4040

4141
function hide(){

styles/style.css

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ h1 {
2323
font-size: 2.5rem;
2424
font-weight: 500;
2525
margin-bottom: 0;
26+
padding: 0 5px;
27+
display: flex;
28+
align-items: center;
29+
justify-content: space-between;
2630
}
2731

2832
input {
@@ -65,6 +69,7 @@ button {
6569
width: 20vw;
6670
height: 10vh;
6771
padding: 0.5rem 0;
72+
cursor: pointer;
6873
margin: 0.25vmax;
6974
font-size: 2vmax;
7075
border-radius: 1rem;
@@ -116,8 +121,6 @@ a:hover{
116121
width:40px;
117122
height:40px;
118123
border-radius: 20px;
119-
float:right;
120-
margin-right:15px;
121124
cursor: pointer;
122125
}
123126

@@ -169,13 +172,25 @@ a:hover{
169172
}
170173
}
171174

175+
@media (max-width: 700px) {
176+
td button{
177+
font-size: 18px;
178+
font-weight: 600;
179+
}
180+
}
181+
172182
.toggle-container {
173-
position: absolute;
174-
top: 4rem;
175-
left: 3rem;
183+
margin: 10px -10px 0 0;
176184

177185
}
178186

187+
.tittle{
188+
text-decoration: none;
189+
color: #f1c40f;
190+
cursor: pointer;
191+
margin-left: -20px;
192+
}
193+
179194
.toggle-switch {
180195
position: relative;
181196
display: inline-block;
@@ -278,6 +293,19 @@ input:checked + .toggle-slider:before {
278293
max-width: 20vw;
279294
margin: auto;
280295
}
296+
297+
.row .col button{
298+
background-color: #f01600;
299+
font-weight: bold;
300+
color: #ecf0f1;
301+
width: 8vw;
302+
}
303+
304+
@media (max-width: 700px) {
305+
.row .col button{
306+
width: 10vw;
307+
}
308+
}
281309

282310
#answer {
283311
caret-color: #0f38f1;

0 commit comments

Comments
 (0)