File tree Expand file tree Collapse file tree 3 files changed +46
-17
lines changed Expand file tree Collapse file tree 3 files changed +46
-17
lines changed Original file line number Diff line number Diff line change 49
49
< link rel ='icon ' type ='image/x-icon ' href ='./images/favicon.ico ' />
50
50
</ head >
51
51
< 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
+
58
53
< div class ="container ">
59
54
< 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 >
61
62
< img id ="historybutton " src ="./images/history.png ">
62
63
</ h1 >
63
64
< div class ="calculator ">
69
70
< td >
70
71
< div class ="row ">
71
72
< 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 >
73
74
</ div >
74
75
< 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 >
76
77
</ div >
77
78
</ div >
78
79
</ td >
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ let historybutton = document.getElementById('historybutton');
2
2
let history = document . getElementById ( 'history' ) ;
3
3
let bar1 = document . getElementById ( 'bar1' ) ;
4
4
let bar2 = document . getElementById ( 'bar2' ) ;
5
- let dis = document . getElementById ( 'answer' ) ;
5
+ let dis = document . getElementById ( 'answer' ) ;
6
6
7
7
function showHistory ( ) {
8
8
let calcHistory = JSON . parse ( localStorage . getItem ( "calcHistory" ) ) || [ ] ;
@@ -19,7 +19,7 @@ function showHistory() {
19
19
historyItem . style . fontSize = '25px' ;
20
20
history . appendChild ( historyItem ) ;
21
21
} else {
22
- for ( let index = len - 1 ; index >= 0 ; index -- ) {
22
+ for ( let index = len - 1 ; index >= 0 ; index -- ) {
23
23
const element = calcHistory [ index ] ;
24
24
let historyItem = document . createElement ( 'div' ) ;
25
25
historyItem . className = 'historyelement' ;
@@ -35,7 +35,7 @@ function showHistory() {
35
35
historybutton . addEventListener ( 'click' , showHistory ) ;
36
36
37
37
function clearAll ( ) {
38
- dis . value = ''
38
+ dis . value = '' ;
39
39
}
40
40
41
41
function hide ( ) {
Original file line number Diff line number Diff line change 23
23
font-size : 2.5rem ;
24
24
font-weight : 500 ;
25
25
margin-bottom : 0 ;
26
+ padding : 0 5px ;
27
+ display : flex;
28
+ align-items : center;
29
+ justify-content : space-between;
26
30
}
27
31
28
32
input {
@@ -65,6 +69,7 @@ button {
65
69
width : 20vw ;
66
70
height : 10vh ;
67
71
padding : 0.5rem 0 ;
72
+ cursor : pointer;
68
73
margin : 0.25vmax ;
69
74
font-size : 2vmax ;
70
75
border-radius : 1rem ;
@@ -116,8 +121,6 @@ a:hover{
116
121
width : 40px ;
117
122
height : 40px ;
118
123
border-radius : 20px ;
119
- float : right;
120
- margin-right : 15px ;
121
124
cursor : pointer;
122
125
}
123
126
@@ -169,13 +172,25 @@ a:hover{
169
172
}
170
173
}
171
174
175
+ @media (max-width : 700px ) {
176
+ td button {
177
+ font-size : 18px ;
178
+ font-weight : 600 ;
179
+ }
180
+ }
181
+
172
182
.toggle-container {
173
- position : absolute;
174
- top : 4rem ;
175
- left : 3rem ;
183
+ margin : 10px -10px 0 0 ;
176
184
177
185
}
178
186
187
+ .tittle {
188
+ text-decoration : none;
189
+ color : # f1c40f ;
190
+ cursor : pointer;
191
+ margin-left : -20px ;
192
+ }
193
+
179
194
.toggle-switch {
180
195
position : relative;
181
196
display : inline-block;
@@ -278,6 +293,19 @@ input:checked + .toggle-slider:before {
278
293
max-width : 20vw ;
279
294
margin : auto;
280
295
}
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
+ }
281
309
282
310
# answer {
283
311
caret-color : # 0f38f1 ;
You can’t perform that action at this time.
0 commit comments