This commit is contained in:
+2
-16
@@ -10,21 +10,7 @@ $build = preg_match('/[0-9a-f]{7,40}/i', $build, $m) ? $m[0] : ($build ?: 'dev')
|
||||
</div>
|
||||
<small>© <?= date('Y') ?> · build: <a href="<?= htmlspecialchars(REPO_URL) ?>"><?= htmlspecialchars($build) ?></a></small>
|
||||
</footer>
|
||||
<?php require_once __DIR__ . '/backgrounds.php'; $bgs = bg_styles(); ?>
|
||||
<?php if (count($bgs) > 1): ?>
|
||||
<script>
|
||||
/* Unlabelled: press b to flick through the backgrounds without reloading.
|
||||
Not persisted -- the server picks a fresh one on every load anyway. */
|
||||
(function () {
|
||||
var all = <?= json_encode($bgs) ?>, root = document.documentElement;
|
||||
document.addEventListener('keydown', function (e) {
|
||||
if (e.key !== 'b' || e.metaKey || e.ctrlKey || e.altKey) return;
|
||||
var t = e.target;
|
||||
if (t && (t.tagName === 'INPUT' || t.tagName === 'TEXTAREA' || t.isContentEditable)) return;
|
||||
root.dataset.bg = all[(all.indexOf(root.dataset.bg) + 1) % all.length];
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
<pre class="side side-left" aria-hidden="true"><?= file_get_contents(__DIR__ . '/art/left.html') ?></pre>
|
||||
<pre class="side side-right" aria-hidden="true"><span><?= file_get_contents(__DIR__ . '/art/right.html') ?></span></pre>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user