summaryrefslogtreecommitdiff
path: root/play.html
blob: 2c451cc79286e5865d0469ad778028c283afc1cc (plain)
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
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
<!DOCTYPE html>
<!-- vim:set nowrap: -->
<html>
<head>
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1">
<meta charset="UTF-8">
<title>RED FLAG OVER PARIS</title>
<link rel="icon" href="favicon.svg">
<link rel="stylesheet" href="/fonts/fonts.css">
<link rel="stylesheet" href="/common/play.css">
<script defer src="/common/play.js"></script>
<script defer src="play.js"></script>
<style>

main { background-color: dimgray; }
header { background-color: gainsboro; }

body.Commune header.your_turn { background-color: salmon; }
body.Versailles header.your_turn { background-color: skyblue; }
#role_Commune { background-color: salmon; }
#role_Versailles { background-color: skyblue; }

#log { background-color: ivory; }
#log .h1 { background-color: tan; font-weight: bold; padding-top:2px; padding-bottom:2px; text-align: center; }
#log .h2 { background-color: palegoldenrod; padding-top:2px; padding-bottom:2px; text-align: center; }
#log .h3 { background-color: beige; text-align: center; }
#log .commune { background-color: lightpink }
#log .versailles { background-color: lightblue }
#log > .i { padding-left: 20px; }
#log .tip { font-style: italic }
#log .tip:hover { cursor: pointer; text-decoration: underline; }

.role_extra {
	float: right;
}

.action {
	cursor: pointer;
}

/* PANELS */

.panel_grid {
	display: flex;
	flex-wrap: wrap;
	margin: 20px auto;
	justify-content: center;
	gap: 20px;
}

#hand, #discard, #set_aside, #commune_cards, #versailles_cards {
	min-height: 350px;
}

#hand { min-width: 1060px }
#commune_cards { min-width: 790px }
#versailles_cards { min-width: 790px }
#set_aside { min-width: 790px }
#discard { min-width: 250px }

#commune_cards_header {
	background-color: #633;
}

#versailles_cards_header {
	background-color: #345;
}

#hand, #set_aside {
	flex-grow: 1
}

.panel {
	background-color: #555;
}

.panel_header {
	background-color: #444;
	color: white;
	user-select: none;
	font-weight: bold;
	text-align: center;
	padding: 3px 1em;
}

.panel_body {
	display: flex;
	justify-content: start;
	flex-wrap: wrap;
	padding: 20px;
	gap: 20px;
}

body.Observer #set_aside_panel { display: none }

/* CARDS */

.card {
	background-size: cover;
	background-repeat: no-repeat;
	background-color: #555;
	width: 250px;
	height: 350px;
	border-radius: 16px;
	box-shadow: 1px 1px 5px rgba(0,0,0,0.5);
}

#tooltip {
	position: fixed;
	z-index: 100;
	right: 240px;
	top: 60px;
}

/* MAP */

#mapwrap {
	box-shadow: 0px 0px 15px rgba(0,0,0,0.8);
	width: 1500px;
	height: 1050px;
}

#map {
	display: block;
	width: 1500px;
	height: 1050px;
	background-image: url(map75.jpg);
	background-size: 1500px 1050px;
}

@media (min-resolution: 97dpi) {
	#map {
		background-image: url(map150.jpg);
	}
}

.space {
	position: absolute;
	box-sizing: border-box;
	border: 4px solid transparent;
}

.space.action {
	border: 4px solid white;
	background-color: #fff8;
}

.space.selected {
	border: 4px dashed yellow;
}

.piece {
	pointer-events: none;
	position: absolute;
	background-size: cover;
	background-repeat: no-repeat;
	filter: drop-shadow(0px 2px 3px #0008);
	transition-property: top, left;
	transition-duration: 1s;
	transition-timing-function: ease;
}

.piece.action {
	pointer-events: auto;
	filter:
		drop-shadow(0 -2px 0 white)
		drop-shadow(0 2px 0 white)
		drop-shadow(-2px 0 0 white)
		drop-shadow(2px 0 0 white)
}

.piece.selected {
	filter:
		drop-shadow(0 -2px 0 yellow)
		drop-shadow(0 2px 0 yellow)
		drop-shadow(-2px 0 0 yellow)
		drop-shadow(2px 0 0 yellow)
}

.card.action {
	box-shadow: 0 0 0 3px white;
}

.card.selected {
	box-shadow: 0 0 0 3px yellow;
}

/* original size (72dpi?) */
.piece.cube { width: 28px; height: 30px; }
.piece.disc { width: 40px; height: 32px; }
.piece.cylinder { width: 40px; height: 40px; }
.piece.pawn { width: 28px; height: 48px; }

/* 125% */
.piece.cube { width: 35px; height: 38px; }
.piece.disc { width: 50px; height: 40px; }
.piece.cylinder { width: 50px; height: 50px; }
.piece.pawn { width: 35px; height: 60px; }

.piece.cube.red { background-image:url(pieces/red_cube.svg) }
.piece.cube.blue { background-image:url(pieces/blue_cube.svg) }
.piece.disc.red { background-image:url(pieces/red_disc.svg) }
.piece.disc.blue { background-image:url(pieces/blue_disc.svg) }
.piece.cylinder.red { background-image:url(pieces/red_cylinder.svg) }
.piece.cylinder.blue { background-image:url(pieces/blue_cylinder.svg) }
.piece.cylinder.orange { background-image:url(pieces/orange_cylinder.svg) }
.piece.cylinder.purple { background-image:url(pieces/purple_cylinder.svg) }
.piece.pawn { background-image:url(pieces/pawn.svg) }

#round_marker { top: 965px; }
#round_marker.round1 { left: 623px; }
#round_marker.round2 { left: 709px; }
#round_marker.round3 { left: 805px; }
#round_marker.round4 { left: 897px; }

#blue_momentum { top: 278px; }
#blue_momentum.m0 { top: 300px; left: 712px; }
#blue_momentum.m1 { left: 630px; }
#blue_momentum.m2 { left: 510px; }
#blue_momentum.m3 { left: 360px; }

#red_momentum { top: 278px; }
#red_momentum.m0 { top: 273px; left: 742px; }
#red_momentum.m1 { left: 820px; }
#red_momentum.m2 { left: 950px; }
#red_momentum.m3 { left: 1095px; }

#political_vp { top: 175px; }
#military_vp { top: 225px; }
.vp0 { left: 465px; }
.vp1 { left: 517px; }
.vp2 { left: 570px; }
.vp3 { left: 622px; }
.vp4 { left: 674px; }
.vp5 { left: 726px; }
.vp6 { left: 778px; }
.vp7 { left: 830px; }
.vp8 { left: 882px; }
.vp9 { left: 934px; }
.vp10 { left: 987px; }

/* CARD ACTION POPUP MENU */

#popup {
	position: fixed;
	user-select: none;
	background-color: gainsboro;
	left: 10px;
	top: 100px;
	box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.3);
	z-index: 200;
	min-width: 20ex;
	white-space: nowrap;
	display: none;
}
#popup div { padding: 3pt 8pt; color: gray; display: none; }
#popup div.enabled { color: black; display: block; }
#popup div.enabled:hover { background-color: teal; color: white; }
#popup div.always { display: block; }

/* CARD IMAGES */

.card_strategy_back{background-image:url(cards.1x/card_strategy_back.jpg)}
.card_objective_back{background-image:url(cards.1x/card_objective_back.jpg)}
.card_1{background-image:url(cards.1x/card_1.jpg)}
.card_2{background-image:url(cards.1x/card_2.jpg)}
.card_3{background-image:url(cards.1x/card_3.jpg)}
.card_4{background-image:url(cards.1x/card_4.jpg)}
.card_5{background-image:url(cards.1x/card_5.jpg)}
.card_6{background-image:url(cards.1x/card_6.jpg)}
.card_7{background-image:url(cards.1x/card_7.jpg)}
.card_8{background-image:url(cards.1x/card_8.jpg)}
.card_9{background-image:url(cards.1x/card_9.jpg)}
.card_10{background-image:url(cards.1x/card_10.jpg)}
.card_11{background-image:url(cards.1x/card_11.jpg)}
.card_12{background-image:url(cards.1x/card_12.jpg)}
.card_13{background-image:url(cards.1x/card_13.jpg)}
.card_14{background-image:url(cards.1x/card_14.jpg)}
.card_15{background-image:url(cards.1x/card_15.jpg)}
.card_16{background-image:url(cards.1x/card_16.jpg)}
.card_17{background-image:url(cards.1x/card_17.jpg)}
.card_18{background-image:url(cards.1x/card_18.jpg)}
.card_19{background-image:url(cards.1x/card_19.jpg)}
.card_20{background-image:url(cards.1x/card_20.jpg)}
.card_21{background-image:url(cards.1x/card_21.jpg)}
.card_22{background-image:url(cards.1x/card_22.jpg)}
.card_23{background-image:url(cards.1x/card_23.jpg)}
.card_24{background-image:url(cards.1x/card_24.jpg)}
.card_25{background-image:url(cards.1x/card_25.jpg)}
.card_26{background-image:url(cards.1x/card_26.jpg)}
.card_27{background-image:url(cards.1x/card_27.jpg)}
.card_28{background-image:url(cards.1x/card_28.jpg)}
.card_29{background-image:url(cards.1x/card_29.jpg)}
.card_30{background-image:url(cards.1x/card_30.jpg)}
.card_31{background-image:url(cards.1x/card_31.jpg)}
.card_32{background-image:url(cards.1x/card_32.jpg)}
.card_33{background-image:url(cards.1x/card_33.jpg)}
.card_34{background-image:url(cards.1x/card_34.jpg)}
.card_35{background-image:url(cards.1x/card_35.jpg)}
.card_36{background-image:url(cards.1x/card_36.jpg)}
.card_37{background-image:url(cards.1x/card_37.jpg)}
.card_38{background-image:url(cards.1x/card_38.jpg)}
.card_39{background-image:url(cards.1x/card_39.jpg)}
.card_40{background-image:url(cards.1x/card_40.jpg)}
.card_41{background-image:url(cards.1x/card_41.jpg)}
.card_42{background-image:url(cards.1x/card_42.jpg)}
.card_43{background-image:url(cards.1x/card_43.jpg)}
.card_44{background-image:url(cards.1x/card_44.jpg)}
.card_45{background-image:url(cards.1x/card_45.jpg)}
.card_46{background-image:url(cards.1x/card_46.jpg)}
.card_47{background-image:url(cards.1x/card_47.jpg)}
.card_48{background-image:url(cards.1x/card_48.jpg)}
.card_49{background-image:url(cards.1x/card_49.jpg)}
.card_50{background-image:url(cards.1x/card_50.jpg)}
.card_51{background-image:url(cards.1x/card_51.jpg)}
.card_52{background-image:url(cards.1x/card_52.jpg)}
.card_53{background-image:url(cards.1x/card_53.jpg)}
.card_54{background-image:url(cards.1x/card_54.jpg)}
@media (min-resolution:97dpi) {
.card_strategy_back{background-image:url(cards.2x/card_strategy_back.jpg)}
.card_objective_back{background-image:url(cards.2x/card_objective_back.jpg)}
.card_1{background-image:url(cards.2x/card_1.jpg)}
.card_2{background-image:url(cards.2x/card_2.jpg)}
.card_3{background-image:url(cards.2x/card_3.jpg)}
.card_4{background-image:url(cards.2x/card_4.jpg)}
.card_5{background-image:url(cards.2x/card_5.jpg)}
.card_6{background-image:url(cards.2x/card_6.jpg)}
.card_7{background-image:url(cards.2x/card_7.jpg)}
.card_8{background-image:url(cards.2x/card_8.jpg)}
.card_9{background-image:url(cards.2x/card_9.jpg)}
.card_10{background-image:url(cards.2x/card_10.jpg)}
.card_11{background-image:url(cards.2x/card_11.jpg)}
.card_12{background-image:url(cards.2x/card_12.jpg)}
.card_13{background-image:url(cards.2x/card_13.jpg)}
.card_14{background-image:url(cards.2x/card_14.jpg)}
.card_15{background-image:url(cards.2x/card_15.jpg)}
.card_16{background-image:url(cards.2x/card_16.jpg)}
.card_17{background-image:url(cards.2x/card_17.jpg)}
.card_18{background-image:url(cards.2x/card_18.jpg)}
.card_19{background-image:url(cards.2x/card_19.jpg)}
.card_20{background-image:url(cards.2x/card_20.jpg)}
.card_21{background-image:url(cards.2x/card_21.jpg)}
.card_22{background-image:url(cards.2x/card_22.jpg)}
.card_23{background-image:url(cards.2x/card_23.jpg)}
.card_24{background-image:url(cards.2x/card_24.jpg)}
.card_25{background-image:url(cards.2x/card_25.jpg)}
.card_26{background-image:url(cards.2x/card_26.jpg)}
.card_27{background-image:url(cards.2x/card_27.jpg)}
.card_28{background-image:url(cards.2x/card_28.jpg)}
.card_29{background-image:url(cards.2x/card_29.jpg)}
.card_30{background-image:url(cards.2x/card_30.jpg)}
.card_31{background-image:url(cards.2x/card_31.jpg)}
.card_32{background-image:url(cards.2x/card_32.jpg)}
.card_33{background-image:url(cards.2x/card_33.jpg)}
.card_34{background-image:url(cards.2x/card_34.jpg)}
.card_35{background-image:url(cards.2x/card_35.jpg)}
.card_36{background-image:url(cards.2x/card_36.jpg)}
.card_37{background-image:url(cards.2x/card_37.jpg)}
.card_38{background-image:url(cards.2x/card_38.jpg)}
.card_39{background-image:url(cards.2x/card_39.jpg)}
.card_40{background-image:url(cards.2x/card_40.jpg)}
.card_41{background-image:url(cards.2x/card_41.jpg)}
.card_42{background-image:url(cards.2x/card_42.jpg)}
.card_43{background-image:url(cards.2x/card_43.jpg)}
.card_44{background-image:url(cards.2x/card_44.jpg)}
.card_45{background-image:url(cards.2x/card_45.jpg)}
.card_46{background-image:url(cards.2x/card_46.jpg)}
.card_47{background-image:url(cards.2x/card_47.jpg)}
.card_48{background-image:url(cards.2x/card_48.jpg)}
.card_49{background-image:url(cards.2x/card_49.jpg)}
.card_50{background-image:url(cards.2x/card_50.jpg)}
.card_51{background-image:url(cards.2x/card_51.jpg)}
.card_52{background-image:url(cards.2x/card_52.jpg)}
.card_53{background-image:url(cards.2x/card_53.jpg)}
.card_54{background-image:url(cards.2x/card_54.jpg)}
}

</style>
</head>
<body>

<div id="tooltip" class="card hide"></div>

<div id="popup" onmouseleave="hide_popup_menu()">
<div id="menu_card_event" class="always" onclick="on_card_event()">Play event</div>
<div id="menu_card_ops_political" class="always" onclick="on_card_ops_political()">Political operations</div>
<div id="menu_card_ops_military" class="always" onclick="on_card_ops_military()">Military operations</div>
<div id="menu_card_use_discarded" class="always" onclick="on_card_use_discarded()">Use discarded event</div>
<div id="menu_card_advance_momentum" class="always" onclick="on_card_advance_momentum()">Advance momentum</div>
</div>

<header>
	<div id="toolbar">
	<div class="menu">
		<div class="menu_title"><img src="/images/cog.svg"></div>
		<div class="menu_popup">
			<a class="menu_item" href="info/rules.html" target="_blank">Rules</a>
			<a class="menu_item" href="info/playbook.html" target="_blank">Playbook</a>
			<a class="menu_item" href="info/pac.html" target="_blank">Player Aids</a>
			<a class="menu_item" href="info/cards.html" target="_blank">Cards</a>
			<div class="resign menu_separator"></div>
			<div class="resign menu_item" onclick="confirm_resign()">Resign</div>
			<div class="menu_separator"></div>
			<div class="menu_item" onclick="send_save()">&#x1F41E; Save</div>
			<div class="menu_item" onclick="send_restore()">&#x1F41E; Restore</div>
			<div class="menu_item" onclick="send_restart('Standard')">&#x26a0; Restart</div>
		</div>
	</div>
	<div class="icon_button" onclick="toggle_zoom()"><img src="/images/magnifying-glass.svg"></div>
	<div class="icon_button" onclick="toggle_log()"><img src="/images/scroll-quill.svg"></div>
	</div>
	<div id="prompt"></div>
	<div id="actions"></div>
</header>

<aside>
	<div id="roles">
		<div class="role" id="role_Commune">
			<div class="role_name">
				Commune
				<div class="role_extra" id="commune_info"></div>
				<div class="role_user">-</div>
			</div>
		</div>
		<div class="role" id="role_Versailles">
			<div class="role_name">
				Versailles
				<div class="role_extra" id="versailles_info"></div>
				<div class="role_user">-</div>
			</div>
		</div>
	</div>
	<div id="log"></div>
</aside>

<main>

<div id="mapwrap">
<div id="map">
<div id="spaces"></div>
<div id="pieces">
<div id="round_marker" class="piece pawn round1"></div>
<div id="political_vp" class="piece cylinder orange vp5"></div>
<div id="military_vp" class="piece cylinder purple vp5"></div>
<div id="red_momentum" class="piece cylinder red m0"></div>
<div id="blue_momentum" class="piece cylinder blue m0"></div>
</div>
</div>
</div>

<div class="panel_grid">

<div id="hand_panel" class="panel">
<div id="hand_header" class="panel_header">Hand</div>
<div id="hand" class="panel_body"></div>
</div>

<div id="discard_panel" class="panel">
<div id="discard_header" class="panel_header">Discard</div>
<div id="discard" class="panel_body"></div>
</div>

<div id="versailles_cards_panel" class="panel">
<div id="versailles_cards_header" class="panel_header">Versailles</div>
<div id="versailles_cards" class="panel_body"></div>
</div>

<div id="commune_cards_panel" class="panel">
<div id="commune_cards_header" class="panel_header">Commune</div>
<div id="commune_cards" class="panel_body"></div>
</div>

<div id="set_aside_panel" class="panel">
<div id="set_aside_header" class="panel_header">Set-aside cards</div>
<div id="set_aside" class="panel_body"></div>
</div>

</div>

</main>

<footer id="status"></footer>

</body>