-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyle.css
127 lines (113 loc) · 2.42 KB
/
style.css
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
:root {
--background-color: #333;
--text-color: #ccc;
--text-color-light: #fff;
--text-color-dark: #aaa;
}
*,
*::before,
*::after {
box-sizing: border-box;
font-family: Arial;
}
body {
background-color: var(--background-color);
display: flex;
flex-direction: column;
width: min-content;
height: 100vh;
margin: 0 auto;
font-size: 7.5vmin;
}
.header {
display: flex;
padding-bottom: 1vmin;
margin-top: 2.5vmin;
border-bottom: 1px solid var(--text-color);
align-items: center;
gap: 1vmin;
color: var(--text-color);
}
.restart {
all: unset;
border-radius: 3px;
padding: 8px;
background-color: var(--text-color-dark);
font-size: max(1vmin, 20px);
color: white;
cursor: pointer;
}
.title {
text-align: center;
margin: 0;
font-size: max(5vmin, 20px);
flex-grow: 1;
}
.stat-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-end;
}
.stat-label {
position: relative;
font-size: max(2vmin, 10px);
color: var(--text-color-dark);
text-align: center;
line-height: 1.2;
}
.score-container {
flex-basis: calc(max(10vmin, 70px) + 1vmin);
flex-shrink: 0;
}
.score-amount {
animation: show 100ms ease-in-out;
}
.stat-amount {
font-size: max(3vmin, 15px);
font-weight: bold;
text-align: center;
}
.game-board {
margin: auto 0;
display: grid;
grid-template-columns: repeat(var(--grid-size), var(--cell-size));
grid-template-rows: repeat(var(--grid-size), var(--cell-size));
background-color: #ccc;
border-radius: 1vmin;
gap: var(--cell-gap);
padding: var(--cell-gap);
position: relative;
}
.cell {
background-color: var(--text-color-dark);
border-radius: 1vmin;
}
.tile {
/* --x: 2;
--y: 3;
--background-lightness: 80%;
--text-lightness: 20%; */
position: absolute;
display: flex;
justify-content: center;
align-items: center;
width: var(--cell-size);
height: var(--cell-size);
border-radius: 1vmin;
top: calc(var(--y) * (var(--cell-size) + var(--cell-gap)) + var(--cell-gap));
left: calc(var(--x) * (var(--cell-size) + var(--cell-gap)) + var(--cell-gap));
font-weight: bold;
background-color: hsl(200, 50%, var(--background-lightness));
color: hsl(200, 25%, var(--text-lightness));
/* Use when the tile appears */
animation: show 200ms ease-in-out;
/* Use when the tile moves */
transition: 100ms ease-in-out;
}
@keyframes show {
0% {
opacity: 0.5;
transform: scale(0);
}
}