MAPG-82 introduce very basic templating

This commit is contained in:
Bence Pőcze 2020-05-31 00:21:29 +02:00
parent 2a14be7c3a
commit 9a4d9435d9
5 changed files with 119 additions and 136 deletions

View File

@ -1,40 +1,21 @@
<!DOCTYPE html> <?php require 'templates/main_header.php'; ?>
<html> <div class="header small">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>MapGuesser</title>
<link href="static/css/mapguesser.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;500&family=Roboto+Mono:wght@300;500&display=swap" rel="stylesheet">
<link rel="icon" type="image/png" sizes="192x192" href="static/img/favicon/192x192.png">
<link rel="icon" type="image/png" sizes="96x96" href="static/img/favicon/96x96.png">
<link rel="icon" type="image/png" sizes="32x32" href="static/img/favicon/32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="static/img/favicon/16x16.png">
</head>
<body>
<div id="loading">
<img src="static/img/loading.svg">
</div>
<div class="header small">
<div class="grid"> <div class="grid">
<h1> <h1>
<a href="maps" title="Back to playable maps"> <a href="maps" title="Back to playable maps">
<?php /* Copyright (c) 2019 The Bootstrap Authors. License can be found in 'USED_SOFTWARE' in section 'Bootstrap Icons'. */ ?> <?php require 'templates/icon.php'; ?>
<svg class="inline" width="1em" height="1em" viewBox="0 0 16 16" fill="#28a745" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" d="M15.817.613A.5.5 0 0 1 16 1v13a.5.5 0 0 1-.402.49l-5 1a.502.502 0 0 1-.196 0L5.5 14.51l-4.902.98A.5.5 0 0 1 0 15V2a.5.5 0 0 1 .402-.49l5-1a.5.5 0 0 1 .196 0l4.902.98 4.902-.98a.5.5 0 0 1 .415.103zM10 2.41l-4-.8v11.98l4 .8V2.41zm1 11.98l4-.8V1.61l-4 .8v11.98zm-6-.8V1.61l-4 .8v11.98l4-.8z" />
</svg>
<span>MapGuesser</span> <span>MapGuesser</span>
</a> </a>
</h1> </h1>
<p id="roundInfo">Round: <span id="currentRound" class="mono bold"></span> | Score: <span id="currentScoreSum" class="mono bold"></span></p> <p id="roundInfo">Round: <span id="currentRound" class="mono bold"></span> | Score: <span id="currentScoreSum" class="mono bold"></span></p>
</div> </div>
</div> </div>
<div id="cover"></div> <div id="cover"></div>
<div id="panorama"></div> <div id="panorama"></div>
<div id="showGuessButtonContainer"> <div id="showGuessButtonContainer">
<button id="showGuessButton" class="fullWidth">Show guess map</button> <button id="showGuessButton" class="fullWidth">Show guess map</button>
</div> </div>
<div id="guess"> <div id="guess">
<div id="closeGuessButtonContainer" class="buttonContainer marginBottom"> <div id="closeGuessButtonContainer" class="buttonContainer marginBottom">
<button id="closeGuessButton" class="fullWidth gray">Close</button> <button id="closeGuessButton" class="fullWidth gray">Close</button>
</div> </div>
@ -62,12 +43,11 @@
<button id="showSummaryButton" class="fullWidth">Show summary</button> <button id="showSummaryButton" class="fullWidth">Show summary</button>
<button id="startNewGameButton" class="fullWidth">Play this map again</button> <button id="startNewGameButton" class="fullWidth">Play this map again</button>
</div> </div>
</div> </div>
<script> <script>
var mapId = '<?= $mapId ?>'; var mapId = '<?= $mapId ?>';
var mapBounds = <?= json_encode($bounds) ?>; var mapBounds = <?= json_encode($bounds) ?>;
</script> </script>
<script src="https://maps.googleapis.com/maps/api/js?key=<?= $_ENV['GOOGLE_MAPS_JS_API_KEY'] ?>"></script> <script src="https://maps.googleapis.com/maps/api/js?key=<?= $_ENV['GOOGLE_MAPS_JS_API_KEY'] ?>"></script>
<script src="static/js/game.js"></script> <script src="static/js/game.js"></script>
</body> <?php require 'templates/main_footer.php'; ?>
</html>

View File

@ -1,30 +1,11 @@
<!DOCTYPE html> <?php require 'templates/main_header.php'; ?>
<html> <div class="header">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>MapGuesser</title>
<link href="static/css/mapguesser.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;500&family=Roboto+Mono:wght@300;500&display=swap" rel="stylesheet">
<link rel="icon" type="image/png" sizes="192x192" href="static/img/favicon/192x192.png">
<link rel="icon" type="image/png" sizes="96x96" href="static/img/favicon/96x96.png">
<link rel="icon" type="image/png" sizes="32x32" href="static/img/favicon/32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="static/img/favicon/16x16.png">
</head>
<body>
<div id="loading">
<img src="static/img/loading.svg">
</div>
<div class="header">
<h1> <h1>
<?php /* Copyright (c) 2019 The Bootstrap Authors. License can be found in 'USED_SOFTWARE' in section 'Bootstrap Icons'. */ ?> <?php require 'templates/icon.php'; ?>
<svg class="inline" width="1em" height="1em" viewBox="0 0 16 16" fill="#28a745" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" d="M15.817.613A.5.5 0 0 1 16 1v13a.5.5 0 0 1-.402.49l-5 1a.502.502 0 0 1-.196 0L5.5 14.51l-4.902.98A.5.5 0 0 1 0 15V2a.5.5 0 0 1 .402-.49l5-1a.5.5 0 0 1 .196 0l4.902.98 4.902-.98a.5.5 0 0 1 .415.103zM10 2.41l-4-.8v11.98l4 .8V2.41zm1 11.98l4-.8V1.61l-4 .8v11.98zm-6-.8V1.61l-4 .8v11.98l4-.8z" />
</svg>
MapGuesser MapGuesser
</h1> </h1>
</div> </div>
<div class="main"> <div class="main">
<h2>Playable maps</h2> <h2>Playable maps</h2>
<div class="mapContainer"> <div class="mapContainer">
<?php foreach ($maps as $map) : ?> <?php foreach ($maps as $map) : ?>
@ -62,13 +43,12 @@
<?php endfor; ?> <?php endfor; ?>
<?php endif; ?> <?php endif; ?>
</div> </div>
</div> </div>
<script> <script>
document.getElementById('loading').style.visibility = 'hidden'; document.getElementById('loading').style.visibility = 'hidden';
window.addEventListener('beforeunload', function (e) { window.addEventListener('beforeunload', function (e) {
document.getElementById('loading').style.visibility = 'visible'; document.getElementById('loading').style.visibility = 'visible';
}); });
</script> </script>
</body> <?php require 'templates/main_footer.php'; ?>
</html>

4
views/templates/icon.php Normal file
View File

@ -0,0 +1,4 @@
<?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="#28a745" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" d="M15.817.613A.5.5 0 0 1 16 1v13a.5.5 0 0 1-.402.49l-5 1a.502.502 0 0 1-.196 0L5.5 14.51l-4.902.98A.5.5 0 0 1 0 15V2a.5.5 0 0 1 .402-.49l5-1a.5.5 0 0 1 .196 0l4.902.98 4.902-.98a.5.5 0 0 1 .415.103zM10 2.41l-4-.8v11.98l4 .8V2.41zm1 11.98l4-.8V1.61l-4 .8v11.98zm-6-.8V1.61l-4 .8v11.98l4-.8z" />
</svg>

View File

@ -0,0 +1,2 @@
</body>
</html>

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>MapGuesser</title>
<link href="static/css/mapguesser.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;500&family=Roboto+Mono:wght@300;500&display=swap" rel="stylesheet">
<link rel="icon" type="image/png" sizes="192x192" href="static/img/favicon/192x192.png">
<link rel="icon" type="image/png" sizes="96x96" href="static/img/favicon/96x96.png">
<link rel="icon" type="image/png" sizes="32x32" href="static/img/favicon/32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="static/img/favicon/16x16.png">
</head>
<body>
<div id="loading">
<img src="static/img/loading.svg">
</div>