diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..e81c7f3 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,25 @@ +name: Deploy Website + +on: + push: + branches: + - main + +jobs: + lint: + uses: ./.gitea/workflows/lint.yml + deploy: + runs-on: ubuntu-latest + needs: [ lint ] + steps: + - name: Deploy Website + uses: https://github.com/nekiro/ssh-job@main + with: + host: ${{ secrets.HOST }} + user: ${{ secrets.USER }} + password: ${{ secrets.PASSWORD }} + command: | + cd /var/www/crss + git pull + composer install --no-dev --optimize-autoloader + php .scripts/deploy.php \ No newline at end of file diff --git a/.gitea/workflows/lint.yml b/.gitea/workflows/lint.yml new file mode 100644 index 0000000..d4da91f --- /dev/null +++ b/.gitea/workflows/lint.yml @@ -0,0 +1,18 @@ +name: Lint PHP Code + +on: + - push + - pull_request + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + - name: Setup PHP + uses: https://github.com/shivammathur/setup-php@v2 + with: + php-version: '8.2' + - name: Lint PHP Code + run: php -l *.php **/*.php \ No newline at end of file diff --git a/.gitea/workflows/upload.yml b/.gitea/workflows/upload.yml deleted file mode 100644 index 112338b..0000000 --- a/.gitea/workflows/upload.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Upload Website - -on: - push: - branches: - - main - -jobs: - sftp: - runs-on: ubuntu-latest - steps: - - name: Checkout the repository - uses: actions/checkout@v2 - - - name: Upload files via SFTP - uses: https://github.com/wangyucode/sftp-upload-action@v2.0.2 - with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USER }} - password: ${{ secrets.PASSWORD }} - forceUpload: false - localDir: '.' - remoteDir: '/var/www/crss' - exclude: '.*,.git*,.gitea*,LICENSE,README.md' - - - name: Install dependencies over SSH - uses: https://github.com/nekiro/ssh-job@main - with: - host: ${{ secrets.HOST }} - user: ${{ secrets.USER }} - password: ${{ secrets.PASSWORD }} - command: | - cd /var/www/crss - composer install --no-dev --optimize-autoloader \ No newline at end of file diff --git a/.gitignore b/.gitignore index 8249bd8..b2226ea 100644 --- a/.gitignore +++ b/.gitignore @@ -100,4 +100,8 @@ fabric.properties !.idea/codeStyles !.idea/runConfigurations -# End of https://www.toptal.com/developers/gitignore/api/phpstorm+all,composer,dotenv \ No newline at end of file +# End of https://www.toptal.com/developers/gitignore/api/phpstorm+all,composer,dotenv + +.build.json +style.css* +style.min.css* \ No newline at end of file diff --git a/.scripts/deploy.php b/.scripts/deploy.php new file mode 100644 index 0000000..202ddd5 --- /dev/null +++ b/.scripts/deploy.php @@ -0,0 +1,49 @@ + Array( + 'main' => str_replace('/.scripts/deploy.php', '', __FILE__), + 'css' => str_replace('/.scripts/deploy.php', '', __FILE__) . '/css', + 'js' => str_replace('/.scripts/deploy.php', '', __FILE__) . '/js' + ) + ); + + require_once '_config.php'; + + // "Compile" SCSS + exec("sass {$_CONFIG['paths']['css']}/src/style.scss:{$_CONFIG['paths']['css']}/style.min.css --style compressed", $sassOutput); + + // Get Git Data + exec('git rev-parse --abbrev-ref HEAD', $gitBranch); + exec('git rev-parse HEAD', $gitCommitSha); + exec('git show -s --format=%ct', $gitCommitTime); + + // Write the contents to the file build file + file_put_contents('.build.json', json_encode([ + 'build' => [ + 'time' => date('c'), + 'id' => $buildId + ], + 'git' => [ + 'branch' => $gitBranch[0], + 'commit' => [ + 'sha' => $gitCommitSha[0], + 'created' => date('c', $gitCommitTime[0]) + ] + ] + ])); + + echo implode(PHP_EOL, $sassOutput) . PHP_EOL; + + echo '`git rev-parse --abbrev-ref HEAD`: ' . implode(PHP_EOL, $gitBranch) . PHP_EOL; + echo '`git rev-parse HEAD`: ' . implode(PHP_EOL, $gitCommitSha) . PHP_EOL; + echo '`git show -s --format=%ct`: ' . implode(PHP_EOL, $gitCommitTime) . PHP_EOL; + + echo PHP_EOL . "Deployment completed with build id: `$buildId`!" . PHP_EOL; + + exit(0); \ No newline at end of file diff --git a/_config.php b/_config.php index 0e0fde4..4bbae16 100644 --- a/_config.php +++ b/_config.php @@ -1,32 +1,18 @@ load(); $loader = new FilesystemLoader('template'); - $twig = new Twig\Environment($loader); - - $twig->addGlobal('discord_auth', $_ENV['DISCORD_OAUTH']); - - $discord = new Discord( - $_ENV['DISCORD_CLIENT'], - $_ENV['DISCORD_SECRET'], - $_ENV['DISCORD_REDIRECT'] - ); - - $mysql = new Database( - $_ENV['MYSQL_HOST'], - $_ENV['MYSQL_USER'], - $_ENV['MYSQL_PASS'], - $_ENV['MYSQL_DB'] - ); \ No newline at end of file + $twig = new Environment($loader); \ No newline at end of file diff --git a/auth.php b/auth.php deleted file mode 100644 index 892b809..0000000 --- a/auth.php +++ /dev/null @@ -1,49 +0,0 @@ -validateCode($_GET['code']); - - if(!$res['error']) { - $_SESSION['access_token'] = $res['access_token']; - $_SESSION['refresh_token'] = $res['refresh_token']; - $_SESSION['expires_in'] = $res['expires_in']; - - $guilds = $discord->getGuilds($res['access_token']); - - $guildIds = array(); - - foreach ($guilds as $guild) { - $guildIds[] = $guild['id']; - } - - if(!in_array('1127731341283307520', $guildIds) || !in_array('1195393418151596032', $guildIds)) { - echo json_encode(array( - 'error' => true, - 'error_description' => 'You are not in any of CRSS\'s guilds.' - )); - } else { - $_SESSION['user'] = $discord->getUser($res['access_token']); - - $mysql->createUserRecord($_SESSION['user']); - - - if (isset($_GET['state'])) { - header('Location: ' . $_GET['state']); - } else { - header('Location: /'); - } - } - } else { - echo json_encode($res); - } - } else { - echo json_encode(array( - 'error' => true, - 'error_description' => 'No code provided.' - )); - } \ No newline at end of file diff --git a/composer.json b/composer.json index e061b41..8d3c924 100644 --- a/composer.json +++ b/composer.json @@ -1,8 +1,11 @@ { - "require": { - "twig/twig": "^3.0", - "anlutro/curl": "^1.5", - "vlucas/phpdotenv": "^5.5", - "bramus/router": "1.6" - } + "require": { + "twig/twig": "^3.9", + "anlutro/curl": "^1.5", + "vlucas/phpdotenv": "^5.6", + "bramus/router": "^1.6", + "tedivm/jshrink": "^1.7", + "simple-icons/simple-icons": "^12.2", + "theclashfruit/lucide-static-php": "^0.390.0" + } } diff --git a/composer.lock b/composer.lock index 26ee4c8..d304708 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "37fb0f4a910e4ba4add92cd9abbdf84a", + "content-hash": "a76a73e4e249ed4a4f8f065d207b4037", "packages": [ { "name": "anlutro/curl", @@ -52,16 +52,16 @@ }, { "name": "bramus/router", - "version": "1.6", + "version": "1.6.1", "source": { "type": "git", "url": "https://github.com/bramus/router.git", - "reference": "d2cf97d5c471e272ac5a2a88b652bc75089c8ae3" + "reference": "55657b76da8a0a509250fb55b9dd24e1aa237eba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bramus/router/zipball/d2cf97d5c471e272ac5a2a88b652bc75089c8ae3", - "reference": "d2cf97d5c471e272ac5a2a88b652bc75089c8ae3", + "url": "https://api.github.com/repos/bramus/router/zipball/55657b76da8a0a509250fb55b9dd24e1aa237eba", + "reference": "55657b76da8a0a509250fb55b9dd24e1aa237eba", "shasum": "" }, "require": { @@ -97,30 +97,30 @@ ], "support": { "issues": "https://github.com/bramus/router/issues", - "source": "https://github.com/bramus/router/tree/1.6" + "source": "https://github.com/bramus/router/tree/1.6.1" }, - "time": "2021-07-23T09:48:14+00:00" + "time": "2021-11-18T19:24:07+00:00" }, { "name": "graham-campbell/result-type", - "version": "v1.1.1", + "version": "v1.1.2", "source": { "type": "git", "url": "https://github.com/GrahamCampbell/Result-Type.git", - "reference": "672eff8cf1d6fe1ef09ca0f89c4b287d6a3eb831" + "reference": "fbd48bce38f73f8a4ec8583362e732e4095e5862" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/672eff8cf1d6fe1ef09ca0f89c4b287d6a3eb831", - "reference": "672eff8cf1d6fe1ef09ca0f89c4b287d6a3eb831", + "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/fbd48bce38f73f8a4ec8583362e732e4095e5862", + "reference": "fbd48bce38f73f8a4ec8583362e732e4095e5862", "shasum": "" }, "require": { "php": "^7.2.5 || ^8.0", - "phpoption/phpoption": "^1.9.1" + "phpoption/phpoption": "^1.9.2" }, "require-dev": { - "phpunit/phpunit": "^8.5.32 || ^9.6.3 || ^10.0.12" + "phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2" }, "type": "library", "autoload": { @@ -149,7 +149,7 @@ ], "support": { "issues": "https://github.com/GrahamCampbell/Result-Type/issues", - "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.1" + "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.2" }, "funding": [ { @@ -161,20 +161,20 @@ "type": "tidelift" } ], - "time": "2023-02-25T20:23:15+00:00" + "time": "2023-11-12T22:16:48+00:00" }, { "name": "phpoption/phpoption", - "version": "1.9.1", + "version": "1.9.2", "source": { "type": "git", "url": "https://github.com/schmittjoh/php-option.git", - "reference": "dd3a383e599f49777d8b628dadbb90cae435b87e" + "reference": "80735db690fe4fc5c76dfa7f9b770634285fa820" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/dd3a383e599f49777d8b628dadbb90cae435b87e", - "reference": "dd3a383e599f49777d8b628dadbb90cae435b87e", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/80735db690fe4fc5c76dfa7f9b770634285fa820", + "reference": "80735db690fe4fc5c76dfa7f9b770634285fa820", "shasum": "" }, "require": { @@ -182,7 +182,7 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "phpunit/phpunit": "^8.5.32 || ^9.6.3 || ^10.0.12" + "phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2" }, "type": "library", "extra": { @@ -224,7 +224,7 @@ ], "support": { "issues": "https://github.com/schmittjoh/php-option/issues", - "source": "https://github.com/schmittjoh/php-option/tree/1.9.1" + "source": "https://github.com/schmittjoh/php-option/tree/1.9.2" }, "funding": [ { @@ -236,20 +236,125 @@ "type": "tidelift" } ], - "time": "2023-02-25T19:38:58+00:00" + "time": "2023-11-12T21:59:55+00:00" }, { - "name": "symfony/polyfill-ctype", - "version": "v1.28.0", + "name": "simple-icons/simple-icons", + "version": "12.2.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" + "url": "https://github.com/simple-icons/simple-icons.git", + "reference": "45b0840f6a15e4912c61a9415dcb85f4bb583f23" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "url": "https://api.github.com/repos/simple-icons/simple-icons/zipball/45b0840f6a15e4912c61a9415dcb85f4bb583f23", + "reference": "45b0840f6a15e4912c61a9415dcb85f4bb583f23", + "shasum": "" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "CC0-1.0" + ], + "description": "SVG icons for popular brands", + "homepage": "https://simpleicons.org/", + "keywords": [ + "icons", + "svg" + ], + "support": { + "docs": "https://github.com/simple-icons/simple-icons#php-usage-", + "issues": "https://github.com/simple-icons/simple-icons/issues", + "source": "https://github.com/simple-icons/simple-icons" + }, + "funding": [ + { + "url": "https://opencollective.com/simple-icons", + "type": "opencollective" + } + ], + "time": "2024-06-09T06:49:44+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:32:20+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", "shasum": "" }, "require": { @@ -263,9 +368,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -302,7 +404,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" }, "funding": [ { @@ -318,20 +420,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "42292d99c55abe617799667f454222c54c60e229" + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", - "reference": "42292d99c55abe617799667f454222c54c60e229", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", "shasum": "" }, "require": { @@ -345,9 +447,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -385,7 +484,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" }, "funding": [ { @@ -401,20 +500,20 @@ "type": "tidelift" } ], - "time": "2023-07-28T09:04:16+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", "shasum": "" }, "require": { @@ -422,9 +521,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -468,7 +564,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" }, "funding": [ { @@ -484,33 +580,132 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { - "name": "twig/twig", - "version": "v3.7.1", + "name": "tedivm/jshrink", + "version": "v1.7.0", "source": { "type": "git", - "url": "https://github.com/twigphp/Twig.git", - "reference": "a0ce373a0ca3bf6c64b9e3e2124aca502ba39554" + "url": "https://github.com/tedious/JShrink.git", + "reference": "7a35f5a4651ca2ce77295eb8a3b4e133ba47e19e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/a0ce373a0ca3bf6c64b9e3e2124aca502ba39554", - "reference": "a0ce373a0ca3bf6c64b9e3e2124aca502ba39554", + "url": "https://api.github.com/repos/tedious/JShrink/zipball/7a35f5a4651ca2ce77295eb8a3b4e133ba47e19e", + "reference": "7a35f5a4651ca2ce77295eb8a3b4e133ba47e19e", + "shasum": "" + }, + "require": { + "php": "^7.0|^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.14", + "php-coveralls/php-coveralls": "^2.5.0", + "phpunit/phpunit": "^9|^10" + }, + "type": "library", + "autoload": { + "psr-0": { + "JShrink": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Robert Hafner", + "email": "tedivm@tedivm.com" + } + ], + "description": "Javascript Minifier built in PHP", + "homepage": "http://github.com/tedious/JShrink", + "keywords": [ + "javascript", + "minifier" + ], + "support": { + "issues": "https://github.com/tedious/JShrink/issues", + "source": "https://github.com/tedious/JShrink/tree/v1.7.0" + }, + "funding": [ + { + "url": "https://github.com/tedivm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/tedivm/jshrink", + "type": "tidelift" + } + ], + "time": "2023-10-04T17:23:23+00:00" + }, + { + "name": "theclashfruit/lucide-static-php", + "version": "0.390.0", + "source": { + "type": "git", + "url": "https://github.com/TheClashFruit/lucide-static-php.git", + "reference": "2b6e1f1fd054afdbb8931d493422e93c04315dde" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/TheClashFruit/lucide-static-php/zipball/2b6e1f1fd054afdbb8931d493422e93c04315dde", + "reference": "2b6e1f1fd054afdbb8931d493422e93c04315dde", + "shasum": "" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "TheClashFruit", + "email": "admin@theclashfruit.me" + } + ], + "support": { + "issues": "https://github.com/TheClashFruit/lucide-static-php/issues", + "source": "https://github.com/TheClashFruit/lucide-static-php/tree/0.390.0" + }, + "time": "2024-06-09T10:46:54+00:00" + }, + { + "name": "twig/twig", + "version": "v3.10.3", + "source": { + "type": "git", + "url": "https://github.com/twigphp/Twig.git", + "reference": "67f29781ffafa520b0bbfbd8384674b42db04572" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/67f29781ffafa520b0bbfbd8384674b42db04572", + "reference": "67f29781ffafa520b0bbfbd8384674b42db04572", "shasum": "" }, "require": { "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-mbstring": "^1.3" + "symfony/polyfill-mbstring": "^1.3", + "symfony/polyfill-php80": "^1.22" }, "require-dev": { "psr/container": "^1.0|^2.0", - "symfony/phpunit-bridge": "^5.4.9|^6.3" + "symfony/phpunit-bridge": "^5.4.9|^6.4|^7.0" }, "type": "library", "autoload": { + "files": [ + "src/Resources/core.php", + "src/Resources/debug.php", + "src/Resources/escaper.php", + "src/Resources/string_loader.php" + ], "psr-4": { "Twig\\": "src/" } @@ -543,7 +738,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.7.1" + "source": "https://github.com/twigphp/Twig/tree/v3.10.3" }, "funding": [ { @@ -555,35 +750,35 @@ "type": "tidelift" } ], - "time": "2023-08-28T11:09:02+00:00" + "time": "2024-05-16T10:04:27+00:00" }, { "name": "vlucas/phpdotenv", - "version": "v5.5.0", + "version": "v5.6.0", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7" + "reference": "2cf9fb6054c2bb1d59d1f3817706ecdb9d2934c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7", - "reference": "1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/2cf9fb6054c2bb1d59d1f3817706ecdb9d2934c4", + "reference": "2cf9fb6054c2bb1d59d1f3817706ecdb9d2934c4", "shasum": "" }, "require": { "ext-pcre": "*", - "graham-campbell/result-type": "^1.0.2", - "php": "^7.1.3 || ^8.0", - "phpoption/phpoption": "^1.8", - "symfony/polyfill-ctype": "^1.23", - "symfony/polyfill-mbstring": "^1.23.1", - "symfony/polyfill-php80": "^1.23.1" + "graham-campbell/result-type": "^1.1.2", + "php": "^7.2.5 || ^8.0", + "phpoption/phpoption": "^1.9.2", + "symfony/polyfill-ctype": "^1.24", + "symfony/polyfill-mbstring": "^1.24", + "symfony/polyfill-php80": "^1.24" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", + "bamarni/composer-bin-plugin": "^1.8.2", "ext-filter": "*", - "phpunit/phpunit": "^7.5.20 || ^8.5.30 || ^9.5.25" + "phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2" }, "suggest": { "ext-filter": "Required to use the boolean validator." @@ -595,7 +790,7 @@ "forward-command": true }, "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "autoload": { @@ -627,7 +822,7 @@ ], "support": { "issues": "https://github.com/vlucas/phpdotenv/issues", - "source": "https://github.com/vlucas/phpdotenv/tree/v5.5.0" + "source": "https://github.com/vlucas/phpdotenv/tree/v5.6.0" }, "funding": [ { @@ -639,7 +834,7 @@ "type": "tidelift" } ], - "time": "2022-10-16T01:01:54+00:00" + "time": "2023-11-12T22:43:29+00:00" } ], "packages-dev": [], diff --git a/css/map.min.css b/css/map.min.css deleted file mode 100644 index f5371ec..0000000 --- a/css/map.min.css +++ /dev/null @@ -1 +0,0 @@ -*{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,img.leaflet-marker-icon{image-rendering:pixelated}.leaflet-control{color:#333}.leaflet-control-mouseposition{background:rgba(255,255,255,.8);margin:0 !important;padding:6px;width:100%;text-align:end;border-top-left-radius:5px}.leaflet-marker-icon{transition:300ms}/*# sourceMappingURL=map.min.css.map */ diff --git a/css/map.min.css.map b/css/map.min.css.map deleted file mode 100644 index 23db633..0000000 --- a/css/map.min.css.map +++ /dev/null @@ -1 +0,0 @@ -{"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,yCACE,0BAGF,iBACE,WAGF,+BACE,gCAEA,oBACA,YAEA,WAEA,eAEA,2BAGF,qBACE","file":"map.min.css"} \ No newline at end of file diff --git a/css/src/_colors.scss b/css/src/_colors.scss new file mode 100644 index 0000000..b75bb63 --- /dev/null +++ b/css/src/_colors.scss @@ -0,0 +1,27 @@ +$colorPrimary: hsl(120, 21%, 41%); + +$colorTextLight1: hsl(120, 40%, 8%); +$colorTextLight2: hsl(120, 5%, 45%); + +$colorSurfaceLight1: hsl(120, 25%, 97%); +$colorSurfaceLight2: hsl(120, 20%, 95%); +$colorSurfaceLight3: hsl(120, 20%, 92%); +$colorSurfaceLight4: hsl(120, 20%, 85%); + +$colorBorderLight1: hsl(120, 20%, 80%); +$colorBorderLight2: hsl(120, 20%, 70%); +$colorBorderLight3: hsl(120, 20%, 60%); +$colorBorderLight4: hsl(120, 20%, 50%); + +$colorTextDark1: hsl(120, 15%, 85%); +$colorTextDark2: hsl(120, 5%, 65%); + +$colorSurfaceDark1: hsl(120, 5%, 10%); +$colorSurfaceDark2: hsl(120, 10%, 15%); +$colorSurfaceDark3: hsl(120, 5%, 20%); +$colorSurfaceDark4: hsl(120, 5%, 25%); + +$colorBorderDark1: hsl(120, 5%, 30%); +$colorBorderDark2: hsl(120, 5%, 40%); +$colorBorderDark3: hsl(120, 5%, 50%); +$colorBorderDark4: hsl(120, 5%, 60%); \ No newline at end of file diff --git a/css/src/_fonts.scss b/css/src/_fonts.scss index 827435f..0ffc986 100644 --- a/css/src/_fonts.scss +++ b/css/src/_fonts.scss @@ -1,18 +1,49 @@ -// @import url('https://fonts.googleapis.com/css2?family=Noto+Color+Emoji&family=Noto+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Outfit:wght@100;200;300;400;500;600;700;800;900&display=swap'); - -@import url('https://fonts.googleapis.com/css2?family=Comic+Neue:wght@700&family=Noto+Sans:ital,wght@0,400;0,700;1,400;1,700&family=Outfit:wght@400;500;700&display=swap'); +@import url('https://fonts.googleapis.com/css2?family=Comic+Neue:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&family=Noto+Color+Emoji&family=Noto+Emoji:wght@300..700&family=Noto+Sans+Mono:wght@100..900&family=Noto+Sans:ital,wght@0,100..900;1,100..900&family=Outfit:wght@100..900&display=swap'); body, input { - font-family: "Noto Sans", "Noto Color Emoji", sans-serif; + font-family: 'Noto Sans', 'Noto Color Emoji', 'Noto Emoji', sans-serif; } +code, pre, kbd { + font-family: 'Noto Sans Mono', 'Noto Color Emoji', 'Noto Emoji', sans-serif; +} + +$headers: ( + h1: 1.95rem, + h2: 1.5rem, + h3: 160%, + h4: 140%, + h5: 120%, + h6: 110% +); + h1, h2, h3, h4, h5, h6 { - font-family: "Outfit", "Noto Color Emoji", sans-serif; + font-family: 'Outfit', 'Noto Color Emoji', 'Noto Color Emoji', 'Noto Emoji', sans-serif; + font-weight: 500; - //margin-bottom: 6px; + + line-height: 1.7; } -.pageHero { - font-family: "Comic Neue", "Comic Sans MS", "Noto Color Emoji", sans-serif; - //margin-bottom: 6px; +@each $tag, $size in $headers { + #{$tag} { + font-size: $size; + + margin-bottom: 1rem; + } } + +p, ol, ul, label, a { + font-size: 1rem; + line-height: 1.7; +} + +p, ol, ul { + margin-bottom: 1rem; +} + +/* +.pageHero { + font-family: 'Comic Neue', 'Comic Sans MS', 'Noto Color Emoji', 'Noto Emoji', sans-serif; +} +*/ \ No newline at end of file diff --git a/css/src/colors/_dark.scss b/css/src/colors/_dark.scss deleted file mode 100644 index fb6b2eb..0000000 --- a/css/src/colors/_dark.scss +++ /dev/null @@ -1,28 +0,0 @@ -// Dark Theme - -$pageBG: #202120; -$pageFG: white; - -$accent: #527D52; -$linkColor: #d0dfd0; - -$btnNormalBG: $accent; -$btnNormalFG: white; -$btnActiveBG: $accent; -$btnActiveFG: white; - -$navBG: #272f27; -$navBorder: #575f57; - -$cardNormalBG: #272727; -$cardNormalFG: $pageFG; -$cardNormalBorder: #575757; -$cardActiveBG: $navBG; -$cardActiveFG: $linkColor; -$cardActiveBorder: $navBorder; - -$navLinkOutlineColor: #707f70; -$navLinkNormalColor: #7E9E7E; -$navLinkActiveColor: #DEFEDE; - -$headerOverlay: #101610; \ No newline at end of file diff --git a/css/src/colors/_light.scss b/css/src/colors/_light.scss deleted file mode 100644 index 230ea6c..0000000 --- a/css/src/colors/_light.scss +++ /dev/null @@ -1,32 +0,0 @@ -// Light Theme - -$pageBG: white; -$pageFG: black; - -$accent: #527D52; -$linkColor: $accent; - -$btnNormalBG: $accent; -$btnNormalFG: white; -$btnActiveBG: $accent; -$btnActiveFG: white; - -$navBG: #f9fff9; -$navBorder: #d0dfd0; - -$cardNormalBG: #f9f9f9; -$cardNormalFG: $pageFG; -$cardNormalBorder: #d0d0d0; -$cardActiveBG: $navBG; -$cardActiveFG: $linkColor; -$cardActiveBorder: $navBorder; - -/*$cardBG: $navBG; -$cardFG: $pageFG; -$cardBorder: $navBorder;*/ - -$navLinkOutlineColor: #D0DFD0; -$navLinkNormalColor: #7E9E7E; -$navLinkActiveColor: $accent; - -$headerOverlay: white; \ No newline at end of file diff --git a/css/src/map.scss b/css/src/map.scss deleted file mode 100644 index b5807b6..0000000 --- a/css/src/map.scss +++ /dev/null @@ -1,52 +0,0 @@ -* { - 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, img.leaflet-marker-icon { - image-rendering: pixelated; -} - -.leaflet-control { - color: #333; -} - -.leaflet-control-mouseposition { - background: rgba(255, 255, 255, 0.8); - - margin: 0 !important; - padding: 6px; - - width: 100%; - - text-align: end; - - border-top-left-radius: 5px; -} - -.leaflet-marker-icon { - transition: 300ms; -} \ No newline at end of file diff --git a/css/src/style.scss b/css/src/style.scss index c265bde..091ef09 100644 --- a/css/src/style.scss +++ b/css/src/style.scss @@ -1,457 +1,569 @@ -@use "fonts"; -@use "colors/light" as light; -@use "colors/dark" as dark; +@import 'fonts'; +@import 'colors'; * { - -webkit-tap-highlight-color: transparent; // fuck you (L) -} - -html, -body { - overflow-x: hidden; -} - -body { + padding: 0; margin: 0; - background: light.$pageBG; - color: light.$pageFG; + box-sizing: border-box; + + scrollbar-color: $colorPrimary $colorSurfaceLight1; @media (prefers-color-scheme: dark) { - background: dark.$pageBG; - color: dark.$pageFG; + scrollbar-color: $colorPrimary $colorSurfaceDark1; + } + + transition: + 300ms color, + 300ms background, + 300ms border; +} + +body { + background: $colorSurfaceLight1; + color: $colorTextLight1; + + @media (prefers-color-scheme: dark) { + background: $colorSurfaceDark1; + color: $colorTextDark1; } } main { - transition: 0.24s; - - &.buffering { - transform: scale(1.01); - transition: 0.16s; - opacity: 0.4; - pointer-events: none; - user-select: none; - } - - &.transition { - transform: scale(0.96); - transition: 0.16s; - opacity: 0; - } -} - -.container { - max-width: 960px; - - width: 100%; - - margin: 0 auto; - - padding: 24px; - box-sizing: border-box; -} - -ul, -ol { - list-style-position: inside; -} - -p { - line-height: 1.6; - opacity: 0.88; -} - -img { - max-width: 100%; -} - -.cards { - display: flex; - flex-wrap: wrap; - gap: 8px; - width: 100%; - - @media (max-width: 600px) { - gap: 12px; - } -} - -.card { - position: relative; - display: flex; - flex-direction: column; - box-sizing: border-box; - max-width: 100%; - height: 150px; - text-decoration: none; - border-radius: 4px; - padding: 8px 12px; - cursor: pointer; - overflow: hidden; - - outline: 1px solid light.$cardNormalBorder; - background: light.$cardNormalBG; - color: light.$cardNormalFG; - - @media (prefers-color-scheme: dark) { - outline-color: dark.$cardNormalBorder; - background: dark.$cardNormalBG; - color: dark.$cardNormalFG; - } - - transition: 0.24s; - - &:hover { - outline-width: 2px; - outline-color: light.$cardActiveBorder; - background: light.$cardActiveBG; - color: light.$cardActiveFG; - - @media (prefers-color-scheme: dark) { - outline-color: dark.$cardActiveBorder; - background: dark.$cardActiveBG; - color: dark.$cardActiveFG; - } - - transition: 0.08s; - - .icon { - transition: 0.48s; - transform: scale(1.2); - } - } - - width: calc(100% / 3 - 6px); - - @media (max-width: 800px) { - width: calc(50% - 4px); - } - - @media (max-width: 600px) { - border-radius: 8px; - width: 100%; - } - - h1 { - margin: 0; - font-size: 1.2em; - font-weight: 400; - } - - .icon { - position: absolute; - top: 0; - right: 0; - height: 100%; - aspect-ratio: 1/1; - object-fit: cover; - - mask-image: linear-gradient(to right, transparent, rgba(red, 0.3)); - - @media (prefers-color-scheme: dark) { - mask-image: linear-gradient(to right, transparent, rgba(red, 0.1)); - } - - transition: 0.64s; - } - - p { - margin: 8px 0; - } + padding: 1.5rem 0; } a { - color: light.$linkColor; + color: $colorPrimary; - @media (prefers-color-scheme: dark) { - color: dark.$linkColor; + text-decoration: none; + + &:hover { + text-decoration: underline; } +} - &:visited { - opacity: 0.9; +button { + cursor: pointer; +} + +ol, ul { + list-style-position: inside; + + margin-left: 1rem; +} + +.container { + max-width: 1100px; + + margin: 0 auto; + + @media (max-width: 1100px) { + margin: 0 1rem; } } .pageHero { - background-image: linear-gradient(rgba(light.$headerOverlay, 0.9), rgba(light.$headerOverlay, 0.9)), // white overlay. yeah that's a bit of an ugly hack? - url('/img/Panorama-Lens-Blur.png'); - - @media (prefers-color-scheme: dark) { - background-image: linear-gradient(rgba(dark.$headerOverlay, 0.9), rgba(dark.$headerOverlay, 0.9)), - url('/img/Panorama-Lens-Blur.png'); - } - - background-position: center; - background-size: cover; - height: 220px; - >.container { + background-image: url("https://crss.fra1.cdn.digitaloceanspaces.com/img/2024-06-08_14.19.52.png"); + + background-size: cover; + background-repeat: no-repeat; + background-position: center; + + font-family: 'Comic Neue', 'Comic Sans MS', 'Noto Color Emoji', 'Noto Emoji', sans-serif; + font-weight: 600; + + > .heroOverlay { + background: rgba($colorSurfaceLight2, 0.9); + + backdrop-filter: blur(8px); + height: 100%; + width: 100%; - display: flex; - flex-direction: row; + > .container { + height: 100%; - align-items: center; - justify-content: space-between; - - @media (max-width: 600px) { - justify-content: center; - } - - >div { display: flex; - flex-direction: column; - gap: 12px; + align-items: center; + justify-content: space-between; - &.Branding { - align-items: flex-start; + > div:first-child { + display: flex; - @media (max-width: 600px) { + flex-direction: column; + + gap: 0.5rem; + + > h1 { + font-family: 'Comic Neue', 'Comic Sans MS', 'Noto Color Emoji', 'Noto Emoji', sans-serif; + font-weight: 600; + font-size: 1.5rem; + + margin: 0; + } + + @media (max-width: 768px) { align-items: center; - } + justify-content: center; - @media (prefers-color-scheme: dark) { - img { - filter: invert(1) - } - } - - span { - font-size: 24px; - opacity: 0.75; + width: 100%; + height: 100%; } } - &.Server-Information { - @media (max-width: 600px) { - display: none; - } + > div:last-child { + display: flex; + + flex-direction: column; align-items: center; - gap: 4px; - input { + gap: 0.5rem; + + > input { + background: rgba(0,0,0,0); + + width: fit-content; + + padding: 4px 16px; + + font-size: 1.5rem; + text-align: center; - font-size: 24px; - &:not(:hover, :focus) { - color: inherit; - border-color: transparent; - background: transparent; + color: inherit; + + border: 1px solid rgba(0, 0, 0, 0); + border-radius: 1rem; + + transition: 150ms; + + &:focus, &:hover { + outline: none; + + background: rgba($colorSurfaceLight4, .65); + + border: 1px solid $colorBorderLight3; } - } - } - } - } -} - -.navToggle { - @media (min-width: 601px) { - display: none; - } - - z-index: 10; - - position: fixed; - top: 8px; - right: 8px; - font-size: 18px; - - background: light.$btnNormalBG; - color: light.$btnNormalFG; - - @media (prefers-color-scheme: dark) { - background: dark.$btnNormalBG; - color: dark.$btnNormalFG; - } - - padding: 8px 24px; - - border-radius: 32px; - - font-weight: bold; - user-select: none; - - cursor: pointer; -} - -.pageNav { - width: 100%; - - border: solid light.$navBorder; - border-width: 0 0 1px 0; - - background: light.$navBG; - - @media (prefers-color-scheme: dark) { - border-color: dark.$navBorder; - background: dark.$navBG; - } - - >.container { - padding: 16px 24px; - - display: flex; - flex-wrap: wrap; - - align-items: center; - justify-content: space-between; - - @media (max-width: 600px) { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - z-index: 9; - - backdrop-filter: blur(15px); - background: rgba(light.$navBG, 0.86); - - @media (prefers-color-scheme: dark) { - background: rgba(dark.$navBG, 0.9); - } - - justify-content: center; - flex-direction: column; - gap: 64px; - - &, - >* { - transition: 0.16s - } - - &:not(.opened) { - opacity: 0; - pointer-events: none; - - //&, > * { transition: 0.12s } - >* { - transform: translateX(32px); - } - } - } - - >div { - margin: 0; - - display: flex; - flex-wrap: wrap; - align-items: flex-end; - - gap: 6px; - - @media (max-width: 600px) { - width: 100%; - flex-direction: column; - } - - >a { - font-family: Outfit; - user-select: none; - - font-size: 16px; - box-sizing: border-box; - color: light.$navLinkNormalColor; - - @media (prefers-color-scheme: dark) { - color: dark.$navLinkNormalColor; - } - - @media (max-width: 600px) { - font-size: 28px; - outline: none; - padding: 8px 32px; - text-align: end; - - &.active::before { - content: "➤"; // i know.. - } - } - - - text-decoration: none; - - padding: 6px 20px; - - border-radius: 32px; - - outline: solid transparent 2px; - - transition: 0.24s; - - &.active { - pointer-events: none; - } - - &:hover, - &.active { - //background: rgba(15, 23, 42, 0.1); - color: light.$navLinkActiveColor; - outline-color: light.$navLinkOutlineColor; @media (prefers-color-scheme: dark) { - color: dark.$navLinkActiveColor; - outline-color: dark.$navLinkOutlineColor; + color: inherit; + + &:focus, &:hover { + background: rgba($colorSurfaceDark4, .65); + + border: 1px solid $colorBorderDark3; + } } - - - transition: 0.08s; } - @media (min-width: 601px) { - &.buttonPrimary { - background: light.$btnNormalBG; - color: light.$btnNormalFG; + @media (max-width: 768px) { + display: none; + } + } + } - @media (prefers-color-scheme: dark) { - background: dark.$btnNormalBG; - color: dark.$btnNormalFG; + @media (prefers-color-scheme: dark) { + background: rgba($colorSurfaceDark2, 0.9); + } + } + + @media (max-width: 768px) { + border-bottom: 1px solid $colorBorderLight1; + + @media (prefers-color-scheme: dark) { + border-color: $colorBorderDark1; + } + } +} + +.navBar { + height: 64px; + + position: sticky; + + top: 0; + + left: 0; + right: 0; + + background: $colorSurfaceLight3; + + border-bottom: 1px solid $colorBorderLight1; + + > .container { + display: flex; + + justify-content: space-between; + align-items: center; + + height: 100%; + + @media (max-width: 768px) { + justify-content: space-between; + } + + > .navMobileContainer { + display: none; + + width: 100%; + height: 100%; + + justify-content: end; + align-items: center; + + z-index: 10000; + + > .navToggle { + padding: 0.5rem; + + background: none; + + border: none; + border-radius: 50%; + + display: flex; + + color: $colorTextLight1; + + transition: 150ms; + + &:hover { + background: rgba($colorPrimary, 0.5); + } + + @media (prefers-color-scheme: dark) { + color: $colorTextDark1; + } + } + + @media (max-width: 768px) { + display: flex; + } + } + + > .navCollapse { + display: flex; + + justify-content: space-between; + align-items: center; + + height: 100%; + width: 100%; + + z-index: 5000; + + > ul { + list-style: none; + + display: flex; + + align-items: center; + gap: .5rem; + + margin: 0; + + > li { + > a, .dropDown > label { + padding: 8px 16px; + + display: flex; + + flex-direction: row; + + align-items: center; + gap: 1rem; + + text-decoration: none; + + transition: 150ms; + + border-radius: 2rem; + + color: $colorTextLight2; + + outline: 2px solid rgba(0, 0, 0, 0); + + > .icon { + width: 20px; + height: 20px; } - font-weight: 700 !important; + &:hover, &.active { + outline: 2px solid rgba($colorPrimary, 0.65); + + color: $colorPrimary; + } + + @media (prefers-color-scheme: dark) { + color: $colorTextDark2; + + &:hover, &.active { + outline-color: rgba($colorPrimary, 0.65); + } + } } } } + + @media (max-width: 768px) { + opacity: 1; + + transition: 300ms; + + position: fixed; + + height: 100vh; + width: 100vw; + + top: 0; + right: -110%; + + display: flex; + + flex: 1; + flex-direction: column; + + align-items: end; + justify-content: center; + + gap: 2rem; + + padding: 1rem; + + background: rgba($colorSurfaceLight3, 0.95); + backdrop-filter: blur(8px); + + ul { + flex-direction: column; + + align-items: end; + + gap: 1rem; + + li { + a { + padding: 8px 24px; + } + } + } + + @media (prefers-color-scheme: dark) { + background: rgba($colorSurfaceDark3, 0.95); + } + } + } + } + + @media (prefers-color-scheme: dark) { + background: $colorSurfaceDark3; + + border-color: $colorBorderDark1; + } + + &.navOpen { + > .container { + flex-direction: column; + + > .navMobileContainer { + height: 64px; + } + + > .navCollapse { + opacity: 1; + + right: 0; + } + } + } + + @media (max-width: 768px) { + background: none; + + position: fixed; + + top: 0; + + border: none; + } +} + +.dropDown { + position: relative; + + > label { + display: flex; + + align-items: center; + gap: 8px; + + cursor: pointer; + + padding: 8px 24px; + } + + > .dropDownMenu { + position: absolute; + + top: calc(100% + 4px); + right: 0; + + background: $colorSurfaceLight4; + + border: 1px solid $colorBorderLight1; + border-radius: .5rem; + + overflow: hidden; + + display: none; + + min-width: max(100%, 200px); + + > ul { + list-style: none; + + display: flex; + + flex-direction: column; + + margin: 0; + + > li { + > a { + padding: 11px 24px; + + display: flex; + + flex-direction: row; + + align-items: center; + gap: 24px; + + text-decoration: none; + + transition: 150ms; + + > .icon { + width: 20px; + height: 20px; + } + + &:hover { + background: rgba($colorPrimary, 0.65); + + color: $colorSurfaceLight1; + } + } + + > .divider { + border-bottom: 1px solid $colorBorderLight1; + + width: 100%; + + @media (prefers-color-scheme: dark) { + border-color: $colorBorderDark1; + } + } + } + } + + @media (prefers-color-scheme: dark) { + border-color: $colorBorderDark1; + background: $colorSurfaceDark4; + } + } + + &.open { + > label { + outline: 2px solid rgba($colorPrimary, 0.65); + + color: $colorPrimary; + } + + > .dropDownMenu { + display: block; } } } .pageContent { - // + } - .pageFooter { - opacity: 0.8; + background: $colorSurfaceLight3; - >.SNS-Links { + border-top: 1px solid $colorBorderLight1; + + > .container { display: flex; - flex-wrap: wrap; - gap: 16px; - >a { - display: flex; - gap: 8px; + justify-content: space-between; - font-size: 18px; + align-items: start; - color: inherit; + padding: 1rem 0; - img { - width: 1em; + p { + margin-bottom: .5rem; + } - @media (prefers-color-scheme: dark) { - filter: invert(1); + div:first-child { + width: 420px; + } + + div:last-child { + text-align: right; + + > ul { + display: flex; + + gap: 1rem; + + list-style: none; + + > li { + > a { + display: flex; + + align-items: center; + justify-content: center; + + width: 31px; + height: 31px; + + border-radius: 50%; + + padding: 4px; + + transition: 150ms; + + color: $colorTextLight1; + + &:hover { + color: $colorTextLight2; + } + + @media (prefers-color-scheme: dark) { + color: $colorTextDark1; + + &:hover { + color: $colorTextDark2; + } + } + } } } - - &:not(:hover, :focus) { - text-decoration: none; - } } } + + @media (prefers-color-scheme: dark) { + background: $colorSurfaceDark3; + + border-color: $colorBorderDark1; + } } \ No newline at end of file diff --git a/css/style.min.css b/css/style.min.css deleted file mode 100644 index 7fa88ff..0000000 --- a/css/style.min.css +++ /dev/null @@ -1 +0,0 @@ -@import"https://fonts.googleapis.com/css2?family=Comic+Neue:wght@700&family=Noto+Sans:ital,wght@0,400;0,700;1,400;1,700&family=Outfit:wght@400;500;700&display=swap";body,input{font-family:"Noto Sans","Noto Color Emoji",sans-serif}h1,h2,h3,h4,h5,h6{font-family:"Outfit","Noto Color Emoji",sans-serif;font-weight:500}.pageHero{font-family:"Comic Neue","Comic Sans MS","Noto Color Emoji",sans-serif}*{-webkit-tap-highlight-color:rgba(0,0,0,0)}html,body{overflow-x:hidden}body{margin:0;background:#fff;color:#000}@media(prefers-color-scheme: dark){body{background:#202120;color:#fff}}main{transition:.24s}main.buffering{transform:scale(1.01);transition:.16s;opacity:.4;pointer-events:none;user-select:none}main.transition{transform:scale(0.96);transition:.16s;opacity:0}.container{max-width:960px;width:100%;margin:0 auto;padding:24px;box-sizing:border-box}ul,ol{list-style-position:inside}p{line-height:1.6;opacity:.88}img{max-width:100%}.cards{display:flex;flex-wrap:wrap;gap:8px;width:100%}@media(max-width: 600px){.cards{gap:12px}}.card{position:relative;display:flex;flex-direction:column;box-sizing:border-box;max-width:100%;height:150px;text-decoration:none;border-radius:4px;padding:8px 12px;cursor:pointer;overflow:hidden;outline:1px solid #d0d0d0;background:#f9f9f9;color:#000;transition:.24s;width:calc(33.3333333333% - 6px)}@media(prefers-color-scheme: dark){.card{outline-color:#575757;background:#272727;color:#fff}}.card:hover{outline-width:2px;outline-color:#d0dfd0;background:#f9fff9;color:#527d52;transition:.08s}@media(prefers-color-scheme: dark){.card:hover{outline-color:#575f57;background:#272f27;color:#d0dfd0}}.card:hover .icon{transition:.48s;transform:scale(1.2)}@media(max-width: 800px){.card{width:calc(50% - 4px)}}@media(max-width: 600px){.card{border-radius:8px;width:100%}}.card h1{margin:0;font-size:1.2em;font-weight:400}.card .icon{position:absolute;top:0;right:0;height:100%;aspect-ratio:1/1;object-fit:cover;mask-image:linear-gradient(to right, transparent, rgba(255, 0, 0, 0.3));transition:.64s}@media(prefers-color-scheme: dark){.card .icon{mask-image:linear-gradient(to right, transparent, rgba(255, 0, 0, 0.1))}}.card p{margin:8px 0}a{color:#527d52}@media(prefers-color-scheme: dark){a{color:#d0dfd0}}a:visited{opacity:.9}.pageHero{background-image:linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9)),url("/img/Panorama-Lens-Blur.png");background-position:center;background-size:cover;height:220px}@media(prefers-color-scheme: dark){.pageHero{background-image:linear-gradient(rgba(16, 22, 16, 0.9), rgba(16, 22, 16, 0.9)),url("/img/Panorama-Lens-Blur.png")}}.pageHero>.container{height:100%;display:flex;flex-direction:row;align-items:center;justify-content:space-between}@media(max-width: 600px){.pageHero>.container{justify-content:center}}.pageHero>.container>div{display:flex;flex-direction:column;gap:12px}.pageHero>.container>div.Branding{align-items:flex-start}@media(max-width: 600px){.pageHero>.container>div.Branding{align-items:center}}@media(prefers-color-scheme: dark){.pageHero>.container>div.Branding img{filter:invert(1)}}.pageHero>.container>div.Branding span{font-size:24px;opacity:.75}.pageHero>.container>div.Server-Information{align-items:center;gap:4px}@media(max-width: 600px){.pageHero>.container>div.Server-Information{display:none}}.pageHero>.container>div.Server-Information input{text-align:center;font-size:24px}.pageHero>.container>div.Server-Information input:not(:hover,:focus){color:inherit;border-color:rgba(0,0,0,0);background:rgba(0,0,0,0)}.navToggle{z-index:10;position:fixed;top:8px;right:8px;font-size:18px;background:#527d52;color:#fff;padding:8px 24px;border-radius:32px;font-weight:bold;user-select:none;cursor:pointer}@media(min-width: 601px){.navToggle{display:none}}@media(prefers-color-scheme: dark){.navToggle{background:#527d52;color:#fff}}.pageNav{width:100%;border:solid #d0dfd0;border-width:0 0 1px 0;background:#f9fff9}@media(prefers-color-scheme: dark){.pageNav{border-color:#575f57;background:#272f27}}.pageNav>.container{padding:16px 24px;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between}@media(max-width: 600px){.pageNav>.container{position:fixed;top:0;left:0;width:100%;height:100%;z-index:9;backdrop-filter:blur(15px);background:rgba(249,255,249,.86);justify-content:center;flex-direction:column;gap:64px}}@media(max-width: 600px)and (prefers-color-scheme: dark){.pageNav>.container{background:rgba(39,47,39,.9)}}@media(max-width: 600px){.pageNav>.container,.pageNav>.container>*{transition:.16s}.pageNav>.container:not(.opened){opacity:0;pointer-events:none}.pageNav>.container:not(.opened)>*{transform:translateX(32px)}}.pageNav>.container>div{margin:0;display:flex;flex-wrap:wrap;align-items:flex-end;gap:6px}@media(max-width: 600px){.pageNav>.container>div{width:100%;flex-direction:column}}.pageNav>.container>div>a{font-family:Outfit;user-select:none;font-size:16px;box-sizing:border-box;color:#7e9e7e;text-decoration:none;padding:6px 20px;border-radius:32px;outline:solid rgba(0,0,0,0) 2px;transition:.24s}@media(prefers-color-scheme: dark){.pageNav>.container>div>a{color:#7e9e7e}}@media(max-width: 600px){.pageNav>.container>div>a{font-size:28px;outline:none;padding:8px 32px;text-align:end}.pageNav>.container>div>a.active::before{content:"➤"}}.pageNav>.container>div>a.active{pointer-events:none}.pageNav>.container>div>a:hover,.pageNav>.container>div>a.active{color:#527d52;outline-color:#d0dfd0;transition:.08s}@media(prefers-color-scheme: dark){.pageNav>.container>div>a:hover,.pageNav>.container>div>a.active{color:#defede;outline-color:#707f70}}@media(min-width: 601px){.pageNav>.container>div>a.buttonPrimary{background:#527d52;color:#fff;font-weight:700 !important}}@media(min-width: 601px)and (prefers-color-scheme: dark){.pageNav>.container>div>a.buttonPrimary{background:#527d52;color:#fff}}.pageFooter{opacity:.8}.pageFooter>.SNS-Links{display:flex;flex-wrap:wrap;gap:16px}.pageFooter>.SNS-Links>a{display:flex;gap:8px;font-size:18px;color:inherit}.pageFooter>.SNS-Links>a img{width:1em}@media(prefers-color-scheme: dark){.pageFooter>.SNS-Links>a img{filter:invert(1)}}.pageFooter>.SNS-Links>a:not(:hover,:focus){text-decoration:none}/*# sourceMappingURL=style.min.css.map */ diff --git a/css/style.min.css.map b/css/style.min.css.map deleted file mode 100644 index 0f72c97..0000000 --- a/css/style.min.css.map +++ /dev/null @@ -1 +0,0 @@ -{"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,EACE,0CAGF,UACE,kBAGF,KACE,SAEA,WCbO,KDcP,MCbO,KDeP,mCANF,KAOI,WEjBK,QFkBL,MEjBK,MFqBT,KACE,gBAEA,eACE,sBACA,gBACA,WACA,oBACA,iBAGF,gBACE,sBACA,gBACA,UAIJ,WACE,gBAEA,WAEA,cAEA,aACA,sBAGF,MACE,2BAGF,EACE,gBACA,YAGF,IACE,eAGF,OACE,aACA,eACA,QACA,WAEA,yBANF,OAOI,UAIJ,MACE,kBACA,aACA,sBACA,sBACA,eACA,aACA,qBACA,kBACA,iBACA,eACA,gBAEA,0BACA,WC3Ea,QD4Eb,MCzFO,KDiGP,gBAsBA,iCA5BA,mCAjBF,MAkBI,cE7Ee,QF8Ef,WEhFW,QFiFX,ME9FK,MFmGP,YACE,kBACA,cC1FQ,QD2FR,WC5FI,QD6FJ,MCrGK,QD6GL,gBANA,mCANF,YAOI,cE/FM,QFgGN,WEjGE,QFkGF,MEzGM,SF8GR,kBACE,gBACA,qBAMJ,yBA/CF,MAgDI,uBAGF,yBAnDF,MAoDI,kBACA,YAGF,SACE,SACA,gBACA,gBAGF,YACE,kBACA,MACA,QACA,YACA,iBACA,iBAEA,wEAKA,gBAJA,mCATF,YAUI,yEAMJ,QACE,aAIJ,EACE,MC5JO,QD8JP,mCAHF,EAII,ME9JQ,SFiKV,UACE,WAIJ,UACE,wHAQA,2BACA,sBAEA,aARA,mCAJF,UAKI,mHASF,qBACE,YAEA,aACA,mBAEA,mBACA,8BAEA,yBATF,qBAUI,wBAGF,yBACE,aACA,sBAEA,SAEA,kCACE,uBAEA,yBAHF,kCAII,oBAGF,mCACE,sCACE,kBAIJ,uCACE,eACA,YAIJ,4CAKE,mBACA,QALA,yBADF,4CAEI,cAMF,kDACE,kBACA,eAEA,qEACE,cACA,2BACA,yBAQZ,WAIE,WAEA,eACA,QACA,UACA,eAEA,WC7PO,QD8PP,MC1PY,KDiQZ,iBAEA,mBAEA,iBACA,iBAEA,eAzBA,yBADF,WAEI,cAYF,mCAdF,WAeI,WEjQK,QFkQL,ME9PU,MF2Qd,SACE,WAEA,qBACA,uBAEA,WC7QM,QD+QN,mCARF,SASI,aE/QQ,QFgRR,WEjRI,SFoRN,oBACE,kBAEA,aACA,eAEA,mBACA,8BAEA,yBATF,oBAUI,eACA,MACA,OACA,WACA,YACA,UAEA,2BACA,iCAKA,uBACA,sBACA,UANA,yDAnBJ,oBAoBM,8BAXJ,yBAkBE,0CACE,gBAGF,iCACE,UACA,oBAGA,mCACE,4BAKN,wBACE,SAEA,aACA,eACA,qBAEA,QAEA,yBATF,wBAUI,WACA,uBAGF,0BACE,mBACA,iBAEA,eACA,sBACA,MCnUa,QDoVb,qBAEA,iBAEA,mBAEA,gCAEA,gBAxBA,mCAPF,0BAQI,MEzUW,SF4Ub,yBAXF,0BAYI,eACA,aACA,iBACA,eAEA,yCACE,aAeJ,iCACE,oBAGF,iEAEE,MC3XD,QD4XC,cCtWY,QD8WZ,gBANA,mCALF,iEAMI,ME3WS,QF4WT,cE9WU,SFqXd,yBACE,wCACE,WCzYH,QD0YG,MCtYE,KD6YF,4BALA,yDAJF,wCAKI,WE7YL,QF8YK,ME1YA,MFyZd,YACE,WAEA,uBACE,aACA,eACA,SAEA,yBACE,aACA,QAEA,eAEA,cAEA,6BACE,UAEA,mCAHF,6BAII,kBAIJ,4CACE","file":"style.min.css"} \ No newline at end of file diff --git a/fiveserver.config.js b/fiveserver.config.js deleted file mode 100644 index 2d7f846..0000000 --- a/fiveserver.config.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - php: "/usr/bin/php" -} diff --git a/icons/logo.svg b/icons/logo.svg new file mode 100644 index 0000000..ed501fb --- /dev/null +++ b/icons/logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/img/CRSS-Logo.svg b/img/CRSS-Logo.svg deleted file mode 100644 index f5e8c1c..0000000 --- a/img/CRSS-Logo.svg +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/img/Discord.svg b/img/Discord.svg deleted file mode 100644 index f9fd918..0000000 --- a/img/Discord.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/img/Mastodon.svg b/img/Mastodon.svg deleted file mode 100644 index e03938c..0000000 --- a/img/Mastodon.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/img/Panorama-Lens-Blur.png b/img/Panorama-Lens-Blur.png deleted file mode 100644 index a5d7d06..0000000 Binary files a/img/Panorama-Lens-Blur.png and /dev/null differ diff --git a/img/Youtube.svg b/img/Youtube.svg deleted file mode 100644 index a07f31a..0000000 --- a/img/Youtube.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/img/icon.png b/img/icon.png deleted file mode 100644 index 941fd9a..0000000 Binary files a/img/icon.png and /dev/null differ diff --git a/img/social_image.png b/img/social_image.png deleted file mode 100644 index 921abd2..0000000 Binary files a/img/social_image.png and /dev/null differ diff --git a/img/spawn.jpg b/img/spawn.jpg deleted file mode 100644 index 2abf939..0000000 Binary files a/img/spawn.jpg and /dev/null differ diff --git a/img/spawn/2023-09-15_17.51.17.png b/img/spawn/2023-09-15_17.51.17.png deleted file mode 100644 index c9ff76a..0000000 Binary files a/img/spawn/2023-09-15_17.51.17.png and /dev/null differ diff --git a/img/spawn/2023-11-18_12.50.56.png b/img/spawn/2023-11-18_12.50.56.png deleted file mode 100644 index 3df6bcb..0000000 Binary files a/img/spawn/2023-11-18_12.50.56.png and /dev/null differ diff --git a/img/tobedone.png b/img/tobedone.png deleted file mode 100644 index a2f66d9..0000000 Binary files a/img/tobedone.png and /dev/null differ diff --git a/index.php b/index.php index ef69c6e..b65dd48 100644 --- a/index.php +++ b/index.php @@ -1,301 +1,84 @@ 86400, + ]); - $nations = array( + $buildData = json_decode(file_get_contents('.build.json')); - 'psf' => array( - 'name' => 'Panorama Socialist Federation', - 'flag' => 'https://raw.theclashfruit.me/CRSS/CRSS/main/Nations/Republic%20of%20Panorama/Flag.svg', - 'short' => 'psf', - 'short_description' => 'The first nation, prev. known as ROP.', - 'description' => 'The first nation on CRSS, previously known as ROP.', - 'leader' => 'iforgotaname', - 'leader_term' => 'Prime Minister', - ), - 'cnk' => array( - 'name' => 'Chunkia', - 'flag' => 'https://raw.theclashfruit.me/CRSS/CRSS/main/Nations/Chunkia/Chunkia.svg', - '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.', - 'leader' => 'WorldWidePixel', - 'leader_term' => 'Leader', - ), - '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.svg', - '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.', - 'leader' => 'Lupancham', - 'leader_term' => 'Chancellor', - ), - '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.', - 'leader' => 'TheClashFruit', - 'leader_term' => 'Leader', - ), - 'rfm' => array( - 'name' => 'Romanian Federation of Minecraft', - 'flag' => 'https://raw.theclashfruit.me/CRSS/CRSS/main/Nations/Romanian%20Federation%20of%20Minecraft/FMC%20flag.svg', - 'short' => 'rfm', - 'short_description' => 'Helping modernise CRSS', - 'description' => 'RFM is a nation helping in the modernisation of CRSS, not only by practices but by livelihood.', - 'leader' => 'polycord', - 'leader_term' => 'President', - ), - 'tcg' => array( - 'name' => 'Toasteric Colony of Grapetopia', - 'flag' => 'https://raw.theclashfruit.me/CRSS/CRSS/main/Nations/Grapetopia/TCG.svg', - 'short' => 'tcg', - 'short_description' => 'A colony of TTK, ~10K blocks out of 0,0', - 'description' => 'This is a colony of TTK, an island with an area of ~382m², located at ~7.5k X and -2.8k Z', - 'leader' => 'MrLagSwitcha', - 'leader_term' => 'Leader in charge', - ), - ); + $iconsFun = new TwigFunction('icon', function($icon, $attributes = []) { + $iconName = str_replace('/', '', $icon); - $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.' - ) - ); - - if(isset($_SESSION['user'])) { - $dbUser = $mysql->getUserRecordFromId($_SESSION['user']['id']); + if (str_starts_with($iconName, 'simpleicons')) { + $iconName = str_replace('simpleicons.', '', $iconName); - $user = $_SESSION['user']; + $iconData = file_get_contents("./vendor/simple-icons/simple-icons/icons/$iconName.svg"); + } else if (str_starts_with($iconName, 'lucide')) { + $iconName = str_replace('lucide.', '', $iconName); - $user['is_admin'] = $dbUser['is_admin']; + $iconData = file_get_contents("./vendor/theclashfruit/lucide-static-php/icons/$iconName.svg"); + } else { + $iconName = str_replace('.', '/', $iconName); - $twig->addGlobal('user', $user); - } + $iconData = file_get_contents("./icons/$iconName.svg"); + } - $res = $curl->get('https://crss.blurryface.xyz/api/v1/players'); + foreach ($attributes as $key => $value) { + if ($key == 'class') { + $iconData = preg_replace('/(class="\b[^"]*)"/i', '$1 ' . $value . '"', $iconData); - $json = json_decode($res->body, true); + $dom = new DOMDocument("1.0"); + $dom->preserveWhiteSpace = false; + $dom->formatOutput = false; + $dom->loadXML($iconData); - if($json != null) - $twig->addGlobal('playerCount', count($json)); - else - $twig->addGlobal('playerCount', $json); + $iconData = $dom->saveHTML(); + $iconData = preg_replace('/(/i', '', $iconData); + $iconData = preg_replace('/\n/', ' ', $iconData); + } else { + $iconData = preg_replace('/(<]*)>/i', '$1 ' . $key . '="' . $value . '">', $iconData); + } + } - $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'])); + return $iconData; + }); - $twig->addGlobal('reduced', isset($_GET['reduced'])); + $twig->addFunction($iconsFun); + + $twig->addGlobal('git', $buildData->git); + + $twig->addGlobal('server', [ + 'version' => '1.11.2', + ]); + + $twig->addGlobal('user', [ + 'name' => 'John Doe' + ]); $router->get('/', function() { global $twig; - $twig->addGlobal('pageUri', '/'); - - echo $twig->render('index.twig'); + echo $twig->render('index.twig', [ + 'page' => [ + 'title' => 'Home', + 'path' => '/', + ] + ]); }); - $router->get('/nations', function() { - global $twig; - - $twig->addGlobal('pageUri', '/nations'); - - echo $twig->render('nations.twig'); + $router->get('/helloworld', function() { + echo ''; + echo '

Hello World!!

'; }); - $router->get('/companies', function() { - global $twig; - - $twig->addGlobal('pageUri', '/companies'); - - echo $twig->render('companies.twig'); - }); - - $router->get('/gallery', function() { - global $twig; - - $twig->addGlobal('pageUri', '/gallery'); - - echo $twig->render('gallery.twig'); - }); - - $router->get('/map', function() { - global $twig, $mysql; - - $twig->addGlobal('pageUri', '/map'); - $twig->addGlobal('markers', json_encode($mysql->getMarkers())); - - if(isset($_GET['center'])) - $twig->addGlobal('center', $_GET['center']); - else - $twig->addGlobal('center', '0;0'); - - echo $twig->render('map.twig'); - }); - - $router->get('/profile', function() { - global $twig, $mysql; - - $twig->addGlobal('pageUri', '/profile'); - - if (isset($_SESSION['user'])) { - $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('profile.twig', array('db_data' => $user)); - } - } else { - http_response_code(404); - - echo $twig->render('404.twig'); - } - }); - - $router->get('/nation/([a-z]+)', function ($nation) { - global $twig, $mysql, $nations; - - $twig->addGlobal('pageUri', '/nation/' . $nation); - - if(!$nations[$nation]) { - http_response_code(404); - - echo $twig->render('404.twig'); - } else { - echo $twig->render('nation.twig', array('nation' => $nations[$nation])); - } - }); - - $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('company.twig', array('company' => $companies[$company])); - } - }); - - - $router->get('/u/([a-z0-9_\.]+)', function($name) { - global $twig, $mysql, $discord; - - $twig->addGlobal('pageUri', '/u/' . $name); - - $user = $mysql->getUserRecordFromUsername($name); - - if($user == null) { - http_response_code(404); - - echo $twig->render('404.twig'); - } else { - echo $twig->render('user.twig', array('db_user' => $user)); - } - }); - - // ---------------- Admin ---------------- // - - $router->get('/admin', function() { - global $twig, $mysql; - - $twig->addGlobal('pageUri', '/admin'); - - if (isset($_SESSION['user'])) { - $user = $mysql->getUserRecordFromId($_SESSION['user']['id']); - - $users = $mysql->getUsers(); - $markers = $mysql->getMarkers(); - - if ($user == null && $user['admin'] == 0) { - http_response_code(401); - - echo '401 Unauthorized'; - } else { - echo $twig->render('admin/index.twig', array('users' => $users, 'markers' => $markers)); - } - } else { - http_response_code(401); - - echo '401 Unauthorized'; - } - }); - - $router->get('/admin/__data/page/([a-z]+)', function($page) { - global $twig, $mysql; - - if (isset($_SESSION['user'])) { - $user = $mysql->getUserRecordFromId($_SESSION['user']['id']); - - $users = $mysql->getUsers(); - $markers = $mysql->getMarkers(); - - if ($user == null && $user['admin'] == 0) { - http_response_code(401); - - echo '401 Unauthorized'; - } else { - try { - echo $twig->render('admin/pages/' . urlencode($page) . '.twig', array('users' => $users, 'markers' => $markers)); - } catch (Exception $e) { - http_response_code(404); - - echo $twig->render('admin/pages/404.twig'); - } - } - } else { - http_response_code(401); - - echo '401 Unauthorized'; - } - }); - - // ---------------- Admin API ---------------- // - - $adminApi = new Admin($router); - - $adminApi->registerApiRoutes(); - - // ----------------- 404 ----------------- // - - $router->set404(function() { - global $twig; - - $twig->addGlobal('pageUri', '404'); - - http_response_code(404); - - echo $twig->render('404.twig'); - }); - - $router->run(); + $router->run(); \ No newline at end of file diff --git a/js/admin/nav.js b/js/admin/nav.js deleted file mode 100644 index 9ddebc4..0000000 --- a/js/admin/nav.js +++ /dev/null @@ -1,50 +0,0 @@ -const pageContainer = document.querySelector('.pageContainer'); - -window.history.pushState({}, '', '#/'); - -window.addEventListener('hashchange', () => { - let uri = window.location.href.split('#')[1]; - - if (!window.location.href.includes('#')) - uri = '/admin#/' - - const allActiveLinks = document.querySelectorAll('.nav a.active'); - const allLinksWithThisUrl = document.querySelectorAll(`.nav a[href="#${uri}"]`); - - allActiveLinks.forEach(activeLink => { - activeLink.classList.remove('active'); - activeLink.classList.add('link-body-emphasis'); - }); - - allLinksWithThisUrl.forEach(link => { - link.classList.add('active'); - link.classList.remove('link-body-emphasis'); - }); - - changePage(window.location.href.split('#')[1].replace('/', '')); -}); - -const changePage = (url) => { - if (!url) - url = 'dashboard'; - - pageContainer.innerHTML = ``; - - pageContainer.classList.add('d-flex'); - pageContainer.classList.add('align-items-center'); - pageContainer.classList.add('justify-content-center'); - - lucide.createIcons(); - - fetch(`/admin/__data/page/${url}`) - .then(res => res.text()) - .then(html => { - pageContainer.innerHTML = html; - - pageContainer.classList.remove('d-flex'); - pageContainer.classList.remove('align-items-center'); - pageContainer.classList.remove('justify-content-center'); - - lucide.createIcons(); - }); -}; \ No newline at end of file diff --git a/js/main.js b/js/main.js index 19ab844..a31e0db 100644 --- a/js/main.js +++ b/js/main.js @@ -1,13 +1,24 @@ -import { enableTransition } from "/js/trans.js"; +const $ = _ => document.querySelector(_); +const $$ = _ => document.querySelectorAll(_); -function enableLinks() { - document.querySelectorAll(".transitionEnabled").forEach( hyperlinkElement => { - enableTransition(hyperlinkElement); - hyperlinkElement.classList.remove("transitionEnabled"); - }); -} +const dropDowns = $$('.dropDown'); -enableLinks(); +dropDowns.forEach(dropDown => { + dropDown.children[0].addEventListener('click', () => { + dropDown.classList.toggle('open'); + }); +}); -window.addEventListener("transitionEnd", enableLinks); +// ------------ // +const navBar = $('.navBar'); +const navToggle = $('.navToggle'); +const navCollapse = $('.navCollapse'); + +navToggle.addEventListener('click', () => { + navBar.classList.toggle('navOpen'); + + navToggle.innerHTML = navBar.classList.contains('navOpen') ? + '' : + ''; +}); \ No newline at end of file diff --git a/js/map.js b/js/map.js deleted file mode 100644 index 172e6f0..0000000 --- a/js/map.js +++ /dev/null @@ -1,176 +0,0 @@ -L.TileLayer.CRSSLayer = L.TileLayer.extend({ - getTileUrl: function(coordinate) { - const tileX = coordinate.x; - const tileY = coordinate.y; - - const tileZ = coordinate.z; - - const url = ('https://cdn-new.theclashfruit.me/crss/tiles/zoom.{z}/{xd}/{yd}/tile.{x}.{y}.png') - .replace('{yd}', Math.floor(tileY / 10)) - .replace('{xd}', Math.floor(tileX / 10)) - .replace('{y}', tileY) - .replace('{x}', tileX) - .replace('{z}', tileZ); - - return url; - } -}); - -L.tileLayer.crssLayer = function(templateUrl, options) { - return new L.TileLayer.CRSSLayer(templateUrl, options); -} - -let mapLayer = L.tileLayer.crssLayer('https://cdn-new.theclashfruit.me/crss/tiles/zoom.{z}/{xd}/{yd}/tile.{x}.{y}.png', { - attribution: '© CRSS Players | Tiles With uNmINeD.', - - tileSize: 256, - - noWrap: true, - - maxNativeZoom: 0, - minNativeZoom: -4, - - minZoom: -4, - maxZoom: -4 + 8, - - zoomOffset: -8 -}); - -let ropMarkers = L.layerGroup([]); - -let drrMarkers = L.layerGroup([]); - -let miscMarkers = L.layerGroup([]); - -markers.forEach(marker => { - const coords = marker.data.split(';'); - - switch (marker.category) { - case 'rop': - ropMarkers - .addLayer( - L.marker([ - parseFloat(coords[0]), parseFloat(coords[1]) - ]).bindPopup(marker.name) - ); - break; - case 'drr': - drrMarkers.addLayer( - L.marker([ - parseFloat(coords[0]), parseFloat(coords[1]) - ]).bindPopup(marker.name) - ); - break; - default: - miscMarkers.addLayer( - L.marker([ - parseFloat(coords[0]), parseFloat(coords[1]) - ]).bindPopup(marker.name) - ); - break; - } -}); - -let playerMarkers = L.layerGroup([ - -]); - -console.log(L.CRS.Simple.infinite) - -let map = L.map('map', { - layers: [ - mapLayer, - - miscMarkers, - - ropMarkers, - drrMarkers, - - playerMarkers - ], - preferCanvas: true, - crs: L.Util.extend(L.CRS.Simple, { - transformation: new L.Transformation(1, 0, 1, 0), - projection: L.Projection.LonLat - }), -}).setView([ - parseFloat(center.split(';')[1]), - parseFloat(center.split(';')[0]) -], 2); - -let baseMaps = { - "Overworld": mapLayer -}; - -let overlayMaps = { - "Players": playerMarkers, - "Miscellaneous Markers": miscMarkers, - "Markers in RoP": ropMarkers, - "Markers in DRR": drrMarkers, -}; - -let layerControl = L.control.layers(baseMaps, overlayMaps).addTo(map); - -L.control.mousePosition({ - position: 'bottomright', - separator: '; ', - lngFormatter: (x) => { - return Math.floor(x) - }, - latFormatter: (y) => { - return Math.floor(y) - }, - wrapLng: false, - lngFirst: true -}).addTo(map); - -const mappedPlayers = {} - -const updatePlayerPos = (players) =>{ - for (const player of players) { - const playerMarker = mappedPlayers[player.uniqueId]; - - if(playerMarker) { - playerMarker.setLatLng([player.location.z, player.location.x]); - playerMarker.setPopupContent(`${player.displayName} (${Math.floor(player.location.x)}; ${Math.floor(player.location.y)}; ${Math.floor(player.location.z)})`); - - mappedPlayers[player.uniqueId] = playerMarker; - } else { - const playerIcon = L.icon({ - iconUrl: `https://mc-heads.net/avatar/${player.displayName}/16`, - iconSize: [28, 28], - iconAnchor: [14, 14], - popupAnchor: [0, -14] - }); - - const marker = L.marker([player.location.z, player.location.x], { icon: playerIcon, alt: player.displayName }) - .bindPopup(`${player.displayName} (${Math.floor(player.location.x)}; ${Math.floor(player.location.y)}; ${Math.floor(player.location.z)})`); - - playerMarkers.addLayer(marker); - - mappedPlayers[player.uniqueId] = marker; - } - } - - for (const [uniqueId, playerMarker] of Object.entries(mappedPlayers)) { - if(!players.find(p => p.uniqueId === uniqueId)) { - playerMarkers.removeLayer(playerMarker); - - delete mappedPlayers[uniqueId]; - } - } -} - -fetch('https://crss.blurryface.xyz/api/v1/players') - .then(r => r.json()) - .then(p => { - updatePlayerPos(p); - }); - -setInterval(() => { - fetch('https://crss.blurryface.xyz/api/v1/players') - .then(r => r.json()) - .then(p => { - updatePlayerPos(p); - }); -}, 1000); \ No newline at end of file diff --git a/js/nav.js b/js/nav.js deleted file mode 100644 index 05171c4..0000000 --- a/js/nav.js +++ /dev/null @@ -1,18 +0,0 @@ -const $ = selector => document.querySelector(selector); - -const navToggle = $(".navToggle"); -const menu = $(".pageNav > .container"); - -navToggle.onclick = () => { - const menuToggled = menu.classList.contains("opened"); - - if (menuToggled) { - menu.classList.remove("opened"); - } else { - menu.classList.add("opened"); - } - - navToggle.innerHTML = menuToggled ? "Menu" : "Close"; -} - -window.addEventListener("transitionBuffering", () => menu.classList.remove("opened")); \ No newline at end of file diff --git a/js/trans.js b/js/trans.js deleted file mode 100644 index edf0ece..0000000 --- a/js/trans.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Myadeleines' Simple Page Transition Script. "Trans" for short. :trol: - * Making CSS-powered animated transitions between pages possible. - * - * Licensed under the Apache License. Please refer to the LICENSE file. - */ - -const transitionBufferingEvent = new Event("transitionBuffering"); -const transitionStartEvent = new Event("transitionStart"); -const transitionEndEvent = new Event("transitionEnd"); -const $ = selector => document.querySelector(selector); -const parser = new DOMParser(); -const mainElement = $("main"); - -export function enableTransition( hyperlinkElement ) { - hyperlinkElement.addEventListener("click", event => { - event.preventDefault(); // Browser won't load the page when the hyperlink is pressed. - - loadURL(hyperlinkElement.href, true, hyperlinkElement); - }); -} - -function loadURL( targetedURL, updateURL, hyperlinkElement ) { - const activeHyperlink = $(".pageNav .active"); - - mainElement.classList.add("buffering"); - window.dispatchEvent(transitionBufferingEvent); - - fetch(targetedURL + "?reduced") - .catch(error => { - console.log(error); - alert(error); - mainElement.classList.remove("buffering"); - }) - .then(response => response.text().then( fetchedPage => { - fetchedPage = parser.parseFromString(fetchedPage, "text/html"); - fetchedPage = { - content: fetchedPage.querySelector("main").innerHTML, - title: fetchedPage.querySelector("title").innerHTML, - } - - if (activeHyperlink) activeHyperlink.classList.remove("active"); - if (hyperlinkElement) hyperlinkElement.classList.add("active"); - - if (updateURL) history.pushState({}, fetchedPage.title, targetedURL); - $("title").innerHTML = fetchedPage.title; - - mainElement.classList.remove("buffering"); - mainElement.classList.add("transition"); - - let transitionDuration = getComputedStyle(mainElement).transitionDuration; - transitionDuration = parseFloat(transitionDuration) * 1000; - - window.dispatchEvent(transitionStartEvent); - - setTimeout(() => { - mainElement.innerHTML = fetchedPage.content; - mainElement.classList.remove("transition"); - window.dispatchEvent(transitionEndEvent); - }, transitionDuration); - })); -} - -window.addEventListener("popstate", Event => { - loadURL(window.location.href, false) -}); \ No newline at end of file diff --git a/template/404.twig b/template/404.twig deleted file mode 100644 index d38671c..0000000 --- a/template/404.twig +++ /dev/null @@ -1,16 +0,0 @@ -{% include 'includes/head.twig' with {'pageTitle': '404'} %} - -{% include 'includes/hero.twig' %} - -{% include 'includes/nav.twig' with {'page': '404',} %} - -
-

Not found! :<

-

- This page is nowhere to be found!
- Go on Discord and complain about it to Clash or Mya!! -

-
- -{% include 'includes/footer.twig' %} -{% include 'includes/foot.twig' %} \ No newline at end of file diff --git a/template/admin/includes/foot.twig b/template/admin/includes/foot.twig deleted file mode 100644 index d1e0e0b..0000000 --- a/template/admin/includes/foot.twig +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/template/admin/includes/head.twig b/template/admin/includes/head.twig deleted file mode 100644 index 1887f87..0000000 --- a/template/admin/includes/head.twig +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - {{ pageTitle }} - Admin • Clyde's Real Survival SMP - - - - - - \ No newline at end of file diff --git a/template/admin/includes/sidebar.twig b/template/admin/includes/sidebar.twig deleted file mode 100644 index 51b1aa8..0000000 --- a/template/admin/includes/sidebar.twig +++ /dev/null @@ -1,52 +0,0 @@ -
- - - Admin Panel - -
- -
- -
\ No newline at end of file diff --git a/template/admin/index.twig b/template/admin/index.twig deleted file mode 100644 index 45458e0..0000000 --- a/template/admin/index.twig +++ /dev/null @@ -1,11 +0,0 @@ -{% include 'admin/includes/head.twig' with {'pageTitle': 'Dashboard'} %} - -
- {% include 'admin/includes/sidebar.twig' %} - -
- -
-
- -{% include 'admin/includes/foot.twig' %} \ No newline at end of file diff --git a/template/admin/pages/404.twig b/template/admin/pages/404.twig deleted file mode 100644 index 634dcd9..0000000 --- a/template/admin/pages/404.twig +++ /dev/null @@ -1,3 +0,0 @@ -
-

Not Found :(

-
\ No newline at end of file diff --git a/template/admin/pages/dashboard.twig b/template/admin/pages/dashboard.twig deleted file mode 100644 index 6083eeb..0000000 --- a/template/admin/pages/dashboard.twig +++ /dev/null @@ -1,3 +0,0 @@ -
-

Welcome {{ user.global_name }} to the admin panel!

-
\ No newline at end of file diff --git a/template/admin/pages/markers.twig b/template/admin/pages/markers.twig deleted file mode 100644 index 18ce19d..0000000 --- a/template/admin/pages/markers.twig +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - {% for marker in markers %} - - - - - - - - {% endfor %} - -
idnamecategorydataactions
{{ marker.id }}{{ marker.name }}{{ marker.category }}{{ marker.data }} - -
\ No newline at end of file diff --git a/template/admin/pages/pages.twig b/template/admin/pages/pages.twig deleted file mode 100644 index 5c9227a..0000000 --- a/template/admin/pages/pages.twig +++ /dev/null @@ -1 +0,0 @@ -pages \ No newline at end of file diff --git a/template/admin/pages/users.twig b/template/admin/pages/users.twig deleted file mode 100644 index 810f5f6..0000000 --- a/template/admin/pages/users.twig +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - {% for user in users %} - - - - - - - - - {% endfor %} - -
idusernamedisplay_nameis_admindateactions
{{ user.id }}{{ user.username }}{{ user.display_name }}{{ user.is_admin == 1 ? "true" : "false" }}{{ user.date }} - {% if user.is_admin == 1 %} - - {% else %} - - {% endif %} -
\ No newline at end of file diff --git a/template/companies.twig b/template/companies.twig deleted file mode 100644 index 8410a9e..0000000 --- a/template/companies.twig +++ /dev/null @@ -1,22 +0,0 @@ -{% include 'includes/head.twig' with {'pageTitle': 'Companies'} %} - -{% include 'includes/hero.twig' %} - -{% include 'includes/nav.twig' with {'page': 'companies'} %} - -
-

Companies

-
- {% for company in companies %} - -

{{ company.name }}

-

{{ company.short_description }}

- -
- {% endfor %} -
- -
- -{% include 'includes/footer.twig' %} -{% include 'includes/foot.twig' %} \ No newline at end of file diff --git a/template/company.twig b/template/company.twig deleted file mode 100644 index 14fb0d1..0000000 --- a/template/company.twig +++ /dev/null @@ -1,23 +0,0 @@ -{% include 'includes/head.twig' with {'pageTitle': company.name} %} - -{% include 'includes/hero.twig' %} - -{% include 'includes/nav.twig' with {'page': 'company'} %} - -
-
-
-

{{ company.name }}

-

{{ company.short }}

-

Logo

- {{ company.name }}'s logo. -
-
-

Description

-

{{ company.description }}

-
-
-
- -{% include 'includes/footer.twig' %} -{% include 'includes/foot.twig' %} \ No newline at end of file diff --git a/template/gallery.twig b/template/gallery.twig deleted file mode 100644 index 47941d9..0000000 --- a/template/gallery.twig +++ /dev/null @@ -1,16 +0,0 @@ -{% include 'includes/head.twig' with {'pageTitle': 'Gallery'} %} - -{% include 'includes/hero.twig' %} - -{% include 'includes/nav.twig' with {'page': 'gallery',} %} - -
-

Gallery

-

- Yet to be filled. :3
- Come later! -

-
- -{% include 'includes/footer.twig' %} -{% include 'includes/foot.twig' %} \ No newline at end of file diff --git a/template/includes/foot.twig b/template/includes/foot.twig deleted file mode 100644 index 39d67a3..0000000 --- a/template/includes/foot.twig +++ /dev/null @@ -1,4 +0,0 @@ -{% if not reduced %} - - -{% endif %} \ No newline at end of file diff --git a/template/includes/footer.twig b/template/includes/footer.twig deleted file mode 100644 index 03ab078..0000000 --- a/template/includes/footer.twig +++ /dev/null @@ -1,42 +0,0 @@ -{% if not reduced %} -
- - -
- - -{% endif %} \ No newline at end of file diff --git a/template/includes/head.twig b/template/includes/head.twig deleted file mode 100644 index 3071b9e..0000000 --- a/template/includes/head.twig +++ /dev/null @@ -1,48 +0,0 @@ -{% if reduced %} - {{ pageTitle }} • Clyde's Real Survival SMP -{% else %} - - - - - - - - {{ pageTitle }} • Clyde's Real Survival SMP - - - - - - - - - - - - - - - - - - - - - - - - {% if pageUri == '/map' %} - - - - - - - {% endif %} - - - - - -{% endif %} \ No newline at end of file diff --git a/template/includes/hero.twig b/template/includes/hero.twig deleted file mode 100644 index aa50cae..0000000 --- a/template/includes/hero.twig +++ /dev/null @@ -1,20 +0,0 @@ -{% if not reduced %} -
-
- - -
- - Clyde's Real Survival SMP! -
- - -
- Server address: - - Version: 1.10.2 -
- -
-
-{% endif %} \ No newline at end of file diff --git a/template/includes/nav.twig b/template/includes/nav.twig deleted file mode 100644 index 2092ab0..0000000 --- a/template/includes/nav.twig +++ /dev/null @@ -1,41 +0,0 @@ -{% if not reduced %} - - - -{% endif %} \ No newline at end of file diff --git a/template/index.twig b/template/index.twig index 7fdc6fe..30ed550 100644 --- a/template/index.twig +++ b/template/index.twig @@ -1,48 +1,261 @@ -{% include 'includes/head.twig' with {'pageTitle': 'Home'} %} + + + + -{% include 'includes/hero.twig' %} + -{% include 'includes/nav.twig' with {'page': 'home',} %} - -
-

Welcome to Clyde's Real Survival SMP (CRSS)!

-

This is a server made by Blurryface, hosted by TheClashFruit, played by Devin, and sponsored by TheClashFruit's Real Hosting Company Limited Liability Company (TCFRHCLLC) and Pridecraft Studios!

- + Clyde's Real Survival SMP • {{ page.title }} -

Information

-
    + + + + - This is CRSS, a server hosted by Blurryface which updates every 1st of the month, ever since beta 1.0.
    - - We've been doing this for a good while, and our server has many structures and has had many players.
    - - It currently has 3 nations, PSF, DRR and CNK, each one with unique builds and terrain.
    - - We have an Youtube channel where we post some bits of our server, you can stay tuned to it to get to know more about us.
    - - The seed used in the world is the same seed the first Main Menu Panorama used, and a pack with a panorama from the area which we built over, on the original coordinates, is due to be released soon™.
    - Stay tuned to our Modrinth to download it! + + + + + + + -
+ + + + + + + + + + + +
+
+
+
+ {{ icon('logo') | raw }} -

Rules

-
    -
  1. - The usage of modified clients that gives unfair advantage to players (i.e. cheat clients) is not permitted. Even if you only use these clients for legit functions, such as FullBright, you'll still get banned. TL;DR Do not cheat.
    -
  2. -
  3. - Do not modify (or destroy) other players' constructions, or take their items, without their permission. TL;DR Do not grief or steal.
    -
  4. - -
  5. - The only exceptions to the second rule is if you're taking over something, such as a government.
    This has happened, for example, to the Panorama Socialist Federation, previously known as "Republic of Panorama".
    You're free to do any modifications to whatever, if it fits your government, and the other players approve of that take over.
    If they don't approve of it, your government may get re-taken over, and any changes may be undone by players.
    TL;DR You "can" grief if you take a government over and need to do changes
    -
- Failing to follow these rules will result in a ban. -
+

Clyde's Real Survival SMP!

+ -{% include 'includes/footer.twig' %} -{% include 'includes/foot.twig' %} \ No newline at end of file +
+ + + + + +
+ + + + + + +
+
+

Home

+ +

+ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores beatae cum dicta dolor fugit hic inventore nostrum placeat provident saepe. At est ex excepturi exercitationem iure natus nisi soluta totam voluptatem voluptatum? Adipisci aliquid consectetur corporis delectus dolores, ea eius et hic inventore nesciunt nobis recusandae repellat sed! Delectus eaque excepturi inventore numquam quaerat? Ad alias aliquid aperiam cupiditate eos esse fugit illum iure laudantium modi molestiae numquam, odit officia quae quasi, quibusdam recusandae rem repellendus sapiente sint veniam vero vitae! Blanditiis dicta maiores nemo nesciunt rerum. Accusamus dolorum, eligendi itaque laborum magni modi obcaecati, officiis pariatur perspiciatis, tenetur unde. +

+ +

+ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores beatae cum dicta dolor fugit hic inventore nostrum placeat provident saepe. At est ex excepturi exercitationem iure natus nisi soluta totam voluptatem voluptatum? Adipisci aliquid consectetur corporis delectus dolores, ea eius et hic inventore nesciunt nobis recusandae repellat sed! Delectus eaque excepturi inventore numquam quaerat? Ad alias aliquid aperiam cupiditate eos esse fugit illum iure laudantium modi molestiae numquam, odit officia quae quasi, quibusdam recusandae rem repellendus sapiente sint veniam vero vitae! Blanditiis dicta maiores nemo nesciunt rerum. Accusamus dolorum, eligendi itaque laborum magni modi obcaecati, officiis pariatur perspiciatis, tenetur unde. +

+ +

+ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores beatae cum dicta dolor fugit hic inventore nostrum placeat provident saepe. At est ex excepturi exercitationem iure natus nisi soluta totam voluptatem voluptatum? Adipisci aliquid consectetur corporis delectus dolores, ea eius et hic inventore nesciunt nobis recusandae repellat sed! Delectus eaque excepturi inventore numquam quaerat? Ad alias aliquid aperiam cupiditate eos esse fugit illum iure laudantium modi molestiae numquam, odit officia quae quasi, quibusdam recusandae rem repellendus sapiente sint veniam vero vitae! Blanditiis dicta maiores nemo nesciunt rerum. Accusamus dolorum, eligendi itaque laborum magni modi obcaecati, officiis pariatur perspiciatis, tenetur unde. +

+ +

+ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores beatae cum dicta dolor fugit hic inventore nostrum placeat provident saepe. At est ex excepturi exercitationem iure natus nisi soluta totam voluptatem voluptatum? Adipisci aliquid consectetur corporis delectus dolores, ea eius et hic inventore nesciunt nobis recusandae repellat sed! Delectus eaque excepturi inventore numquam quaerat? Ad alias aliquid aperiam cupiditate eos esse fugit illum iure laudantium modi molestiae numquam, odit officia quae quasi, quibusdam recusandae rem repellendus sapiente sint veniam vero vitae! Blanditiis dicta maiores nemo nesciunt rerum. Accusamus dolorum, eligendi itaque laborum magni modi obcaecati, officiis pariatur perspiciatis, tenetur unde. +

+ +

Rules

+ +
    +
  1. + Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nihil, sit. +
  2. +
  3. + Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nihil, sit. +
  4. +
+
+
+ + + + + + \ No newline at end of file diff --git a/template/map.twig b/template/map.twig deleted file mode 100644 index 9f8f29c..0000000 --- a/template/map.twig +++ /dev/null @@ -1,13 +0,0 @@ -{% include 'includes/head.twig' with {'pageTitle': 'Map'} %} - -
- - - - - -{% include 'includes/foot.twig' %} \ No newline at end of file diff --git a/template/nation.twig b/template/nation.twig deleted file mode 100644 index 755bfbd..0000000 --- a/template/nation.twig +++ /dev/null @@ -1,63 +0,0 @@ -{% include 'includes/head.twig' with {'pageTitle': nation.name} %} - -{% include 'includes/hero.twig' %} - -{% include 'includes/nav.twig' with {'page': 'nation'} %} - -
-
-
-

{{ nation.name }}

-

{{ nation.short }}

-

Flag

- {{ nation.name }}'s flag. -
-
-

Description

-

{{ nation.description }}

-

{{ nation.leader_term }}

-

{{ nation.leader }}

-
-
-
- - - -{% include 'includes/footer.twig' %} -{% include 'includes/foot.twig' %} \ No newline at end of file diff --git a/template/nations.twig b/template/nations.twig deleted file mode 100644 index 8f18578..0000000 --- a/template/nations.twig +++ /dev/null @@ -1,22 +0,0 @@ -{% include 'includes/head.twig' with {'pageTitle': 'Nations'} %} - -{% include 'includes/hero.twig' %} - -{% include 'includes/nav.twig' with {'page': 'nations'} %} - -
-

Nations

-
- {% for nation in nations %} - -

{{ nation.name }}

-

{{ nation.short_description }}

- -
- {% endfor %} -
- -
- -{% include 'includes/footer.twig' %} -{% include 'includes/foot.twig' %} \ No newline at end of file diff --git a/template/profile.twig b/template/profile.twig deleted file mode 100644 index 90f1160..0000000 --- a/template/profile.twig +++ /dev/null @@ -1,36 +0,0 @@ -{% include 'includes/head.twig' with {'pageTitle': 'Profile'} %} - -{% include 'includes/hero.twig' %} - -{% include 'includes/nav.twig' with {'page': 'profile',} %} - -
-
-
    -
  • - id: {{ user.id }} -
  • -
  • - username: {{ user.username }} -
  • -
  • - global_name: {{ user.global_name }} -
  • -
  • - accent_color: {{ user.accent_color }} -
  • -
  • - premium_type: {{ user.premium_type }} -
  • -
  • - public_flags: {{ user.public_flags }} -
  • -
  • - is_admin: -
  • -
-
-
- -{% include 'includes/footer.twig' %} -{% include 'includes/foot.twig' %} \ No newline at end of file diff --git a/template/rules.twig b/template/rules.twig deleted file mode 100644 index e4bdfcf..0000000 --- a/template/rules.twig +++ /dev/null @@ -1,25 +0,0 @@ -{% include 'includes/head.twig' with {'pageTitle': 'Rules'} %} - -{% include 'includes/hero.twig' %} - -{% include 'includes/nav.twig' with {'page': 'rules',} %} - -
-
-

Rules

- -
    -
  1. - The usage of modified clients that gives unfair advantage to players is not permitted. TL;DR Do not cheat. -
  2. -
  3. - Do not modify (or destroy) other players' constructions, or take their items, without their permission. TL;DR Do not grief or steal. -
  4. -
- - Failing to follow these basic rules will result in a ban. -
-
- -{% include 'includes/footer.twig' %} -{% include 'includes/foot.twig' %} \ No newline at end of file diff --git a/template/user.twig b/template/user.twig deleted file mode 100644 index 5f2d8cd..0000000 --- a/template/user.twig +++ /dev/null @@ -1,14 +0,0 @@ -{% include 'includes/head.twig' with {'pageTitle': username} %} - -{% include 'includes/hero.twig' %} - -{% include 'includes/nav.twig' with {'page': 'user',} %} - -
-
- {{ db_user.display_name }} is {% if db_user.is_admin == 1 %} an admin! {% else %} not an admin! {% endif %} -
-
- -{% include 'includes/footer.twig' %} -{% include 'includes/foot.twig' %} \ No newline at end of file diff --git a/util/Admin.php b/util/Admin.php deleted file mode 100644 index bb9e32c..0000000 --- a/util/Admin.php +++ /dev/null @@ -1,81 +0,0 @@ -router = $router; - } - - function notFound($error): void { - header('Content-Type: application/json'); - http_response_code(404); - - echo json_encode(array( - 'error' => true, - 'error_description' => $error - )); - - exit(); - } - - function isSignedInAdmin(): void { - global $mysql; - - if(!isset($_SESSION['user'])) { - $this->notFound('You are not logged in.'); - } - - $user = $mysql->getUserRecordFromId($_SESSION['user']['id']); - - if($user == null && $user['admin'] == 0) { - $this->notFound('You are not an admin.'); - } - } - - function registerApiRoutes(): void { - $router = $this->router; - - $router->mount('/admin/api', function() use ($router) { - $router->mount('/v1', function() use ($router) { - $router->get('/markers', function() { - global $mysql; - - header('Content-Type: application/json'); - - $this->isSignedInAdmin(); - - $markers = $mysql->getMarkers(); - - $markersNew = array(); - - foreach ($markers as $marker) { - $markersNew[] = array( - 'id' => $marker['id'], - 'name' => $marker['name'], - 'category' => $marker['category'], - 'x' => floatval(explode(';', $marker['data'])[1]), - 'y' => floatval(explode(';', $marker['data'])[0]) - ); - } - - $finalOut = array( - 'error' => false, - 'markers' => $markersNew - ); - - echo json_encode($finalOut); - }); - - $router->get('/users', function() { - global $mysql; - - header('Content-Type: application/json'); - - $this->isSignedInAdmin(); - - echo json_encode($mysql->getUsers()); - }); - }); - }); - } - } \ No newline at end of file diff --git a/util/Database.php b/util/Database.php deleted file mode 100644 index 2cfd5c2..0000000 --- a/util/Database.php +++ /dev/null @@ -1,92 +0,0 @@ -host = $host; - $this->user = $user; - $this->pass = $pass; - $this->db = $db; - - $this->conn = new mysqli($this->host, $this->user, $this->pass, $this->db); - } - - function createUserRecord($user): void { - $sql = 'INSERT IGNORE INTO users (id, username, display_name) VALUES (?, ?, ?)'; - - $stmt = $this->conn->prepare($sql); - $stmt->bind_param('iss', $user['id'], $user['username'], $user['global_name']); - - $stmt->execute(); - } - - function getUserRecordFromUsername($username): array | null { - $sql = 'SELECT * FROM users WHERE username = ?'; - - $stmt = $this->conn->prepare($sql); - $stmt->bind_param('s', $username); - - $stmt->execute(); - - $res = $stmt->get_result(); - - if($res->num_rows > 0) { - return $res->fetch_assoc(); - } else { - return null; - } - } - - function getUserRecordFromId($id): array | null { - $sql = 'SELECT * FROM users WHERE id = ?'; - - $stmt = $this->conn->prepare($sql); - $stmt->bind_param('i', $id); - - $stmt->execute(); - - $res = $stmt->get_result(); - - if($res->num_rows > 0) { - return $res->fetch_assoc(); - } else { - return null; - } - } - - function getUsers(): array | null { - $sql = 'SELECT * FROM users'; - - $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; - } - } - - function getMarkers(): array | null { - $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; - } - } - } \ No newline at end of file diff --git a/util/Discord.php b/util/Discord.php deleted file mode 100644 index 871a657..0000000 --- a/util/Discord.php +++ /dev/null @@ -1,88 +0,0 @@ -client = $client; - $this->secret = $secret; - $this->redirect = $redirect; - - $this->curl = new anlutro\cURL\cURL; - } - - function validateCode($code): array { - $res = $this->curl->post('https://discord.com/api/v10/oauth2/token', [ - 'client_id' => $this->client, - 'client_secret' => $this->secret, - 'grant_type' => 'authorization_code', - 'code' => $code, - 'redirect_uri' => $this->redirect - ]); - - $json = json_decode($res->body, true); - - if(isset($json['error'])) { - return array( - 'error' => true, - 'error_description' => $json['error_description'] - ); - } else { - return array( - 'error' => false, - 'access_token' => $json['access_token'], - 'refresh_token' => $json['refresh_token'], - 'expires_in' => $json['expires_in'] - ); - } - } - - function refreshToken($refresh_token): array { - $res = $this->curl->post('https://discord.com/api/oauth2/token', [ - 'client_id' => $this->client, - 'client_secret' => $this->secret, - 'grant_type' => 'authorization_code', - 'refresh_token' => $refresh_token - ]); - - $json = json_decode($res->body, true); - - if(isset($json['error'])) { - return array( - 'error' => true, - 'error_description' => $json['error_description'] - ); - } else { - return array( - 'error' => false, - 'access_token' => $json['access_token'], - 'refresh_token' => $json['refresh_token'], - 'expires_in' => $json['expires_in'] - ); - } - } - - function getUser($token): array { - $res = $this - ->curl - ->newRequest('get', 'https://discord.com/api/v10/users/@me') - ->setHeader('Authorization', 'Bearer ' . $token) - ->send(); - - return json_decode($res->body, true); - } - - function getGuilds($token): array { - $res = $this - ->curl - ->newRequest('get', 'https://discord.com/api/v10/users/@me/guilds') - ->setHeader('Authorization', 'Bearer ' . $token) - ->send(); - - return json_decode($res->body, true); - } - } \ No newline at end of file