Companies
+{{ company.name }}
+{{ company.short_description }}
+ + + {% endfor %} +diff --git a/.gitea/workflows/upload.yml b/.gitea/workflows/upload.yml
index a3a7fd2..112338b 100644
--- a/.gitea/workflows/upload.yml
+++ b/.gitea/workflows/upload.yml
@@ -1,6 +1,9 @@
-name: ️Upload Website
+name: Upload Website
-on: [ push ]
+on:
+ push:
+ branches:
+ - main
jobs:
sftp:
diff --git a/index.php b/index.php
index 3e1ffa4..5d4fd13 100644
--- a/index.php
+++ b/index.php
@@ -19,26 +19,43 @@
'short_description' => 'The first nation, prev. known as ROP.',
'description' => 'The first nation on CRSS, previously known as ROP.',
),
- 'drr' => array(
- 'name' => 'Democratic Republic of Rayland',
- 'flag' => 'https://raw.theclashfruit.me/CRSS/CRSS/main/Nations/Democratic%20Republic%20of%20Rayland/bannre.png',
- 'short' => 'drr',
- 'short_description' => 'Short description of D.R.R.',
- 'description' => 'Full description of D.R.R', //does this support html and line breaks
- ),
'cnk' => array(
'name' => 'Chunkia',
'flag' => 'https://raw.theclashfruit.me/CRSS/CRSS/main/Nations/Chunkia/chunkia512.png',
'short' => 'cnk',
'short_description' => 'Chunkia is based in a chaotic landscape',
'description' => 'In the chaos of Minecraft, chunk errors are inevitable. Chunkia is based in one.',
- )
+ ),
'ttk' => array(
'name' => 'The Toaster-Königreich',
'flag' => 'https://raw.theclashfruit.me/CRSS/CRSS/main/Nations/The%20Toaster-K%C3%B6nigreich/The%20Toaster-K%C3%B6nigreich%20Flag.png',
'short' => 'ttk',
'short_description' => 'The Toaster-Königreich is the Industrialized Nation of CRSS',
'description' => 'In the vast landsacpe of CRSS, The Toaster-Königreich is one of the most industrialized Marxist district of CRSS. With Charge Industries as one of the main government controlled company in the nation.',
+ ),
+ 'rob' => array(
+ 'name' => 'Republic of Budapest',
+ 'flag' => 'https://raw.theclashfruit.me/CRSS/CRSS/main/Nations/Republic%20of%20Budapest/Assets/Flag.svg',
+ 'short' => 'rob',
+ 'short_description' => 'Republic of Budapest is a country located to the west of the map.',
+ 'description' => 'Republic of Budapest is a country located to the west of the map.',
+ )
+ );
+
+ $companies = array(
+ 'fbk' => array(
+ 'name' => 'FedBank',
+ 'logo' => 'https://raw.theclashfruit.me/CRSS/CRSS/main/Nations/Republic%20of%20Panorama/Flag.svg',
+ 'short' => 'fbk',
+ 'short_description' => 'An International Bank, owned by the PSF government',
+ 'description' => 'FedBank is an International bank owned and controlled by the Panorama Socialist Federation\'s Government. The main building is in PSF, but there is a FedBank in TTK too.'
+ ),
+ 'ntn' => array(
+ 'name' => 'Northern',
+ 'logo' => 'https://raw.theclashfruit.me/CRSS/CRSS/main/Companies/Chunkia/northern.svg',
+ 'short' => 'ntn',
+ 'short_description' => 'The Northern Company.',
+ 'description' => 'Creators of the H1 and the Northern Complex, Northern is dedicated to improving the CRSS experience.'
)
);
@@ -62,6 +79,7 @@
$twig->addGlobal('playerCount', $json);
$twig->addGlobal('nations', $nations);
+ $twig->addGlobal('companies', $companies);
$twig->addGlobal('dc_uri', 'https://discord.com/api/oauth2/authorize?client_id=1144248396467683338&redirect_uri=' . urlencode($_ENV['DISCORD_REDIRECT']) . '&response_type=code&scope=identify%20guilds&state=' . urlencode($_SERVER['REQUEST_URI']));
$twig->addGlobal('reduced', isset($_GET['reduced']));
@@ -82,6 +100,14 @@
echo $twig->render('nations.twig');
});
+ $router->get('/companies', function() {
+ global $twig;
+
+ $twig->addGlobal('pageUri', '/companies');
+
+ echo $twig->render('companies.twig');
+ });
+
$router->get('/gallery', function() {
global $twig;
@@ -140,6 +166,21 @@
}
});
+ $router->get('/company/([a-z]+)', function ($company) {
+ global $twig, $mysql, $companies;
+
+ $twig->addGlobal('pageUri', '/company/' . $company);
+
+ if(!$companies[$company]) {
+ http_response_code(404);
+
+ echo $twig->render('404.twig');
+ } else {
+ echo $twig->render('nation.twig', array('nation' => $companies[$company]));
+ }
+ });
+
+
$router->get('/u/([a-z0-9_\.]+)', function($name) {
global $twig, $mysql, $discord;
diff --git a/js/map.js b/js/map.js
index 19b9769..172e6f0 100644
--- a/js/map.js
+++ b/js/map.js
@@ -50,21 +50,21 @@ markers.forEach(marker => {
ropMarkers
.addLayer(
L.marker([
- parseInt(coords[0]), parseInt(coords[1])
+ parseFloat(coords[0]), parseFloat(coords[1])
]).bindPopup(marker.name)
);
break;
case 'drr':
drrMarkers.addLayer(
L.marker([
- parseInt(coords[0]), parseInt(coords[1])
+ parseFloat(coords[0]), parseFloat(coords[1])
]).bindPopup(marker.name)
);
break;
default:
miscMarkers.addLayer(
L.marker([
- parseInt(coords[0]), parseInt(coords[1])
+ parseFloat(coords[0]), parseFloat(coords[1])
]).bindPopup(marker.name)
);
break;
@@ -94,8 +94,8 @@ let map = L.map('map', {
projection: L.Projection.LonLat
}),
}).setView([
- parseInt(center.split(';')[1]),
- parseInt(center.split(';')[0])
+ parseFloat(center.split(';')[1]),
+ parseFloat(center.split(';')[0])
], 2);
let baseMaps = {
diff --git a/template/companies.twig b/template/companies.twig
new file mode 100644
index 0000000..8410a9e
--- /dev/null
+++ b/template/companies.twig
@@ -0,0 +1,22 @@
+{% include 'includes/head.twig' with {'pageTitle': 'Companies'} %}
+
+{% include 'includes/hero.twig' %}
+
+{% include 'includes/nav.twig' with {'page': 'companies'} %}
+
+ {{ company.short_description }}Companies
+ {{ company.name }}
+
+
+