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
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
|
<!DOCTYPE html>
<!-- vim:set nowrap: -->
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, height=device-height, user-scalable=no, interactive-widget=resizes-content, viewport-fit=cover">
<meta name="theme-color" content="#444">
<meta charset="UTF-8">
<title>TABLE BATTLES</title>
<link rel="icon" href="favicon.png">
<link rel="stylesheet" href="/fonts/fonts.css">
<link rel="stylesheet" href="/common/client.css">
<link rel="stylesheet" href="cards.css">
<script defer src="/common/client.js"></script>
<script defer src="data.js"></script>
<script defer src="play.js"></script>
<style>
:root {
--red: hsl(360, 77%, 51%);
--pink: hsl(359, 81%, 78%);
--blue: hsl(211, 78%, 52%);
--dkblue: hsl(240, 69%, 57%);
--hi-red: hsl(360, 77%, 61%);
--hi-pink: hsl(359, 81%, 83%);
--hi-blue: hsl(211, 78%, 62%);
--hi-dkblue: hsl(240, 69%, 67%);
--lo-red: hsl(360, 77%, 41%);
--lo-pink: hsl(359, 81%, 68%);
--lo-blue: hsl(211, 78%, 42%);
--lo-dkblue: hsl(240, 69%, 47%);
--gray: hsl(0, 0%, 90%);
--lo-gray: hsl(0, 0%, 75%);
--hi-gray: hsl(0, 0%, 100%);
}
#replay_panel { background-color: tan; }
#roles { background-color: bisque; }
#log { background-color: floralwhite; }
.role.blue { background-color: #8bf }
.role.red { background-color: #f88 }
/* LOG */
#log .h1 {
text-align: center;
font-weight: bold;
font-variant: small-caps;
background-color: tan;
padding: 2px 8px;
}
#log .h2 {
text-align: center;
font-variant: small-caps;
background-color: wheat;
padding: 2px 8px;
}
#log .p1, #log .p2 {
text-align: right;
background-color: wheat;
margin: 8px 0;
}
#log div { padding-left: 20px; text-indent: -12px; }
#log div.i1 { padding-left: 32px; text-indent: -12px; }
#log div.i2 { padding-left: 44px; text-indent: -12px; }
#log .lore {
font-style: italic;
text-indent: 0;
padding-left: 8px;
}
#log .rule {
text-indent: 0;
padding-left: 8px;
}
#log .n { padding: 0 3px }
#log .blue { background-color: aliceblue; }
#log .dkblue { background-color: skyblue; }
#log .red { background-color: pink; }
#log .pink { background-color: mistyrose; }
.mini {
display: inline-block;
vertical-align: -3px;
width: 12px;
height: 12px;
border-width: 1px;
background-size: 600% 100%;
background-repeat: no-repeat;
background-image: url(images/die_black_pips.svg);
background-color: #ccc;
border: 1px solid black;
}
/* PANELS */
main {
background-color: #666;
background-image: url(images/background.png);
background-attachment: local;
box-shadow: inset 0 0 8px #0008;
}
/* TODO: set min-width per scenario */
.table { min-width: fit-content; }
/* TODO: set this if side ever has any reserves */
.table_reserve.always { min-height: 449px; }
.player_pool {
width: 500px;
background-color: #0003;
padding: 8px;
border-radius: 24px;
margin: 24px auto;
}
.player_name {
color: antiquewhite;
text-shadow: 0 0 3px goldenrod;
font-size: 20px;
text-align: center;
font-style: italic;
font-family: "Source Serif";
padding: 4px;
}
.table_pool {
display: flex;
justify-content: center;
height: 36px;
gap: 12px;
align-items: center;
margin: 8px;
}
.table_reserve, .table_front {
display: flex;
justify-content: center;
gap: 24px;
padding: 0 24px;
}
#player1 .table_reserve, #player1 .table_front { align-items: end; }
#player2 .table_reserve, #player2 .table_front { align-items: start; }
#player1 .table_reserve { padding: 24px 24px 0 24px; }
#player2 .table_reserve { padding: 0 24px 24px 24px; }
#player1 .table_reserve, #player1 .table_front {
flex-direction: row-reverse;
}
.table_front {
min-height: 509px;
}
/* RESERVE OPTIONS */
/*
.table_reserve { background-color: #0001; }
*/
/*
.table_reserve { background-color: #f002; }
.table_front { background-color: #0f02; }
.slot { background-color: #00f2; }
*/
/*
.table_reserve { background-color: #0001; }
.player_pool { background-color: #0001; }
#player1 .player_pool { margin: 0 auto 24px auto; border-radius: 0 0 24px 24px; }
#player2 .player_pool { margin: 24px auto 0 auto; border-radius: 24px 24px 0 0; }
*/
/* CARD SLOTS */
.slot_cubes {
height: 87px;
display: flex;
flex-direction: row;
justify-content: center;
flex-wrap: wrap;
gap: 8px;
margin: 12px;
}
#player1 .slot_cubes { align-items: start; }
#player2 .slot_cubes { align-items: end; }
/* S38 Fleurus - Retreat to Nivelles */
[data-card="237A"] .slot_cubes:empty { display: none }
[data-card="237A"] .slot_cubes:not(:empty) ~ .slot_sticks { display: none }
.slot_sticks {
margin: 12px;
min-height: 87px;
display: flex;
align-items: center;
gap: 1px;
}
#player1 .slot_sticks {
justify-content: start;
flex-direction: column-reverse;
}
#player2 .slot_sticks {
justify-content: end;
flex-direction: column;
}
.slot_shift {
min-height: 11px;
display: flex;
flex-direction: column;
justify-content: end;
align-items: center;
gap: 1px;
margin: 12px;
}
.slot_shift:empty {
display: none;
}
.slot_dice {
display: flex;
height: 36px;
flex-direction: row;
justify-content: center;
flex-wrap: wrap;
gap: 6px;
margin: 12px 0;
}
.table_reserve .slot_dice {
display: none;
}
/* PIECES */
.card, .card * {
pointer-events: none;
}
.card.action, .card *.action {
pointer-events: auto;
}
.card .number { display: none; }
body.shift .card .number { display: block; }
.cube {
width: 24px;
height: 24px;
background-color: #eee;
border-style: solid;
border-width: 2px;
border-color: #fff #ccc #ccc #fff;
box-shadow: 0 0 0 1px #333, 1px 2px 3px 1px #0004;
}
.stick {
width: 90%;
height: 6px;
border: 2px solid black;
box-shadow: 0 0 0 1px #0008, 1px 1px 3px 1px #0004;
}
.red .stick { background-color: var(--red); }
.pink .stick { background-color: var(--pink); }
.blue .stick { background-color: var(--blue); }
.dkblue .stick { background-color: var(--dkblue); }
.red .stick { border-color: var(--hi-red) var(--lo-red) var(--lo-red) var(--hi-red); }
.pink .stick { border-color: var(--hi-pink) var(--lo-pink) var(--lo-pink) var(--hi-pink); }
.blue .stick { border-color: var(--hi-blue) var(--lo-blue) var(--lo-blue) var(--hi-blue); }
.dkblue .stick { border-color: var(--hi-dkblue) var(--lo-dkblue) var(--lo-dkblue) var(--hi-dkblue); }
.hit.stick { background-color: var(--gray); border-color: var(--hi-gray) var(--lo-gray) var(--lo-gray) var(--hi-gray); }
.die {
width: 32px;
height: 32px;
border-width: 2px;
border-style: solid;
background-size: 600% 100%;
background-repeat: no-repeat;
background-image: url(images/die_black_pips.svg);
background-color: #ccc;
border-color: #e5e5e5 #a0a0a0 #a0a0a0 #e5e5e5;
box-shadow: 0 0 0 1px #333, 1px 2px 3px 1px #0004;
}
.d0 { background-position: -100% 0 }
.d1 { background-position: 0% 0; }
.d2 { background-position: 20% 0; }
.d3 { background-position: 40% 0; }
.d4 { background-position: 60% 0; }
.d5 { background-position: 80% 0; }
.d6 { background-position: 100% 0; }
.d0::before {
position: absolute;
content: "?";
width: 32px; height: 32px;
line-height: 32px;
font-family: "Source Sans";
font-size: 24px;
color: #0006;
text-align: center;
}
/* ACTION HIGHLIGHTS */
.die.action { box-shadow: 0 0 0 1px #333, 0 0 0px 3px white; }
.card.action { box-shadow: 0 0 0 3px whitesmoke; }
.card.selected { box-shadow: 0 0 0px 3px gold; }
.card.target { box-shadow: 0 0 0px 3px black; }
.action_type.action {
border-color: white;
box-shadow: 0 0 0 2px white;
}
.action_type.action.null {
border-color: black;
box-shadow: 0 0 0 2px black;
}
.retire.action {
box-shadow: 0 0 0 3px white;
background-color: #fff4;
}
</style>
</head>
<body>
<header>
<div id="toolbar">
<details>
<summary><img src="/images/cog.svg"></summary>
<menu>
<li><a href="info/rules.html" target="_blank">Rules</a>
</menu>
</details>
</div>
</header>
<aside>
<div id="roles">
<div class="role" id="role_First">
<div class="role_name"><span id="role1">First</span></div>
<div class="role_stat" id="stat1"></div>
<div class="role_user"></div>
</div>
<div class="role" id="role_Second">
<div class="role_name"><span id="role2">Second</span></div>
<div class="role_stat" id="stat2"></div>
<div class="role_user"></div>
</div>
</div>
<div id="log"></div>
</aside>
<main data-min-zoom="0.5" data-max-zoom="1.125" data-map-height="500">
<div class="table">
<div class="flip" id="player1">
<div id="reserve1" class="table_reserve"></div>
<div class="player_pool">
<div id="name1" class="player_name"> </div>
<div id="pool1" class="table_pool"></div>
<div id="morale1" class="table_pool"></div>
</div>
<div id="front1" class="table_front"></div>
</div>
<div id="player2">
<div id="front2" class="table_front"></div>
<div class="player_pool">
<div id="morale2" class="table_pool"></div>
<div id="pool2" class="table_pool"></div>
<div id="name2" class="player_name"> </div>
</div>
<div id="reserve2" class="table_reserve"></div>
</div>
<div class="table">
</main>
<footer id="status"></footer>
</body>
|