-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaps.html
450 lines (445 loc) · 23.1 KB
/
maps.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
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
---
title: Community Maps
layout: default
permalink: /maps
---
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
<script>
var currentMap = new URLSearchParams(window.location.search).get('view');
currentMap = currentMap ? currentMap : '';
if (history.scrollRestoration) {
history.scrollRestoration = 'manual';
}
function showMap(map) {
if(currentMap != map) {
const url = new URL(window.location);
if(map)
url.searchParams.set('view', map);
else
url.searchParams.remove('view');
window.history.replaceState({"map": currentMap}, '', window.location);
window.history.pushState({"map": map}, '', url);
if(currentMap) {
document.getElementById("map-"+currentMap).classList.remove("target");
}
if(map) {
document.getElementById("map-"+map).classList.add("target");
}
currentMap = map;
}
}
window.onpopstate = function(event) {
if(event.state) {
map = event.state.map;
} else {
currentMap = '';
}
if(currentMap) {
document.getElementById("map-"+currentMap).classList.remove("target");
}
if(map) {
document.getElementById("map-"+map).classList.add("target");
}
currentMap = map
}
</script>
<style>
.target ~.mapCard {
display:none;
}
{% for map in site.maps -%}
a#{% include renderMapSlugClass.liquid map=map %}.target ~.{% include renderMapSlugClass.liquid map=map %},a#{% include renderMapSlugClass.liquid map=map %}.target ~.{% include renderMapSlugClass.liquid map=map %} .mapInfo {%- if forloop.last == false %},{%- endif %}
{% endfor -%}
{
display:block;
}
.mapInfo {
display:none;
}
</style>
<main role="main">
<!--- Main -->
<section class="jumbotron text-center">
<div class="container">
<nav class="navbar navbar-expand-lg navbar-light">
<div class="container-fluid">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link" aria-current="page" href="/">Home</a>
</li>
</ul></div>
</div>
</nav>
</div>
</section>
<section class="jumbotron text-center">
<div class="container">
<h1 class="jumbotron-heading">Community Maps</h1>
<p class="lead text-muted">{{ site.maps | size }} user submitted maps available for download.</p>
<p>
<a href="/maps" onclick="showMap('');return false;" class="btn btn-primary my-2">Cards</a>
<a href="/mapsTable" class="btn btn-secondary my-2">Table</a>
<a href="{% link mapHelp.md %}" class="btn btn-secondary my-2">How to upload a Map</a>
</p>
</div>
</section>
<!--- Maps -->
<div class="album">
<div class="container">
<div class="row">
{%- assign sorted_maps = site.maps | sort_natural: "name" -%}
{%- for map in site.maps -%}
<a id="{% include renderMapSlugClass.liquid map=map %}" style="display: none"></a>
{%- endfor -%}
<script>
if(currentMap) {
document.getElementById("map-"+currentMap).classList.add("target");
}
</script>
{%- for map in sorted_maps -%}
{%- assign mapUrl1 = nil %}
{%- assign mapUrl2 = nil %}
{%- assign mapUrl3 = nil %}
{%- include getMapImage.liquid map=map number=0 %}
{%- assign mapUrl0 = gp_mapUrl %}
{%- include getMapImage.liquid map=map number=1 %}
{%- if gp_mapUrl %}
{%- assign mapUrl1 = gp_mapUrl %}
{%- include getMapImage.liquid map=map number=2 %}
{%- if gp_mapUrl %}
{%- assign mapUrl2 = gp_mapUrl %}
{%- include getMapImage.liquid map=map number=3 %}
{%- if gp_mapUrl %}
{%- assign mapUrl3 = gp_mapUrl %}
{%- endif %}
{%- endif %}
{%- endif %}
{%- assign background = site.data.backgrounds | where: "background", map.background | first %}
<div class="col mb-4 mapCard {% include renderMapSlugClass.liquid map=map -%}">
<div class="card h-100">
<div class="relative-container">
{%- if mapUrl1 %}
<input class="btn-check state-0" type="radio" name="state-{%- include renderMapSlugClass.liquid map=map -%}" id="state-0-{%- include renderMapSlugClass.liquid map=map -%}" autocomplete="off" checked>
<label class="btn btn-primary btn-state-tiny state-0" for="state-0-{%- include renderMapSlugClass.liquid map=map -%}">1</label>
<input class="btn-check state-1" type="radio" name="state-{%- include renderMapSlugClass.liquid map=map -%}" id="state-1-{%- include renderMapSlugClass.liquid map=map -%}" autocomplete="off">
<label class="btn btn-primary btn-state-tiny state-1" for="state-1-{%- include renderMapSlugClass.liquid map=map -%}">2</label>
{%- if mapUrl2 %}
<input class="btn-check state-2" type="radio" name="state-{%- include renderMapSlugClass.liquid map=map -%}" id="state-2-{%- include renderMapSlugClass.liquid map=map -%}" autocomplete="off">
<label class="btn btn-primary btn-state-tiny state-2" for="state-2-{%- include renderMapSlugClass.liquid map=map -%}">3</label>
{%- endif %}
{%- if mapUrl3 %}
<input class="btn-check state-3" type="radio" name="state-{%- include renderMapSlugClass.liquid map=map -%}" id="state-3-{%- include renderMapSlugClass.liquid map=map -%}" autocomplete="off">
<label class="btn btn-primary btn-state-tiny state-3" for="state-3-{%- include renderMapSlugClass.liquid map=map -%}">4</label>
{%- endif %}
{%- endif %}
<a class="map-state" href="?view={%- include renderMapSlug.liquid map=map -%}" onclick="showMap('{%- include renderMapSlug.liquid map=map -%}');return false;">
<img class="card-img-top mapCard-image-board state-0" src="{{ mapUrl0 }}" loading="lazy">
{%- if mapUrl1 %}
<img class="card-img-top mapCard-image-board state-1" src="{{ mapUrl1 }}" loading="lazy">
{%- endif %}
{%- if mapUrl2 %}
<img class="card-img-top mapCard-image-board state-2" src="{{ mapUrl2 }}" loading="lazy">
{%- endif %}
{%- if mapUrl3 %}
<img class="card-img-top mapCard-image-board state-3" src="{{ mapUrl3 }}" loading="lazy">
{%- endif %}
</a>
<img class="card-img-top mapCard-image-background" src="{%- include renderMapBackground.liquid map=map -%}" loading="lazy">
<div class="bottom-right-absolute">
{%- for author in map.authors %}
<div class="badge bg-primary">{%- if author.url -%}<a class="text-reset" href="{{ author.url }}">{{ author.name }}</a>{%- else -%}{{ author.name }}{%- endif -%}</div>
{%- endfor %}
</div>
</div>
<div class="card-body">
{% if map.name > 1 or map.desc.size > 1 %}
<input class="btn-check en" type="radio" name="lang-{%- include renderMapSlugClass.liquid map=map -%}" id="lang-en-{%- include renderMapSlugClass.liquid map=map -%}" autocomplete="off" checked>
<label class="btn btn-outline-primary btn-lang-tiny" for="lang-en-{%- include renderMapSlugClass.liquid map=map -%}">🇬🇧</label>
{% if map.name.de or map.desc.de %}
<input class="btn-check de" type="radio" name="lang-{%- include renderMapSlugClass.liquid map=map -%}" id="lang-de-{%- include renderMapSlugClass.liquid map=map -%}" autocomplete="off">
<label class="btn btn-outline-primary btn-lang-tiny" for="lang-de-{%- include renderMapSlugClass.liquid map=map -%}">🇩🇪</label>
{%- endif %}
{% if map.name.fr or map.desc.fr %}
<input class="btn-check fr" type="radio" name="lang-{%- include renderMapSlugClass.liquid map=map -%}" id="lang-fr-{%- include renderMapSlugClass.liquid map=map -%}" autocomplete="off">
<label class="btn btn-outline-primary btn-lang-tiny" for="lang-fr-{%- include renderMapSlugClass.liquid map=map -%}">🇫🇷</label>
{%- endif %}
{% if map.name.it or map.desc.it %}
<input class="btn-check it" type="radio" name="lang-{%- include renderMapSlugClass.liquid map=map -%}" id="lang-it-{%- include renderMapSlugClass.liquid map=map -%}" autocomplete="off">
<label class="btn btn-outline-primary btn-lang-tiny" for="lang-it-{%- include renderMapSlugClass.liquid map=map -%}">🇮🇹</label>
{%- endif %}
{% if map.name.es or map.desc.es %}
<input class="btn-check es" type="radio" name="lang-{%- include renderMapSlugClass.liquid map=map -%}" id="lang-es-{%- include renderMapSlugClass.liquid map=map -%}" autocomplete="off">
<label class="btn btn-outline-primary btn-lang-tiny" for="lang-es-{%- include renderMapSlugClass.liquid map=map -%}">🇪🇸</label>
{%- endif %}
{% if map.name.jp or map.desc.jp %}
<input class="btn-check jp" type="radio" name="lang-{%- include renderMapSlugClass.liquid map=map -%}" id="lang-jp-{%- include renderMapSlugClass.liquid map=map -%}" autocomplete="off">
<label class="btn btn-outline-primary btn-lang-tiny" for="lang-jp-{%- include renderMapSlugClass.liquid map=map -%}">🇯🇵</label>
{%- endif %}
{%- endif %}
<div class="row lang">
<h4 class="card-title en
{%- if map.name.de == Nil %} de{% endif -%}
{%- if map.name.fr == Nil %} fr{% endif -%}
{%- if map.name.it == Nil %} it{% endif -%}
{%- if map.name.es == Nil %} es{% endif -%}
{%- if map.name.jp == Nil %} jp{% endif -%}">{{ map.name.en }}</h4>
{% if map.name.de -%}
<h4 class="card-title de">{{ map.name.de }}</h4>
{%- endif %}
{% if map.name.fr -%}
<h4 class="card-title fr">{{ map.name.fr }}</h4>
{%- endif %}
{% if map.name.it -%}
<h4 class="card-title it">{{ map.name.it }}</h4>
{%- endif %}
{% if map.name.es -%}
<h4 class="card-title es">{{ map.name.es }}</h4>
{%- endif %}
{% if map.name.jp -%}
<h4 class="card-title jp">{{ map.name.jp }}</h4>
{%- endif %}
</div>
<div class="row lang" style="width: 100%">
<p class="card-text en
{%- if map.desc.de == Nil %} de{% endif -%}
{%- if map.desc.fr == Nil %} fr{% endif -%}
{%- if map.desc.it == Nil %} it{% endif -%}
{%- if map.desc.es == Nil %} es{% endif -%}
{%- if map.desc.jp == Nil %} jp{% endif -%}">{{ map.desc.en }}</p>
{% if map.desc.de -%}
<p class="card-text de">{{ map.desc.de }}</p>
{%- endif %}
{% if map.desc.fr -%}
<p class="card-text fr">{{ map.desc.fr }}</p>
{%- endif %}
{% if map.desc.it -%}
<p class="card-text it">{{ map.desc.it }}</p>
{%- endif %}
{% if map.desc.es -%}
<p class="card-text es">{{ map.desc.es }}</p>
{%- endif %}
{% if map.desc.jp -%}
<p class="card-text jp">{{ map.desc.jp }}</p>
{%- endif %}
</div>
</div>
{% if map.notes -%}
<div class="card-body mapInfo {% include renderMapSlugClass.liquid map=map -%}">
{{ map.notes | markdownify }}
</div>
{%- endif %}
<div class="card-body mapInfo {% include renderMapSlugClass.liquid map=map -%}">
<div class="row mb-4">
<div class="col">
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-start">
<div class="ms-2 me-auto">
<div class="fw-bold">Rules</div>
{{- map.ruleSet -}}
</div>
</li>
<li class="list-group-item d-flex justify-content-between align-items-start">
<div class="ms-2 me-auto">
<div class="fw-bold">Theme</div>
{{- map.theme -}}
</div>
</li>
<li class="list-group-item d-flex justify-content-between align-items-start">
<div class="ms-2 me-auto">
<div class="fw-bold">Initial Cash</div>
{{- map.initialCash -}}
</div>
</li>
<li class="list-group-item d-flex justify-content-between align-items-start">
<div class="ms-2 me-auto">
<div class="fw-bold">Target Amount</div>
{{- map.targetAmount -}}
</div>
</li>
<li class="list-group-item d-flex justify-content-between align-items-start">
<div class="ms-2 me-auto">
<div class="fw-bold">Base Salary</div>
{{- map.baseSalary -}}
</div>
</li>
<li class="list-group-item d-flex justify-content-between align-items-start">
<div class="ms-2 me-auto">
<div class="fw-bold">Salary Increment</div>
{{- map.salaryIncrement -}}
</div>
</li>
<li class="list-group-item d-flex justify-content-between align-items-start">
<div class="ms-2 me-auto">
<div class="fw-bold">Max Dice Roll</div>
{{- map.maxDiceRoll -}}
</div>
</li>
</ul>
</div>
<div class="col mapCard">
<div class="card">
<div class="fw-bold card-header">Venture Cards</div>
<div class="card-body">
<div class="row mx-0">
{%- for ventureCard in site.data.ventureCards -%}
{%- if map.ventureCards -%}
{%- if map.ventureCards[forloop.index0] == 1 -%}
<div class="col ventureCard card bg-primary" aria-label="{{ventureCard.description}}" data-balloon-pos="up" data-balloon-blunt>
{%- else -%}
<div class="col ventureCard card" aria-label="{{ventureCard.description}}" data-balloon-pos="up" data-balloon-blunt>
{%- endif -%}
{%- else -%}
{%- assign ruleSet = map.ruleSet | downcase -%}
{%- if ruleSet == "standard" -%}
{%- if ventureCard.defaultStandard == true -%}
<div class="col ventureCard card bg-primary" aria-label="{{ventureCard.description}}" data-balloon-pos="up" data-balloon-blunt>
{%- else -%}
<div class="col ventureCard card" aria-label="{{ventureCard.description}}" data-balloon-pos="up" data-balloon-blunt>
{%- endif -%}
{%- else -%}
{%- if ventureCard.defaultEasy == true -%}
<div class="col ventureCard card bg-primary" aria-label="{{ventureCard.description}}" data-balloon-pos="up" data-balloon-blunt>
{%- else -%}
<div class="col ventureCard card" aria-label="{{ventureCard.description}}" data-balloon-pos="up" data-balloon-blunt>
{%- endif -%}
{%- endif -%}
{%- endif -%}
{{forloop.index}}
</div>
{%- endfor -%}
</div>
</div>
</div>
</div>
</div>
{% if map.changelog %}
<details class="mb-4">
<summary class="accordion-header accordion-button">Show Changelog</summary>
<div class="accordion-body nav-tabs">
{% for change in map.changelog %}
<div class="fw-bold nav-link border mt-2" style="display:inline-block">Version <span class="badge bg-secondary">{{ change.version }}</span></div>
{% if change.added %}
<div class="list-group-item d-flex justify-content-between align-items-start">
<div class="ms-2 me-auto">
<div class="fw-bold">Added</div>
<ul class="list-group"></ul>
{% for added in change.added %}
<li>{{ added }}</li>
{% endfor %}
</ul>
</div>
</div>
{% endif %}
{% if change.changed %}
<div class="list-group-item d-flex justify-content-between align-items-start">
<div class="ms-2 me-auto">
<div class="fw-bold">Changed</div>
<ul class="list-group"></ul>
{% for changed in change.changed %}
<li>{{ changed }}</li>
{% endfor %}
</ul>
</div>
</div>
{% endif %}
{% if change.removed %}
<div class="list-group-item d-flex justify-content-between align-items-start">
<div class="ms-2 me-auto">
<div class="fw-bold">Removed</div>
<ul class="list-group"></ul>
{% for removed in change.removed %}
<li>{{ removed }}</li>
{% endfor %}
</ul>
</div>
</div>
{% endif %}
{% endfor %}
</ul>
</div>
</details>
{% endif %}
</div>
<div class="card-footer text-muted">
<a class="" style="float:right" href="{%- include renderMapDownloadUrl.liquid map=map -%}">View in Repository</a>
<div>Download
{% if map.changelog -%}
{%- assign firstChange = map.changelog | first -%}
<span class="badge bg-secondary">v{{ firstChange.version }}</span>
{%- endif %}
</div>
{% if background.download or map.music.download -%}
<div class="btn-group" role="group">
{%- endif %}
<button class="btn btn-primary" onclick="GitZip.zipRepo('{%- include renderMapDownloadUrl.liquid map=map -%}');">Map</button>
{%- if background.download -%}
{% if background.download.first -%}
<div class="btn-group" role="group">
<button id="btnGroupBgDrop-{%- include renderMapSlugClass.liquid map=map -%}" type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
Background
</button>
<ul class="dropdown-menu" aria-labelledby="btnGroupBgDrop-{%- include renderMapSlugClass.liquid map=map -%}">
{% for download in background.download -%}
<li><a class="dropdown-item" href="{{ download }}">{{ download | remove:'https://' | remove:'http://' | split:'/' | first }}</a></li>
{% endfor -%}
</ul>
</div>
{% else -%}
<a class="btn btn-primary" href="{{ background.download }}">Background</a>
{% endif -%}
{%- endif %}
{%- if map.music.download -%}
{% if map.music.download.first -%}
<div class="btn-group" role="group">
<button id="btnGroupMusicDrop-{%- include renderMapSlugClass.liquid map=map -%}" type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
Music
</button>
<ul class="dropdown-menu" aria-labelledby="btnGroupMusicDrop-{%- include renderMapSlugClass.liquid map=map -%}">
{% for download in map.music.download -%}
<li><a class="dropdown-item" href="{{ download }}">{{ download | remove:'https://' | remove:'http://' | split:'/' | first }}</a></li>
{% endfor -%}
</ul>
</div>
{% else -%}
<a class="btn btn-primary" href="{{ map.music.download }}">Music</a>
{%- endif %}
{%- endif %}
{% if background.download or map.music.download -%}
</div>
{%- endif %}
</div>
<div class="card-footer text-muted">
{%- for tag in map.tags -%}
<span class="badge rounded-pill bg-secondary px-1">{{ tag }}</span>
{%- endfor %}
{% if map.music -%}
<span class="badge rounded-pill bg-secondary px-1">Custom Music</span>
{%- endif %}
{%- if background.download -%}
<span class="badge rounded-pill bg-secondary px-1">Custom Background</span>
{%- endif %}
</div>
</div>
</div>
{% assign mod = forloop.index | modulo: 3 %}
{% if mod == 0 %}
<div class="w-100"></div>
{% endif %}
{% if forloop.last == true %}
{% if mod == 1 %}
<div class="col mapCard"></div>
<div class="col mapCard"></div>
{% elsif mod == 2 %}
<div class="col mapCard"></div>
{% endif %}
{% endif %}
{%- endfor -%}
</div>
</div>
</div>
</main>