-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyle.css
61 lines (56 loc) · 1.33 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
*,
*::before,
*::after {
box-sizing: border-box;
font-family: Arial, Helvetica, sans-serif;
}
body {
font-size: 7.5vmin;
height: 100vh;
margin: 0;
display: flex;
justify-content: center;
align-items: center;
background-color: #333;
}
#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: 0.5;
transform: scale(0);
}
}