Skip to content

Commit

Permalink
add possibility for quick maintenance mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Boldewyn committed Nov 5, 2024
1 parent 57acbc1 commit 9ab3790
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
7 changes: 7 additions & 0 deletions codepoints.net/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Codepoints\Unicode\CodepointInfo\Image;
use Codepoints\Unicode\CodepointInfo\Sensitivity;
use Codepoints\Unicode\PropertyInfo;
use Codepoints\View;

require 'vendor/autoload.php';

Expand Down Expand Up @@ -43,6 +44,12 @@
/* enable gzip compression of HTML */
ini_set('zlib.output_compression', '1');

/* quick exit into maintenance mode */
if (file_exists(__DIR__.'/maintenance') && PHP_SAPI !== 'cli') {
http_response_code(503);
die((new View('maintenance'))(['title' => 'Maintenance', 'no_navigation' => true]));
}

/**
* get global config values and the database connection ready
*/
Expand Down
24 changes: 24 additions & 0 deletions codepoints.net/views/maintenance.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php include 'partials/header.php'; ?>
<main class="main main--maintenance">
<h1>
<svg width="100%" viewBox="0 0 100 15" aria-hidden="true" style="overflow:hidden">
<text x="50" y="12.5" text-anchor="middle" font-size="14.5" style="
font-family: Literata;
font-weight: 550;
fill: currentColor;
opacity: .5;
font-variation-settings: &quot;opsz&quot; 50;
text-transform: uppercase;
text-shadow: 0 3px 3px #0006;
">Codepoints</text>
</svg>
</h1>
<p>Unfortunately, we are currently in maintenance mode. But fear not, we
will be right back with more code point features!</p>
<p>Meanwhile you can come chat with us over at Mastodon:
<a href="https://typo.social/@codepoints">typo.social/@codepoints</a>.</p>
<div>
<iframe src="https://www.youtube-nocookie.com/embed/O0wOD9TWynM" width="100%" style="aspect-ratio: 16/9"></iframe>
</div>
</main>
<?php include 'partials/footer.php'; ?>
2 changes: 1 addition & 1 deletion codepoints.net/views/partials/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@
<body>
<div data-barba="wrapper">
<div data-barba="container">
<?php include 'main-navigation.php' ?>
<?php if (! isset($no_navigation) || ! $no_navigation) include 'main-navigation.php' ?>

0 comments on commit 9ab3790

Please sign in to comment.