-
Notifications
You must be signed in to change notification settings - Fork 0
/
styles.css
55 lines (50 loc) · 1.3 KB
/
styles.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
*, *::before, *::after {
box-sizing: border-box;
font-family: Arial;
}
body {
background-color: #333;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
font-size: 7.5vmin;
}
#game-board {
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;
gap: var(--cell-gap);
border-radius: 1vmin;
padding: var(--cell-gap);
position: relative;
}
.cell {
background-color: #AAA;
border-radius: 1vmin;
}
.tile {
position: absolute;
display: flex;
justify-content: center;
align-items: center;
width: var(--cell-size);
height: var(--cell-size);
background-color: red;
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));
animation: show 200ms ease-in-out;
transition: 100ms ease-in-out;
}
@keyframes show {
0% {
opacity: .5;
transform: scale(0);
}
}