summaryrefslogtreecommitdiff
path: root/play.html
blob: 73cbf54f3a2683d595f48a889e66117f31b5b680 (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
<!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>FIELD OF THE CLOTH OF GOLD</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>

@font-face{
	font-family: "Albert Text";
	src: url('fonts/AlbertText-Bold.woff2') format('woff2');
}

main {
	user-select: none;
	background-color: #666;
	background-image: url(background.png);
	box-shadow: inset 0 0 8px #0008;
}

body.Observer #hand {
	display: none;
}

.role_hand_size { float: right }

.court, #hand, #darkness {
	font-family: "Albert Text";
	padding: 6px 10px;
	text-align: right;
	font-size: 20px;
	color: #0004;
}

#darkness {
	position: absolute;
	right: -2px;
	bottom: -2px;
	color: #444;
	text-shadow: 0 0 4px white;
}

#log { background-color: whitesmoke; }
#log .h1 {
	margin: 6px 0;
	padding: 2px 8px;
	border-top: 1px solid black;
	border-bottom: 1px solid black;
	background-color: hsl(0,0%,85%);
}
#log .h1.x { background-color: hsl(0,0%,85%); }
#log .h1.gold { background-color: hsl(50,81%,79%); }
#log .h1.blue { background-color: hsl(201,80%,67%); }
#log .h1.white { background-color: hsl(0,0%,100%); }
#log .h1.red { background-color: hsl(0,90%,69%); }
#log .h1.purple { background-color: hsl(296,29%,65%); }
#log .h1.r{background-image:linear-gradient(90deg,transparent 180px,#000 180px,#000 181px, hsl(359,85%,60%) 181px); }
#log .h1.b{background-image:linear-gradient(90deg,transparent 180px,#000 180px,#000 181px, hsl(220,85%,60%) 181px); }

#role_Red .role_name { background-color: hsl(359,100%,75%); }
#role_Blue .role_name { background-color: hsl(220,100%,80%); }

#mapwrap {
	width: 825px;
	margin: 0px auto;
}

#map {
	width: 825px;
	height: calc(12px + 80px + 12px + 638px + 12px + 80px + 12px + 80px + 12px);
}

#board, #hand, .court {
	box-sizing: border-box;
	position: absolute;
	width: 825px;
	border: 2px solid #0004;
	border-color: #fff3 #0004 #0004 #fff3;
	box-shadow: 0 0 0 1px #222, 1px 1px 8px #0008;
}

#hand, .court {
	height: 80px;
}

#board {
	height: 638px;
	background-size: 825px 638px;
	background-position: center;
	background-image: url(map75.jpg);
	border-color: #fff8 #2228 #2228 #fff8;
}

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

#court1 { top: 12px }
#board { top: calc(12px + 80px + 12px) }
#court2 { top: calc(12px + 80px + 12px + 638px + 12px) }
#hand { top: calc(12px + 80px + 12px + 638px + 12px + 80px + 12px) }
#mapwrap { height: calc(12px + 80px + 12px + 638px + 12px + 80px + 12px + 80px) }

#hand, .court { background-color: hsl(0,0%,55%) }
.red.court { background-color: hsl(359,35%,55%) }
.blue.court { background-color: hsl(220,35%,55%) }

#map div {
	position: absolute;
	transition-property: top, left;
	transition-duration: 500ms;
	transition-timing-function: ease;
}

.action {
	cursor: pointer;
}

.token {
	width: 41px;
	height: 44px;
	background-size: 41px 44px;
	filter: drop-shadow(0px 2px 4px #0008);
}

.token.action {
	filter:
		drop-shadow(0px 2px 0px white)
		drop-shadow(2px 0px 0px white)
		drop-shadow(-2px 0px 0px white)
		drop-shadow(0px -2px 0px white)
}

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

.tile {
	box-sizing: border-box;
	width: 56px;
	height: 56px;
	background-repeat: no-repeat;
	background-size: 38px 38px;
	background-position: center;
	border-width: 2px;
	border-style: solid;
	box-shadow: 0 0 0 1px #222, 1px 2px 4px #0008;
}

.tile.action {
	box-shadow: 0 0 0 1px #222, 0 0 0 4px white;
}

.tile.selected {
	box-shadow: 0 0 0 1px #222, 0 0 0 4px yellow;
}

.space {
	box-sizing: border-box;
	border: 3px solid transparent;
}

.space.oval {
	border-radius: 50%;
}

.space.action {
	border: 3px solid white;
	box-shadow: 0 0 4px white;
}

.token.white { background-image: url(images/token_white.svg) }
.token.red { background-image: url(images/token_red.svg) }
.token.blue { background-image: url(images/token_blue.svg) }

.tile.gold { background-image: url(images/gold.png); background-color: hsl(50,81%,59%); }
.tile.blue { background-image: url(images/blue.png); background-color: hsl(201,80%,47%); }
.tile.white { background-image: url(images/white.png); background-color: hsl(0,0%,94%); }
.tile.red { background-image: url(images/red.png); background-color: hsl(0,90%,49%); }
.tile.green { background-image: url(images/green.png); background-color: hsl(125,21%,33%); }

.tile { border-color: #fff5 #0003 #0003 #fff5; }
.tile.gold { border-color: #fff6 #0003 #0003 #fff6 }
.tile.white { border-color: #ddd #bbb #bbb #ddd }
.tile.green { border-color: #fff3 #0003 #0003 #fff3 }

</style>
</head>
<body>

<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>
			<div class="resign menu_separator"></div>
			<div class="resign menu_item" onclick="confirm_resign()">Resign</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_Red">
			<div class="role_name">
				Red
				<div class="role_hand_size" id="red_hand_size"></div>
				<div class="role_user"></div>
			</div>
		</div>
		<div class="role" id="role_Blue">
			<div class="role_name">
				Blue
				<div class="role_hand_size" id="blue_hand_size"></div>
				<div class="role_user"></div>
			</div>
		</div>
	</div>
	<div id="log"></div>
</aside>

<main>

<div id="mapwrap" class="fit">
<div id="map">
<div id="court1" class="court">Rival Court</div>
<div id="board"><div id="darkness"></div></div>
<div id="court2" class="court">Court</div>
<div id="hand">Hand</div>
</div>
</div>

</main>

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

</body>