changed background

This commit is contained in:
0xa0
2026-09-22 19:28:00 +02:00
parent 3b151b330e
commit c6810548e4
11 changed files with 456 additions and 3 deletions
+16
View File
@@ -10,5 +10,21 @@ $build = preg_match('/[0-9a-f]{7,40}/i', $build, $m) ? $m[0] : ($build ?: 'dev')
</div>
<small>&copy; <?= 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; ?>
</body>
</html>