-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.css
85 lines (85 loc) · 1.57 KB
/
index.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
:root {
--dark-tile-clr: hsl(28, 37%, 55%);
--light-tile-clr: hsl(38, 69%, 82%);
--last-move-clr: hsla(90, 100%, 60%, 0.6);
--legal-move-clr: hsla(90, 55%, 52%, 0.756);
--tile-size: 4.5rem;
}
*,
*::before,
*::after {
box-sizing: border-box;
}
body {
margin: 0;
}
.board {
display: grid;
width: fit-content;
grid-template-columns: repeat(8, var(--tile-size));
grid-template-rows: repeat(8, var(--tile-size));
user-select: none;
}
.tile {
position: relative;
}
.tile.light {
background-color: var(--light-tile-clr);
}
.tile.dark {
background-color: var(--dark-tile-clr);
}
.tile.last-move::after {
content: '';
position: absolute;
width: 100%;
height: 100%;
background-color: var(--last-move-clr);
}
.tile.legal-move::after {
content: '';
position: absolute;
width: 30%;
height: 30%;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
border-radius: 50%;
background-color: var(--legal-move-clr);
}
.tile.legal-capture::after {
content: '';
position: absolute;
width: 100%;
height: 100%;
border: 5px solid var(--legal-move-clr);
}
.tile.legal-move.hovered::after,
.tile.legal-capture.hovered::after {
background-color: var(--legal-move-clr);
width: 100%;
height: 100%;
border-radius: 0;
border: none;
}
.piece {
z-index: 1;
aspect-ratio: 1;
width: var(--tile-size);
position: absolute;
pointer-events: none;
user-select: none;
left: var(--x, 0);
top: var(--y, 0);
}
.piece.ghost {
opacity: 0.6;
}
.dragging {
left: calc(var(--x, 0) - (var(--tile-size) / 2));
top: calc(var(--y, 0) - (var(--tile-size) / 2));
}
.hidden,
.imagePreloading {
display: none;
}