DJ Brake: note that the limiter is not the goal, with its own settings

Shown by default and always in English by default; both can be switched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
GivouandClaude Opus 5.5 committed 2026-11-02 18:45:38 +01:00
1 parent 8919f0016c
commit d6be627f32
6 files changed
+43 -9

No files matched your search

+17 -2
View File
@@ -2385,9 +2385,24 @@ function djBrakeCard() {
} }, t("Copy"))) : null,
S.djbrake && !url ? h("p", { class: "info djwarn" }, t("Switch on remote access below so other devices can reach it.")) : null,
S.djbrake ? djLimiters() : null,
S.djbrake ? djHintOptions() : null,
S.djbrake ? h("p", { class: "info" }, t("Anyone in your network can open it without a PIN. It shows only the light and the distance to the limiter and changes nothing.")) : null);
}
function djHintOptions() {
const save = async (key, on) => {
try {
const r = await api("PUT", "/api/djbrake", { [key]: on });
S.djHint = r.hint; S.djHintEn = r.hint_en; render();
} catch (e) { toast(t("Error: ") + trMsg(e.message)); render(); }
};
return h("div", { class: "djlim" },
h("label", { class: "chk" }, h("input", { type: "checkbox", checked: S.djHint, onchange: e => save("hint", e.target.checked) }),
t("Show a short note that the limiter is not the goal")),
S.djHint ? h("label", { class: "chk" }, h("input", { type: "checkbox", checked: S.djHintEn, onchange: e => save("hint_en", e.target.checked) }),
t("Note always in English")) : null);
}
function djLimiters() {
const devs = S.order.map(id => S.devices[id]).filter(d => d.state && !d.demo);
const toggle = async (id, i) => {
@@ -2655,7 +2670,7 @@ function connectEvents() {
if (ev.muteall) { S.muteAll = ev.muteall.active; showMuteAll(); }
if (ev.soundfield) S.sf = ev.soundfield;
if ("dashboard" in ev) S.dash = ev.dashboard && ev.dashboard.modules;
S.djbrake = !!ev.djbrake; S.djIgnore = ev.dj_ignore || {};
S.djbrake = !!ev.djbrake; S.djIgnore = ev.dj_ignore || {}; S.djHint = ev.dj_hint !== false; S.djHintEn = ev.dj_hint_en !== false;
if ("logo" in ev) { S.logo = ev.logo; showLogo(); }
if (S.demo.enabled && S.devices.demo && !S.devices[S.cur]?.demo) S.cur = "demo";
S.order.forEach(id => maybeAskUnlock(S.devices[id]));
@@ -2691,7 +2706,7 @@ function connectEvents() {
case "dashboard":
dashRemote(ev.data); break;
case "djbrake":
S.djbrake = ev.enabled; S.djIgnore = ev.ignore; if (S.settings && !S.busy) render(); break;
S.djbrake = ev.enabled; S.djIgnore = ev.ignore; S.djHint = ev.hint; S.djHintEn = ev.hint_en; if (S.settings && !S.busy) render(); break;
case "logo":
S.logo = ev.data; showLogo(); if (S.settings) render(); break;
case "muteall":
+7 -1
View File
@@ -9,7 +9,7 @@
<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; }
body { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4vmin; 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; }
@@ -38,6 +38,8 @@
body.on #scale { color: #ffc9c4; }
body.on #word { color: #fff; transition: color .09s; }
body.on #sub { color: #ffd9d4; transition: color .09s; }
#hint { position: relative; max-width: 88vw; font-size: 2.8vmin; color: #6b7280; transition: color .5s; }
body.on #hint { color: #ffc9c4; 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; }
@@ -61,6 +63,7 @@
<div id="scale"><span style="left:0">−30</span><span style="left:20%">−24</span><span style="left:40%">−18</span><span style="left:60%">−12</span><span style="left:80%">−6</span><span style="left:100%">0 dB</span></div>
</div>
<div id="sub"></div>
<div id="hint"></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.
@@ -70,6 +73,8 @@
? { on: "LIMITER", more: "Mehr Gas bringt nichts", lost: "Keine Verbindung", none: "Kein Limiter überwacht", quiet: "Kein Signal", left: " dB bis zum Limiter" }
: { on: "LIMITER", more: "More gain won't help", lost: "No connection", none: "No limiter being watched", quiet: "No signal", left: " dB to the limiter" };
var word = document.getElementById("word"), sub = document.getElementById("sub"), cover = document.getElementById("cover");
var hint = document.getElementById("hint");
var notes = { en: "The limiter is a safety net, not the target. Stay below it.", de: "Der Limiter ist die Sicherung, nicht das Ziel. Bleib darunter." };
var RANGE = 30, gap = 100, state = null, closest = null;
document.documentElement.lang = de ? "de" : "en";
@@ -101,6 +106,7 @@
var s = JSON.parse(e.data), was = state && state.on;
state = s;
bar(s.on ? 0 : s.room);
hint.textContent = !s.hint ? "" : s.hint === "auto" && de ? notes.de : notes.en;
if (s.room != null && (closest == null || s.room < closest)) closest = s.room;
if (s.on !== was || !s.ready) draw();
};
+2
View File
@@ -681,6 +681,8 @@ const DE = {
"Anyone in your network can open it without a PIN. It shows only the light and the distance to the limiter and changes nothing.": "Jeder in deinem Netzwerk kann sie ohne PIN öffnen. Sie zeigt nur das Licht und den Abstand zum Limiter und ändert nichts.",
"Limiters that count": "Diese Limiter zählen",
"Connect a DSP to choose.": "Verbinde einen DSP, um auszuwählen.",
"Show a short note that the limiter is not the goal": "Kurzen Hinweis anzeigen, dass der Limiter nicht das Ziel ist",
"Note always in English": "Hinweis immer auf Englisch",
};
const DE_PATTERNS = [
+2
View File
@@ -991,3 +991,5 @@ body.dashonly .dlink { cursor: default; }
.djch { display: flex; flex-direction: column; align-items: center; min-width: 58px; padding: 5px 8px; line-height: 1.2; opacity: .55; }
.djch small { font-size: 10px; color: var(--dim); }
.djch.on { opacity: 1; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.djlim label.chk { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; }
.djlim label.chk input { flex: none; margin: 3px 0 0; }