-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.css
137 lines (120 loc) · 2.27 KB
/
App.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
128
129
130
131
132
133
134
135
136
137
:root {
--square-size-units: 3.5;
--square-size: calc(var(--square-size-units) * 1vh);
--board-size: 8;
}
.app {
height: 100vh;
width: 100vw;
overflow: hidden;
}
.app-wrapper {
height: 100vh;
width: 100vw;
max-width: 600px;
margin: auto;
display: grid;
grid-template-rows: auto 1fr;
gap: 16px 0;
justify-items: center;
}
.undo {
grid-column-start: 1;
grid-column-end: 3;
}
.header {
text-align: center;
margin: 0;
}
.options {
display: grid;
place-items: center;
grid-template-columns: 1fr 1fr;
grid-template-rows: 1fr 1fr;
gap: 8px;
}
.game {
width: 100%;
display: grid;
grid-template-rows: 1fr 1fr;
touch-action: none;
place-items: center;
align-items: stretch;
gap: 2vh 0;
}
.board-wrapper {
display: grid;
place-items: center;
width: 100%;
}
.board {
aspect-ratio: 1;
height: 100%;
width: auto;
height: calc(8 * var(--square-size));
display: grid;
grid-template-columns: repeat(8, 1fr);
grid-template-rows: repeat(8, 1fr);
outline: 2px grey solid;
touch-action: none;
}
@keyframes blink {
0% {
opacity: 1;
}
50% {
opacity: 0.25;
}
100% {
opacity: 1;
}
}
.board .square {
outline: 1px grey solid;
}
.square.transition {
transition: all 200ms;
}
.square {
--color: hsla(var(--hue, 0) var(--sat, 100%) var(--lig, 40%) / var(--opa, 1));
color: var(--color);
background-color: var(--color);
border: 0.8vh var(--color) solid;
border-color:
hsla(var(--hue) 100% var(--lig, 65%) / var(--opa, 1))
hsla(var(--hue) 100% var(--lig, 25%) / var(--opa, 1))
hsla(var(--hue) 100% var(--lig, 25%) / var(--opa, 1))
hsla(var(--hue) 100% var(--lig, 65%) / var(--opa, 1));
}
.user-pieces {
width: 100%;
display: grid;
grid-template-columns: repeat(3, auto);
gap: 2vh 1vh;
flex-direction: row;
place-items: center;
}
.piece {
height: 100%;
width: 100%;
}
.piece-grid {
width: min-content;
margin: auto;
display: grid;
place-items: center;
place-content: center;
}
.piece-grid.selected {
position: absolute;
top: 0;
left: 0;
transform: translate(var(--xt), var(--yt)) scale(1);
pointer-events: none;
touch-action: none;
}
.piece-grid .square {
height: var(--square-size);
width: var(--square-size);
border-width: calc(var(--square-size) / 5)
}