forked from CRSS/Website
feat: add map
This commit is contained in:
parent
f879003a9f
commit
a806fc043c
|
@ -6,6 +6,29 @@
|
||||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||||
|
|
||||||
<title>Clyde's Real Survival SMP • {{ pageTitle }}</title>
|
<title>Clyde's Real Survival SMP • {{ pageTitle }}</title>
|
||||||
|
|
||||||
|
{% if pageTitle == 'Map' %}
|
||||||
|
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"/>
|
||||||
|
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
#map { height: 100vh; }
|
||||||
|
|
||||||
|
#homeLink {
|
||||||
|
position: absolute;
|
||||||
|
top: 16px;
|
||||||
|
left: 16px;
|
||||||
|
padding: 8px 16px;
|
||||||
|
z-index: 400;
|
||||||
|
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 32px;
|
||||||
|
|
||||||
|
text-decoration: none;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
<link rel="icon" href="/favicon.ico">
|
||||||
<link rel="stylesheet" href="/css/style.min.css">
|
<link rel="stylesheet" href="/css/style.min.css">
|
||||||
|
|
|
@ -1,24 +1,24 @@
|
||||||
{% include 'includes/head.twig' with {'pageTitle': 'Map'} %}
|
{% include 'includes/head.twig' with {'pageTitle': 'Map'} %}
|
||||||
|
|
||||||
<div class="pageHero" id="hero">
|
<div id="map"></div>
|
||||||
<div class="blurFiler">
|
<a id="homeLink" href="/">Go Home</a>
|
||||||
<div class="container">
|
|
||||||
<h1>Clyde's Real Survival SMP</h1>
|
|
||||||
|
|
||||||
<div class="serverInfo">
|
|
||||||
Online: <label>0</label> / <label>20</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% include 'includes/nav.twig' with {'page': 'map',} %}
|
<script>
|
||||||
|
let map = L.map('map', {
|
||||||
<main class="pageContent" id="content">
|
zoomControl: false,
|
||||||
<div class="container">
|
scrollWheelZoom: false,
|
||||||
<p>⚒️ Under Construction</p>
|
doubleClickZoom: false,
|
||||||
</div>
|
}).setView([-36.3, -41.3], 4);
|
||||||
</main>
|
|
||||||
|
L.tileLayer('https://cdn.theclashfruit.me/crss/map/tile_{x}x{y}y.png', {
|
||||||
|
attribution: '© <a href="https://crss.blurryface.xyz/">CRSS</a> players',
|
||||||
|
noWrap: true
|
||||||
|
}).addTo(map);
|
||||||
|
|
||||||
|
|
||||||
|
L.marker([-36.3, -41.3])
|
||||||
|
.addTo(map)
|
||||||
|
.bindPopup('Spawn Town in Republic of Panorama');
|
||||||
|
</script>
|
||||||
|
|
||||||
{% include 'includes/footer.twig' %}
|
|
||||||
{% include 'includes/foot.twig' %}
|
{% include 'includes/foot.twig' %}
|
|
@ -24,7 +24,7 @@
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
function getUserRecordFromUsername($username): bool|array|null {
|
function getUserRecordFromUsername($username): array | null {
|
||||||
$sql = 'SELECT * FROM users WHERE username = ?';
|
$sql = 'SELECT * FROM users WHERE username = ?';
|
||||||
|
|
||||||
$stmt = $this->conn->prepare($sql);
|
$stmt = $this->conn->prepare($sql);
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getUserRecordFromId($id): bool|array|null {
|
function getUserRecordFromId($id): array | null {
|
||||||
$sql = 'SELECT * FROM users WHERE id = ?';
|
$sql = 'SELECT * FROM users WHERE id = ?';
|
||||||
|
|
||||||
$stmt = $this->conn->prepare($sql);
|
$stmt = $this->conn->prepare($sql);
|
||||||
|
|
Loading…
Reference in a new issue