-
Notifications
You must be signed in to change notification settings - Fork 0
/
grid-hanafuda.html
268 lines (241 loc) · 9.12 KB
/
grid-hanafuda.html
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Koi Koi</title>
<script src="pages.js"></script>
<script src="navigation.js"></script>
<style>
:root {
--vert-grid-height: calc(100vh - 65px); /* accounts for heading and margins */
--vert-grid-width: calc(var(--vert-grid-height) * .58);
--vert-card-width: calc(var(--vert-grid-height) / 8 * .58 - 10px);
--vert-card-height: calc(100vh / 8 - 50px);
--horiz-card-width: calc(100vw / 16 - 15px);
--horiz-card-height: calc(var(--horiz-card-width) * 1.7);
}
html,
body {
margin: 0;
padding: 0;
background-color: #565675;
}
header {
color: white;
width: var(--vert-grid-width);
margin: 0 auto;
}
h1 {
margin: 5px 0;
}
main {
display: grid;
height: var(--vert-grid-height);
width: var(--vert-grid-width);
grid-template-columns: repeat(8, var(--vert-card-width));
grid-template-rows: repeat(3, var(--vert-card-height)) 1fr repeat(2, var(--vert-card-height)) 1fr repeat(3, var(--vert-card-height));
grid-template-areas:
"p2h8 p2h7 p2h6 p2h5 p2h4 p2h3 p2h2 p2h1"
"p2trash p2trash p2trash p2trash p2ribbon p2ribbon p2ribbon p2ribbon"
"p2animal p2animal p2animal p2animal p2bright p2bright p2bright p2bright"
". . . . . . . ."
"stock stock table1 table2 table3 table4 table5 table6"
"stock stock table7 table8 table9 table10 table11 table12"
". . . . . . . ."
"p1bright p1bright p1bright p1bright p1animal p1animal p1animal p1animal"
"p1ribbon p1ribbon p1ribbon p1ribbon p1trash p1trash p1trash p1trash"
"p1h1 p1h2 p1h3 p1h4 p1h5 p1h6 p1h7 p1h8";
grid-gap: 10px;
margin: 10px auto;
justify-items: center;
}
.card {
display: inline-block;
border: 5px solid rgb(56, 42, 20);
height: var(--vert-card-height);
overflow: hidden;
box-sizing: border-box;
}
.card>img {
height: 100%;
}
.card-back {
background-color: rgb(56, 42, 20);
width: calc(var(--vert-card-width) - 10px);
height: var(--vert-card-height);
box-sizing: border-box;
}
.stock {
grid-area: stock;
}
.area {
max-width: 100%;
min-width: 0;
}
.area-wrapper {
display: flex;
}
.area-wrapper>div {
flex: 0 1 auto;
overflow: hidden;
}
.area-wrapper>div:hover {
overflow: visible;
}
.area-wrapper .card {
border-right: none;
}
.area-wrapper .card:last-child {
border-right: 5px solid rgb(56, 42, 20);
}
.stock {
width: calc(100vh * .55 / 4);
position: relative;
}
.stock-card {
height: var(--vert-card-height);
width: calc(var(--vert-card-height) * .53);
transform: translate(-50%, -50%);
background-color: rgb(56, 42, 20);
position: absolute;
top: 50%;
left: 50%;
}
.stock-card .number {
color: #fff;
font-size: 28pt;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
@media (orientation: landscape) {
header {
width: 100vw;
}
main {
margin: 5px 0;
width: 100vw;
grid-template-columns: repeat(16, var(--horiz-card-width));
grid-template-rows: repeat(2, var(--horiz-card-height)) 1fr var(--horiz-card-height) 1fr repeat(2, var(--horiz-card-height));
grid-template-areas:
". . . . p2h8 p2h7 p2h6 p2h5 p2h4 p2h3 p2h2 p2h1 . . . ."
"p2trash p2trash p2trash p2trash p2animal p2animal p2animal p2animal p2ribbon p2ribbon p2ribbon p2ribbon p2bright p2bright p2bright p2bright"
". . . . . . . . . . . . . . . ."
". stock stock table1 table2 table3 table4 table5 table6 table7 table8 table9 table10 table11 table12 ."
". . . . . . . . . . . . . . . ."
"p1bright p1bright p1bright p1bright p1ribbon p1ribbon p1ribbon p1ribbon p1animal p1animal p1animal p1animal p1trash p1trash p1trash p1trash"
". . . . p1h1 p1h2 p1h3 p1h4 p1h5 p1h6 p1h7 p1h8 . . . .";
}
.card {
height: var(--horiz-card-height);
width: var(--horiz-card-width);
}
.card-back,
.stock-card {
height: var(--horiz-card-height);
width: var(--horiz-card-width);
}
}
</style>
</head>
<body>
<header>
<h1>Koi-Koi</h1>
</header>
<main>
<div class="card-back" style="grid-area: p2h8"></div>
<div class="card-back" style="grid-area: p2h7"></div>
<div class="card-back" style="grid-area: p2h6"></div>
<div class="card-back" style="grid-area: p2h5"></div>
<div class="card-back" style="grid-area: p2h4"></div>
<div class="card-back" style="grid-area: p2h3"></div>
<div class="card-back" style="grid-area: p2h2"></div>
<div class="area trash" style="grid-area: p2trash;"></div>
<div class="area ribbon" style="grid-area: p2ribbon;">
<div class="card">
<img src="images/cards/10.png" />
</div>
<div class="card">
<img src="images/cards/43.png" />
</div>
<div class="card">
<img src="images/cards/22.png" />
</div>
</div>
<div class="area animal" style="grid-area: p2animal;">
<div class="card">
<img src="images/cards/05.png" alt="" />
</div>
</div>
<div class="area bright" style="grid-area: p2bright;">
<div class="card">
<img src="images/cards/01.png" alt="" />
</div>
<div class="card">
<img src="images/cards/09.png" alt="" />
</div>
</div>
<div class="stock">
<div class="stock-card">
<div class="number">
16
</div>
</div>
</div>
<div class="card" style="grid-area: table1">
<img src="images/cards/34.png" />
</div>
<div class="card" style="grid-area: table2">
<img src="images/cards/36.png" />
</div>
<div class="card" style="grid-area: table3">
<img src="images/cards/02.png" />
</div>
<div class="card" style="grid-area: table4">
<img src="images/cards/21.png" />
</div>
<div class="card" style="grid-area: table5">
<img src="images/cards/17.png" />
</div>
<div class="card" style="grid-area: table6">
<img src="images/cards/40.png" />
</div>
<div class="area bright" style="grid-area: p1bright;">
<div class="card">
<img src="images/cards/29.png" />
</div>
</div>
<div class="area animal" style="grid-area: p1animal;"></div>
<div class="area ribbon" style="grid-area: p1ribbon;"></div>
<div class="area trash" style="grid-area: p1trash;">
<div class="area-wrapper">
<div class="card">
<img src="images/cards/32.png" />
</div>
<div class="card">
<img src="images/cards/03.png" />
</div>
<div class="card">
<img src="images/cards/23.png" />
</div>
<div class="card">
<img src="images/cards/11.png" />
</div>
<div class="card">
<img src="images/cards/12.png" />
</div>
<div class="card">
<img src="images/cards/07.png" />
</div>
</div>
</div>
<div class="card-back" style="grid-area: p1h1"></div>
<div class="card-back" style="grid-area: p1h2"></div>
<div class="card-back" style="grid-area: p1h3"></div>
<div class="card-back" style="grid-area: p1h4"></div>
<div class="card-back" style="grid-area: p1h5"></div>
<div class="card-back" style="grid-area: p1h6"></div>
</main>
</body>
</html>