2020-06-28 19:32:30 +02:00
|
|
|
@css(css/maps.css)
|
|
|
|
@js(js/maps.js)
|
2020-06-27 02:25:54 +02:00
|
|
|
TODO: condition!
|
2020-06-28 19:32:30 +02:00
|
|
|
@js(js/maps_admin.js)
|
2020-06-27 00:23:57 +02:00
|
|
|
|
2020-06-28 19:32:30 +02:00
|
|
|
@extends(templates/layout_normal)
|
2020-06-27 00:23:57 +02:00
|
|
|
|
2021-03-20 10:26:57 +01:00
|
|
|
@section(pagemodal)
|
|
|
|
<div id="playMode" class="modal">
|
|
|
|
<h2>Play map</h2>
|
|
|
|
<a id="singleButton" class="button fullWidth marginTop" href="" title="Single player">Single player</a>
|
|
|
|
<p class="bold center marginTop marginBottom">OR</p>
|
|
|
|
<button id="multiButton" class="fullWidth green" data-map-id="">Multiplayer (beta)</button>
|
2021-05-19 17:11:49 +02:00
|
|
|
<?php if ($isLoggedIn): ?>
|
|
|
|
<p class="bold center marginTop marginBottom">OR</p>
|
|
|
|
<button id="challengeButton" class="fullWidth yellow" data-map-id="" data-timer="">Challenge (gamma)</button>
|
|
|
|
<?php endif; ?>
|
2021-03-20 10:26:57 +01:00
|
|
|
<div class="right">
|
|
|
|
<button id="closePlayModeButton" class="gray marginTop" type="button">Close</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id="multi" class="modal">
|
|
|
|
<h2>Multiplayer (beta)</h2>
|
|
|
|
<form id="multiForm" class="marginTop" data-no-submit="true">
|
|
|
|
<a id="createNewRoomButton" class="button fullWidth green" href="" title="Create new room">Create new room</a>
|
|
|
|
<p class="bold center marginTop marginBottom">OR</p>
|
|
|
|
<div class="inputWithButton">
|
2022-05-26 15:55:45 +02:00
|
|
|
<input type="text" class="text" name="roomId" placeholder="Room to connect" required minlength="6" maxlength="6"><!--
|
2021-03-20 10:26:57 +01:00
|
|
|
--><button id="authenticateWithGoogleButton" type="submit">Connect</button>
|
|
|
|
</div>
|
|
|
|
<div class="right">
|
|
|
|
<button id="closeMultiButton" class="gray marginTop" type="button">Close</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
2021-05-12 13:51:06 +02:00
|
|
|
<div id="challenge" class="modal">
|
|
|
|
<h2>Challenge (gamma)</h2>
|
|
|
|
<form id="challengeForm" class="marginTop" method="get">
|
2021-05-28 08:36:45 +02:00
|
|
|
<div id="restrictions" class="marginTop marginBottom">
|
2021-05-12 13:51:06 +02:00
|
|
|
<h3>Optional restrictions</h3>
|
2022-05-26 14:23:29 +02:00
|
|
|
<div class="marginTop">
|
|
|
|
<input type="checkbox" id="timerEnabled" name="timerEnabled" value="timerEnabled" /><label id="timeLimitLabel" for="timerEnabled">Time limit measured in seconds</label>
|
|
|
|
</div>
|
|
|
|
<div id="timeLimitType">
|
|
|
|
<input class="fullWidth" type="range" id="timeLimit" name="timeLimit" min="10" max="1800" step="10" value="300" />
|
|
|
|
<input type="radio" id="timeLimitTypeGame" name="timeLimitType" value="game" checked /><label for="timeLimitTypeGame">for the whole game</label>
|
|
|
|
<input class="marginLeft" type="radio" id="timeLimitTypeRound" name="timeLimitType" value="round" /><label for="timeLimitTypeRound">per round</label>
|
2021-05-12 13:51:06 +02:00
|
|
|
</div>
|
2022-05-26 14:23:29 +02:00
|
|
|
<div class="marginTop">
|
|
|
|
<input type="checkbox" id="noMove" name="noMove" value="noMove" /><label for="noMove">No movement allowed</label>
|
2021-05-12 13:51:06 +02:00
|
|
|
</div>
|
2022-05-26 14:23:29 +02:00
|
|
|
<div class="marginTop">
|
|
|
|
<input type="checkbox" id="noZoom" name="noZoom" value="noZoom" /><label for="noZoom">No zoom allowed</label>
|
2021-05-12 13:51:06 +02:00
|
|
|
</div>
|
2022-05-26 14:23:29 +02:00
|
|
|
<div class="marginTop">
|
|
|
|
<input type="checkbox" id="noPan" name="noPan" value="noPan" /><label for="noPan">No camera change allowed</label>
|
2021-05-19 21:16:59 +02:00
|
|
|
</div>
|
2021-05-12 13:51:06 +02:00
|
|
|
<input type="hidden" name="mapId" id="challengeMapId" />
|
|
|
|
</div>
|
|
|
|
<button id="createNewChallengeButton" type="submit" class="button fullWidth green" href="" title="Create new challenge">Create new challenge</button>
|
|
|
|
<div class="right">
|
|
|
|
<button id="closeChallengeButton" class="gray marginTop" type="button">Close</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
2021-03-20 10:26:57 +01:00
|
|
|
@endsection
|
|
|
|
|
2020-06-28 19:32:30 +02:00
|
|
|
@section(main)
|
2020-06-01 20:39:23 +02:00
|
|
|
<div id="mapContainer">
|
2020-06-14 02:37:49 +02:00
|
|
|
<?php foreach ($maps as $map): ?>
|
2022-05-26 14:21:05 +02:00
|
|
|
<div class="mapItem <?= $map['unlisted'] ? 'unlisted' : '' ?>">
|
2020-05-31 00:21:29 +02:00
|
|
|
<div class="title">
|
|
|
|
<p class="title"><?= $map['name'] ?></p>
|
|
|
|
</div>
|
2020-06-21 19:32:30 +02:00
|
|
|
<div class="imgContainer" data-bound-south-lat="<?= $map['bound_south_lat'] ?>" data-bound-west-lng="<?= $map['bound_west_lng'] ?>" data-bound-north-lat="<?= $map['bound_north_lat'] ?>" data-bound-east-lng="<?= $map['bound_east_lng'] ?>"></div>
|
2020-05-31 00:21:29 +02:00
|
|
|
<div class="inner">
|
|
|
|
<div class="info">
|
|
|
|
<p>
|
|
|
|
<?php /* Copyright (c) 2019 The Bootstrap Authors. License can be found in 'USED_SOFTWARE' in section 'Bootstrap Icons'. */ ?>
|
|
|
|
<svg class="inline" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
|
|
|
<path fill-rule="evenodd" d="M8 16s6-5.686 6-10A6 6 0 0 0 2 6c0 4.314 6 10 6 10zm0-7a3 3 0 1 0 0-6 3 3 0 0 0 0 6z" />
|
2020-06-21 17:36:08 +02:00
|
|
|
</svg><!--
|
|
|
|
--><?= $map['num_places'] ?> places
|
2020-05-31 00:21:29 +02:00
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<?php /* Copyright (c) 2019 The Bootstrap Authors. License can be found in 'USED_SOFTWARE' in section 'Bootstrap Icons'. */ ?>
|
|
|
|
<svg class="inline" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
|
|
|
<path fill-rule="evenodd" d="M12.5 2h-9V1h9v1zm-10 1.5v9h-1v-9h1zm11 9v-9h1v9h-1zM3.5 14h9v1h-9v-1z" />
|
|
|
|
<path fill-rule="evenodd" d="M14 3a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm0 1a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0 11a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm0 1a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM2 3a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm0 1a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0 11a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm0 1a2 2 0 1 0 0-4 2 2 0 0 0 0 4z" />
|
2020-06-21 17:36:08 +02:00
|
|
|
</svg><!--
|
|
|
|
-->~ <?= $map['area'][0] ?> <?= $map['area'][1] ?><sup>2</sup>
|
2020-05-31 00:21:29 +02:00
|
|
|
</p>
|
2020-05-30 15:37:26 +02:00
|
|
|
</div>
|
2020-06-24 22:32:54 +02:00
|
|
|
<div class="description marginTop">
|
|
|
|
<p class="small center"><?= $map['description'] ?></p>
|
|
|
|
</div>
|
2020-05-30 15:37:26 +02:00
|
|
|
</div>
|
2021-03-20 10:26:57 +01:00
|
|
|
<div class="buttonContainer">
|
2023-04-16 17:40:49 +02:00
|
|
|
<?php if ($isAdmin): ?>
|
|
|
|
<button class="button fullWidth noRightRadius playButton" data-map-id="<?= $map['id'] ?>" data-map-name="<?= htmlspecialchars($map['name']) ?>" title="Play map '<?= $map['name'] ?>'">Play this map</button>
|
|
|
|
<a class="button yellow fullWidth noLeftRadius noRightRadius" href="/admin/mapEditor/<?= $map['id']; ?>" title="Edit map '<?= $map['name'] ?>'">Edit</a>
|
|
|
|
<button class="button red fullWidth noLeftRadius deleteButton" data-map-id="<?= $map['id'] ?>" data-map-name="<?= htmlspecialchars($map['name']) ?>" title="Delete map '<?= $map['name'] ?>'">Delete</button>
|
2021-03-20 10:26:57 +01:00
|
|
|
<?php else: ?>
|
2023-04-16 17:40:49 +02:00
|
|
|
<button class="button fullWidth playButton" data-map-id="<?= $map['id'] ?>" data-map-name="<?= htmlspecialchars($map['name']) ?>" title="Play map '<?= $map['name'] ?>'">Play this map</button>
|
2021-03-20 10:26:57 +01:00
|
|
|
<?php endif; ?>
|
|
|
|
</div>
|
2020-05-31 00:21:29 +02:00
|
|
|
</div>
|
|
|
|
<?php endforeach; ?>
|
2020-06-10 23:17:13 +02:00
|
|
|
<?php if ($isAdmin): ?>
|
|
|
|
<div class="mapItem new">
|
2020-06-14 02:37:49 +02:00
|
|
|
<a class="button green fullWidth" href="/admin/mapEditor" title="Add new map">
|
2020-06-10 23:17:13 +02:00
|
|
|
Add new map
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<?php else: ?>
|
|
|
|
<div class="mapItem"></div>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php if (count($maps) < 3): ?>
|
|
|
|
<?php for ($i = 0; $i < 3 - count($maps); ++$i): ?>
|
2020-05-31 00:21:29 +02:00
|
|
|
<div class="mapItem"></div>
|
|
|
|
<?php endfor; ?>
|
|
|
|
<?php endif; ?>
|
2020-05-30 15:37:26 +02:00
|
|
|
</div>
|
2020-06-27 00:23:57 +02:00
|
|
|
@endsection
|