forked from blurryface/Website
feat: make marker not hardcoded
This commit is contained in:
parent
3a17988114
commit
8bcebc7069
1
css/map.min.css
vendored
Normal file
1
css/map.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
*{padding:0;margin:0;box-sizing:border-box}#map{height:100vh}#homeLink{position:absolute;bottom:10px;left:10px;padding:5px 10px;z-index:400;background-color:#fff;background-clip:padding-box;border:2px solid rgba(0,0,0,.2);border-radius:5px;text-decoration:none;color:#000}img.leaflet-tile{image-rendering:pixelated}.leaflet-control{color:#333}.leaflet-control-mouseposition{background:rgba(255,255,255,.8);margin:0 !important;padding:6px;width:calc(100% - 12px);text-align:end;border-top-left-radius:5px}.leaflet-marker-icon{transition:300ms}/*# sourceMappingURL=map.min.css.map */
|
1
css/map.min.css.map
Normal file
1
css/map.min.css.map
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"sourceRoot":"","sources":["src/map.scss"],"names":[],"mappings":"AAAA,EACE,UACA,SAEA,sBAKF,kBAEA,UACE,kBACA,YACA,UACA,iBACA,YAEA,sBACA,4BAEA,gCACA,kBAEA,qBACA,WAGF,iBACE,0BAGF,iBACE,WAGF,+BACE,gCAEA,oBACA,YAEA,wBAEA,eAEA,2BAGF,qBACE","file":"map.min.css"}
|
52
css/src/map.scss
Normal file
52
css/src/map.scss
Normal file
|
@ -0,0 +1,52 @@
|
|||
* {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/// old
|
||||
|
||||
#map { height: 100vh; }
|
||||
|
||||
#homeLink {
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
left: 10px;
|
||||
padding: 5px 10px;
|
||||
z-index: 400;
|
||||
|
||||
background-color: #fff;
|
||||
background-clip: padding-box;
|
||||
|
||||
border: 2px solid rgba(0,0,0,0.2);
|
||||
border-radius: 5px;
|
||||
|
||||
text-decoration: none;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
img.leaflet-tile {
|
||||
image-rendering: pixelated;
|
||||
}
|
||||
|
||||
.leaflet-control {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.leaflet-control-mouseposition {
|
||||
background: rgba(255, 255, 255, 0.8);
|
||||
|
||||
margin: 0 !important;
|
||||
padding: 6px;
|
||||
|
||||
width: calc(100% - 2 * 6px);
|
||||
|
||||
text-align: end;
|
||||
|
||||
border-top-left-radius: 5px;
|
||||
}
|
||||
|
||||
.leaflet-marker-icon {
|
||||
transition: 300ms;
|
||||
}
|
|
@ -314,7 +314,7 @@ a {
|
|||
|
||||
&, > * { transition: 0.16s }
|
||||
|
||||
&:not(.openned) {
|
||||
&:not(.opened) {
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
|
||||
|
|
2
css/style.min.css
vendored
2
css/style.min.css
vendored
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
|||
{"version":3,"sourceRoot":"","sources":["src/_fonts.scss","src/style.scss","src/colors/_light.scss","src/colors/_dark.scss"],"names":[],"mappings":"CAEQ,qKAER,WACE,sDAGF,kBACE,mDACA,gBAIF,UACE,uECXF,EACC,0CAGD,4BAEA,KACE,SAEA,WCXO,KDYP,MCXO,KDaP,mCANF,KAOI,WEfK,QFgBL,MEfK,MFmBT,KACC,gBAEA,eACC,sBACA,gBACA,WACA,oBACA,iBAGD,gBACC,sBACA,gBACA,UAIF,WACE,gBAEA,WAEA,cAEA,aACA,sBAGF,MACE,2BAGF,EACE,gBACA,YAGF,IACE,eAGF,OACC,aACA,eACA,QACA,WAEA,yBAND,OAOE,UAIF,MACC,kBACA,aACA,sBACA,sBACA,eACA,aACC,qBACA,kBACA,iBACA,eACA,gBAED,0BACC,WCzEa,QD0Eb,MCvFO,KD+FP,gBAsBD,iCA5BC,mCAjBF,MAkBI,cE3Ee,QF4Ef,WE9EW,QF+EZ,ME5FM,MFiGP,YACC,kBACA,cCxFS,QDyFT,WC1FK,QD2FL,MCnGM,QD2GP,gBANC,mCAND,YAOG,cE7FO,QF8FP,WE/FG,Q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ANA,mCALF,iEAMI,MEnWS,QFoWT,cEtWU,SF6Wd,yBACC,wCACE,WCjYF,QDkYE,MC9XG,KDqYH,4BALA,yDAJF,wCAKI,WErYJ,QFsYI,MElYC,MFiZd,YACE,WAEA,uBACE,aACA,eACA,SAEA,yBACE,aACA,QAEA,eAEA,cAEA,6BACE,UAEA,mCAHF,6BAII,kBAIJ,4CACE","file":"style.min.css"}
|
||||
{"version":3,"sourceRoot":"","sources":["src/_fonts.scss","src/style.scss","src/colors/_light.scss","src/colors/_dark.scss"],"names":[],"mappings":"CAEQ,qKAER,WACE,sDAGF,kBACE,mDACA,gBAIF,UACE,uECXF,EACC,0CAGD,4BAEA,KACE,SAEA,WCXO,KDYP,MCXO,KDaP,mCANF,KAOI,WEfK,QFgBL,MEfK,MFmBT,KACC,gBAEA,eACC,sBACA,gBACA,WACA,oBACA,iBAGD,gBACC,sBACA,gBACA,UAIF,WACE,gBAEA,WAEA,cAEA,aACA,sBAGF,MACE,2BAGF,EACE,gBACA,YAGF,IACE,eAGF,OACC,aACA,eACA,QACA,WAEA,yBAND,OAOE,UAIF,MACC,kBACA,aACA,sBACA,sBACA,eACA,aACC,qBACA,kBACA,iBACA,eACA,gBAED,0BACC,WCzEa,QD0Eb,MCvFO,KD+FP,gBAsBD,iCA5BC,mCAjBF,MAkBI,cE3Ee,QF4Ef,WE9EW,QF+EZ,ME5FM,MFiGP,YACC,kBACA,cCxFS,QDyFT,WC1FK,QD2FL,MCnGM,QD2GP,gBANC,mCAND,YAOG,cE7FO,QF8FP,WE/FG,QFgGJ,MEvGQ,SF4GT,kBACC,gBACA,qBAMF,yBA/CF,MAgDE,uBAGD,yBAnDD,MAoDG,kBACD,YAGA,SACC,SACA,gBACA,gBAGD,YACC,kBACA,MACA,QACA,YACA,iBACA,iBAEA,wEAKA,gBAJA,mCATD,YAUE,yEAMF,QACC,aAIH,EACE,MC1JO,QD4JP,mCAHF,EAII,ME5JQ,SF+JV,UACE,WAIJ,UACE,iBACE,uGASF,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,9 +33,10 @@
|
|||
|
||||
$json = json_decode($res->body, true);
|
||||
|
||||
if($json != null) {
|
||||
if($json != null)
|
||||
$twig->addGlobal('playerCount', count($json));
|
||||
}
|
||||
else
|
||||
$twig->addGlobal('playerCount', $json);
|
||||
|
||||
$twig->addGlobal('nations', $nations);
|
||||
|
||||
|
@ -66,9 +67,10 @@
|
|||
});
|
||||
|
||||
$router->get('/map', function() {
|
||||
global $twig;
|
||||
global $twig, $mysql;
|
||||
|
||||
$twig->addGlobal('pageUri', '/map');
|
||||
$twig->addGlobal('markers', json_encode($mysql->getMarkers()));
|
||||
|
||||
if(isset($_GET['center']))
|
||||
$twig->addGlobal('center', $_GET['center']);
|
||||
|
@ -124,6 +126,26 @@
|
|||
}
|
||||
});
|
||||
|
||||
// ---------------- Admin ---------------- //
|
||||
|
||||
$router->get('/admin', function() {
|
||||
global $twig, $mysql;
|
||||
|
||||
$twig->addGlobal('pageUri', '/admin');
|
||||
|
||||
$user = $mysql->getUserRecordFromId($_SESSION['user']['id']);
|
||||
|
||||
if($user == null && $user['admin'] == 0) {
|
||||
http_response_code(404);
|
||||
|
||||
echo $twig->render('404.twig');
|
||||
} else {
|
||||
echo $twig->render('admin/index.twig', array('db_data' => $user));
|
||||
}
|
||||
});
|
||||
|
||||
// ----------------- 404 ----------------- //
|
||||
|
||||
$router->set404(function() {
|
||||
global $twig;
|
||||
|
||||
|
|
43
js/map.js
43
js/map.js
|
@ -36,21 +36,40 @@ let mapLayer = L.tileLayer.crssLayer('https://cdn.theclashfruit.me/crss/map_new/
|
|||
zoomOffset: -8
|
||||
});
|
||||
|
||||
let ropMarkers = L.layerGroup([
|
||||
L.marker([-75.5, 49.5])
|
||||
.bindPopup('Info Centre')
|
||||
]);
|
||||
let ropMarkers = L.layerGroup([]);
|
||||
|
||||
let drrMarkers = L.layerGroup([
|
||||
let drrMarkers = L.layerGroup([]);
|
||||
|
||||
]);
|
||||
let miscMarkers = L.layerGroup([]);
|
||||
|
||||
let miscMarkers = L.layerGroup([
|
||||
L.marker([0.5, 0.5])
|
||||
.bindPopup('0; 0'),
|
||||
L.marker([1302.5, -661.5])
|
||||
.bindPopup('The Dropper'),
|
||||
]);
|
||||
markers.forEach(marker => {
|
||||
const coords = marker.data.split(';');
|
||||
|
||||
switch (marker.category) {
|
||||
case 'rop':
|
||||
ropMarkers
|
||||
.addLayer(
|
||||
L.marker([
|
||||
parseInt(coords[0]), parseInt(coords[1])
|
||||
]).bindPopup(marker.name)
|
||||
);
|
||||
break;
|
||||
case 'drr':
|
||||
drrMarkers.addLayer(
|
||||
L.marker([
|
||||
parseInt(coords[0]), parseInt(coords[1])
|
||||
]).bindPopup(marker.name)
|
||||
);
|
||||
break;
|
||||
default:
|
||||
miscMarkers.addLayer(
|
||||
L.marker([
|
||||
parseInt(coords[0]), parseInt(coords[1])
|
||||
]).bindPopup(marker.name)
|
||||
);
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
let playerMarkers = L.layerGroup([
|
||||
|
||||
|
|
|
@ -4,15 +4,15 @@ const navToggle = $(".navToggle");
|
|||
const menu = $(".pageNav > .container");
|
||||
|
||||
navToggle.onclick = () => {
|
||||
const menuToggled = menu.classList.contains("openned");
|
||||
const menuToggled = menu.classList.contains("opened");
|
||||
|
||||
if (menuToggled) {
|
||||
menu.classList.remove("openned");
|
||||
menu.classList.remove("opened");
|
||||
} else {
|
||||
menu.classList.add("openned");
|
||||
menu.classList.add("opened");
|
||||
}
|
||||
|
||||
navToggle.innerHTML = menuToggled ? "Menu" : "Close";
|
||||
}
|
||||
|
||||
window.addEventListener("transitionBuffering", () => menu.classList.remove("openned"));
|
||||
window.addEventListener("transitionBuffering", () => menu.classList.remove("opened"));
|
19
template/admin/index.twig
Normal file
19
template/admin/index.twig
Normal file
|
@ -0,0 +1,19 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
|
||||
|
||||
<title>Admin Panel</title>
|
||||
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1 class="text-center">soon</h1>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,89 +1,48 @@
|
|||
{% if reduced %} <title>{{ pageTitle }} • Clyde's Real Survival SMP</title> {% endif %}
|
||||
{% if not reduced %}
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
{% if reduced %}
|
||||
<title>{{ pageTitle }} • Clyde's Real Survival SMP</title>
|
||||
{% else %}
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<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>{{ pageTitle }} • Clyde's Real Survival SMP</title>
|
||||
<title>{{ pageTitle }} • Clyde's Real Survival SMP</title>
|
||||
|
||||
<meta name="name" content="Clyde's Real Survival SMP • {{ pageTitle }}" />
|
||||
<meta name="description" content="A very cool minecraft SMP that updates to every version starting from b1.0." />
|
||||
<meta name="keywords" content="crss, minecraft, beta, alpha, release, new, 1.0, version" />
|
||||
<meta name="theme-color" content="#ffffff" />
|
||||
<meta name="name" content="Clyde's Real Survival SMP • {{ pageTitle }}" />
|
||||
<meta name="description" content="A very cool minecraft SMP that updates to every version starting from b1.0." />
|
||||
<meta name="keywords" content="crss, minecraft, beta, alpha, release, new, 1.0, version" />
|
||||
<meta name="theme-color" content="#ffffff" />
|
||||
|
||||
<meta property="og:site_name" content="Clyde's Real Survival SMP" />
|
||||
<meta property="og:title" content="{{ pageTitle }}" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:locale" content="en_UK" />
|
||||
<meta property="og:url" content="https://crss.blurryface.xyz{{ pageUri }}" />
|
||||
<meta property="og:image" content="https://crss.blurryface.xyz/img/social_image.png" />
|
||||
<meta property="og:description" content="A very cool minecraft SMP that updates to every version starting from b1.0." />
|
||||
<meta property="og:site_name" content="Clyde's Real Survival SMP" />
|
||||
<meta property="og:title" content="{{ pageTitle }}" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:locale" content="en_UK" />
|
||||
<meta property="og:url" content="https://crss.blurryface.xyz{{ pageUri }}" />
|
||||
<meta property="og:image" content="https://crss.blurryface.xyz/img/social_image.png" />
|
||||
<meta property="og:description" content="A very cool minecraft SMP that updates to every version starting from b1.0." />
|
||||
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta property="twitter:domain" content="crss.blurryface.xyz" />
|
||||
<meta property="twitter:url" content="https://crss.blurryface.xyz{{ pageUri }}" />
|
||||
<meta name="twitter:title" content="Clyde's Real Survival SMP • {{ pageTitle }}" />
|
||||
<meta name="twitter:description" content="A very cool minecraft SMP that updates to every version starting from b1.0." />
|
||||
<meta name="twitter:image" content="https://crss.blurryface.xyz/img/social_image.png" />
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta property="twitter:domain" content="crss.blurryface.xyz" />
|
||||
<meta property="twitter:url" content="https://crss.blurryface.xyz{{ pageUri }}" />
|
||||
<meta name="twitter:title" content="Clyde's Real Survival SMP • {{ pageTitle }}" />
|
||||
<meta name="twitter:description" content="A very cool minecraft SMP that updates to every version starting from b1.0." />
|
||||
<meta name="twitter:image" content="https://crss.blurryface.xyz/img/social_image.png" />
|
||||
|
||||
<script src="/js/main.js" type="module"></script>
|
||||
<script src="/js/main.js" type="module"></script>
|
||||
|
||||
{% 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>
|
||||
<script src="https://cdn.jsdelivr.net/npm/leaflet-mouse-position@1.2.0/src/L.Control.MousePosition.min.js"></script>
|
||||
{% if pageUri == '/map' %}
|
||||
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"/>
|
||||
|
||||
<style>
|
||||
#map { height: 100vh; }
|
||||
<link rel="stylesheet" href="/css/map.min.css" />
|
||||
|
||||
#homeLink {
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
left: 10px;
|
||||
padding: 5px 10px;
|
||||
z-index: 400;
|
||||
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/leaflet-mouse-position@1.2.0/src/L.Control.MousePosition.min.js"></script>
|
||||
{% endif %}
|
||||
|
||||
background-color: #fff;
|
||||
background-clip: padding-box;
|
||||
|
||||
border: 2px solid rgba(0,0,0,0.2);
|
||||
border-radius: 5px;
|
||||
|
||||
text-decoration: none;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
img.leaflet-tile {
|
||||
image-rendering: pixelated;
|
||||
}
|
||||
|
||||
.leaflet-control {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.leaflet-control-mouseposition {
|
||||
background: rgba(255, 255, 255, 0.8);
|
||||
|
||||
margin: 0 !important;
|
||||
padding: 6px;
|
||||
|
||||
width: calc(100% - 2 * 6px);
|
||||
|
||||
text-align: end;
|
||||
|
||||
border-top-left-radius: 5px;
|
||||
}
|
||||
|
||||
.leaflet-marker-icon {
|
||||
transition: 300ms;
|
||||
}
|
||||
</style>
|
||||
{% endif %}
|
||||
|
||||
<link rel="icon" href="/favicon.ico">
|
||||
<link rel="stylesheet" href="/css/style.min.css">
|
||||
</head>
|
||||
<body> {% endif %}
|
||||
<link rel="icon" href="/favicon.ico">
|
||||
<link rel="stylesheet" href="/css/style.min.css">
|
||||
</head>
|
||||
<body>
|
||||
{% endif %}
|
|
@ -1,9 +1,13 @@
|
|||
{% include 'includes/head.twig' with {'pageTitle': 'Map'} %}
|
||||
|
||||
<div id="map"></div>
|
||||
<a id="homeLink" href="/">Go Home</a>
|
||||
|
||||
<script>const center = "{{ center }}";</script>
|
||||
<script>
|
||||
const center = "{{ center }}";
|
||||
|
||||
const markers = {{ markers|raw }};
|
||||
</script>
|
||||
|
||||
<script src="js/map.js"></script>
|
||||
|
||||
{% include 'includes/foot.twig' %}
|
|
@ -57,4 +57,20 @@
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function getMarkers() {
|
||||
$sql = 'SELECT * FROM markers';
|
||||
|
||||
$stmt = $this->conn->prepare($sql);
|
||||
|
||||
$stmt->execute();
|
||||
|
||||
$res = $stmt->get_result();
|
||||
|
||||
if($res->num_rows > 0) {
|
||||
return $res->fetch_all(MYSQLI_ASSOC);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue