DJ Brake page without login; routing level text follows the slider live
Optional page /djbrake (off by default) with a red light while a limiter works.
It needs no PIN and only ever gets {on, ready} from /djbrake/state.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3ce0334aea
commit
e56524a8cd
7 files changed
+179
-6
No files matched your search
@@ -0,0 +1,81 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
||||
<meta name="theme-color" content="#000000">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<title>DJ Brake</title>
|
||||
<style>
|
||||
html, body { height: 100%; margin: 0; background: #050608; color: #fff; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; overflow: hidden; }
|
||||
body { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5vmin; text-align: center; -webkit-user-select: none; user-select: none; }
|
||||
|
||||
/* comes on fast, goes out slowly: the eye catches it and it never flickers */
|
||||
#wash, #halo, #core { transition: opacity .7s ease-out; opacity: 0; }
|
||||
body.on #wash, body.on #halo, body.on #core { transition: opacity .09s ease-out; opacity: 1; }
|
||||
|
||||
#wash { position: fixed; inset: 0; background: radial-gradient(circle at 50% 46%, #6e0a0a 0%, #2a0505 42%, #050608 78%); }
|
||||
#lamp { position: relative; width: 66vmin; height: 66vmin; display: grid; place-items: center; }
|
||||
#halo, #core, #glass, #ring { position: absolute; inset: 0; border-radius: 50%; }
|
||||
#glass { background: radial-gradient(circle at 50% 38%, #171a20, #0b0d11 70%); box-shadow: inset 0 0 0 1px #ffffff14; }
|
||||
#core { background: radial-gradient(circle at 50% 36%, #ff6a5c 0%, #f4201c 46%, #b80c0f 100%); box-shadow: inset 0 0 0 1px #ffb3a8, inset 0 -3vmin 7vmin #5e000380; }
|
||||
#halo { inset: -7vmin; background: radial-gradient(circle, #ff2a1f 44%, #ff2a1f00 70%); filter: blur(3vmin); }
|
||||
#ring { border: .5vmin solid #ff5a4c; opacity: 0; pointer-events: none; }
|
||||
#word { position: relative; font-size: 10.5vmin; font-weight: 800; letter-spacing: .03em; line-height: 1; color: #4b5260; transition: color .5s; }
|
||||
#sub { position: relative; min-height: 1.3em; font-size: 4.4vmin; font-weight: 500; color: #6b7280; transition: color .5s; }
|
||||
body.on #word { color: #fff; transition: color .09s; }
|
||||
body.on #sub { color: #ffd9d4; transition: color .09s; }
|
||||
|
||||
/* while it lasts: slow breathing, one ring on each new hit, no hard flashing */
|
||||
body.on #halo { animation: breathe 2.2s ease-in-out infinite; }
|
||||
body.on #ring { animation: ripple .9s cubic-bezier(.2, .6, .3, 1); }
|
||||
@keyframes breathe { 50% { transform: scale(.94); filter: blur(4.5vmin); } }
|
||||
@keyframes ripple { from { transform: scale(1); opacity: .75; } to { transform: scale(1.32); opacity: 0; } }
|
||||
@media (prefers-reduced-motion: reduce) { body.on #halo, body.on #ring { animation: none; } }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="wash"></div>
|
||||
<div id="lamp">
|
||||
<div id="halo"></div>
|
||||
<div id="ring"></div>
|
||||
<div id="glass"></div>
|
||||
<div id="core"></div>
|
||||
<div id="word">—</div>
|
||||
</div>
|
||||
<div id="sub"></div>
|
||||
<script>
|
||||
// Red light for the DJ: comes on while a limiter of a connected DSP is working.
|
||||
// On its own on purpose: this page needs no PIN and gets nothing but this one state from the server.
|
||||
(function () {
|
||||
var de = /^de/i.test(navigator.language || "");
|
||||
var text = de
|
||||
? { on: "LIMITER", more: "Mehr Gas bringt nichts", lost: "Keine Verbindung", none: "Kein DSP verbunden" }
|
||||
: { on: "LIMITER", more: "More gain won't help", lost: "No connection", none: "No DSP connected" };
|
||||
var word = document.getElementById("word"), sub = document.getElementById("sub");
|
||||
document.documentElement.lang = de ? "de" : "en";
|
||||
|
||||
function show(on, main, small) {
|
||||
document.body.className = on ? "on" : "";
|
||||
word.textContent = main;
|
||||
sub.textContent = small;
|
||||
}
|
||||
|
||||
var es = new EventSource("/djbrake/state");
|
||||
es.onmessage = function (e) {
|
||||
var s = JSON.parse(e.data);
|
||||
if (s.on) show(true, text.on, text.more);
|
||||
else if (s.ready) show(false, "OK", "");
|
||||
else show(false, "—", text.none);
|
||||
};
|
||||
es.onerror = function () { show(false, "—", text.lost); };
|
||||
|
||||
// keep the screen on where the browser allows it
|
||||
function awake() { if (navigator.wakeLock) navigator.wakeLock.request("screen").catch(function () {}); }
|
||||
awake();
|
||||
document.addEventListener("visibilitychange", function () { if (!document.hidden) awake(); });
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user