aboutsummaryrefslogtreecommitdiffstats
path: root/public/projects/js-small-apps/calculator/style.css
blob: 89b5b31418724f613451424908d866b34dc110a7 (plain)
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
*,
*::after,
*::before {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.618;
  display: flex;
  flex-flow: column nowrap;
  min-height: 100vh;
}

.header,
.main,
.footer {
  width: min(calc(100vw - 2rem), 350px);
  margin-left: auto;
  margin-right: auto;
}

.header,
.main {
  border: 3px solid hsl(219, 64%, 35%);
  border-radius: 5px;
  box-shadow: 2px 2px 0 0 hsl(219, 64%, 35%), 2px 2px 2px 0 hsl(219, 64%, 30%),
    3px 3px 3px 0 hsla(219, 64%, 25%, 0.65);
}

.header {
  background: hsl(219, 64%, 35%);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  color: hsl(0, 0%, 100%);
  margin-top: 2rem;
  padding: 0.5rem 1rem;
}

.branding {
  font-size: 1.5rem;
  font-variant: small-caps;
  letter-spacing: 1px;
  text-align: center;
  text-shadow: 1px 1px 0 hsl(0, 0%, 65%), 2px 2px 2px hsl(0, 0%, 0%);
}

.main {
  background: hsl(0, 0%, 97%);
  border-top-left-radius: 0;
  border-top-right-radius: 0;

  margin-bottom: 1rem;
}

.footer {
  font-size: 0.9rem;
  text-align: center;
  margin-top: auto;
  padding: 1rem 0;
}

.calculator {
  padding: 1rem;
}

.calculator__display {
  background: hsl(0, 0%, 100%);
  border: 1px solid hsl(0, 0%, 60%);
  border-radius: 2px;
  box-shadow: inset 0 0 2px 0 hsl(0, 0%, 70%), 0 0 0 1px hsl(0, 0%, 75%);
  font-size: clamp(2rem, 3vw, 2.5rem);
  font-weight: 600;
  text-align: right;
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.2rem 1rem;
}

.calculator__entry-pad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 1fr 6fr;
  gap: 1rem;
  justify-items: end;
}

.calculator__clear {
  grid-column: 3 / 5;
  grid-row: 1;
  display: flex;
  flex-flow: row nowrap;
  justify-content: flex-end;
  gap: 1rem;
}

.calculator__digits {
  grid-column: 1 / 4;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.calculator__operations {
  grid-column: 4;
  grid-row: 2;
  display: flex;
  flex-flow: column nowrap;
  gap: 1rem;
}

.btn {
  display: block;
  padding: clamp(0.1rem, 5vw, 0.3rem) clamp(1rem, 6vw, 1.5rem);
  background: hsl(0, 0%, 95%);
  border: 1px solid hsl(0, 0%, 85%);
  border-radius: 3px;
  box-shadow: 0 0 2px hsl(0, 0%, 80%), 0 0 0 2px hsl(0, 0%, 60%),
    1px 1px 0 3px hsl(0, 0%, 50%);
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  cursor: pointer;
  transition: all 0.15s ease-in-out 0s;
}

.btn:hover,
.btn:focus {
  background: hsl(0, 0%, 100%);
}

.btn:focus {
  outline: 3px solid hsl(219, 64%, 35%);
}

.btn:active {
  background: hsl(0, 0%, 90%);
  box-shadow: 0 0 0 hsl(0, 0%, 80%), 0 0 0 2px hsl(0, 0%, 80%),
    0 0 0 3px hsl(0, 0%, 50%);
  outline: none;
  transform: translateX(2px) translateY(2px) scale(0.96);
}