Repository navigation
Expand file tree
/
Copy pathstyles.css
More file actions
98 lines (84 loc) · 2.4 KB
/
Copy pathstyles.css
File metadata and controls
98 lines (84 loc) · 2.4 KB
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
/* ---------- Reset / page layout ---------- */
body {
background-color: hsl(0, 0%, 95%);
margin: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
/* ---------- Calculator container ---------- */
#calculator {
font-family: 'Arial', sans-serif;
background-color: hsla(0, 0%, 2%, 0.904);
border-radius: 15px;
width: min(420px, 95vw); /* responsive width */
max-width: 500px;
overflow: hidden;
box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}
/* ---------- Display ---------- */
#display {
background-color: hsl(0, 0%, 20%);
color: #fff;
text-align: right;
padding: 10px 14px;
font-size: 2.4rem; /* reasonable default */
border-radius: 5px;
border: none;
width: 100%;
box-sizing: border-box;
min-height: 56px;
}
/* ---------- Keys grid (controls rows/columns) ---------- */
#keys {
display: grid;
grid-template-columns: repeat(4, 1fr); /* 4 equal columns */
grid-auto-rows: minmax(60px, 1fr); /* rows controlled by grid */
gap: 12px;
padding: 18px;
box-sizing: border-box;
}
/* ---------- Buttons (fill their grid cell) ---------- */
button {
width: 100%;
height: 100%;
font-size: 1.6rem;
color: rgb(211, 211, 212);
border-radius: 18px;
background-color: #242424;
border: thick solid #a7a6a6;
cursor: pointer;
/* Make button occupy the full grid cell and center content */
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
padding: 0;
transition: background-color 0.15s, transform 0.06s;
}
button:hover { background-color: rgb(40,40,40); }
button:active { transform: translateY(1px); background-color: rgb(54,53,53); }
/* operator (orange) buttons */
.operator-btn {
background-color: hsla(33, 97%, 49%, 0.9);
color: #fff;
}
/* clear or special button spanning columns (example) */
/* If you want "Clr" to span entire row, use grid-column: 1 / -1; */
.operator-sp {
grid-column: span 2; /* change or remove as needed */
background-color: rgb(248,4,4);
color: #fff;
}
/* ensure borders do not cause overflow */
#calculator, #keys, button { box-sizing: border-box; }
/* ---------- Mobile adjustments ---------- */
@media screen and (max-width: 480px) {
#display {
font-size: 1.6rem;
padding: 8px 10px;
}
#keys { gap: 8px; padding: 12px; grid-auto-rows: minmax(50px, 1fr); }
button { font-size: 1.25rem; border-radius: 14px; border-width: 2px; }
}