Startseite: die DogTag-Marke zum Anfassen (Kette, Ring bis Mitternacht, grosses Ziel fuers Handy)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -10042,29 +10042,89 @@ body[data-ton] .kopfleiste__rechts > *:hover {
|
||||
.leutekarte__marke[data-rolle="moderation"] { color: #bff0d2; border-color: rgba(125, 226, 168, .5); }
|
||||
|
||||
/* ==== DEIN DOGTAG IN DER REACTION-KACHEL (28.10.2026) ================
|
||||
Eine Zeile unten rechts in der Kachel, die zur Seite „Dein DogTag“
|
||||
führt. Dieselbe Bauart wie der „Wer ist da“-Knopf darüber (eigenes
|
||||
Element neben dem Link — ein Link im Link wäre ungültig). */
|
||||
Die Marke zum Anfassen: eine eigene Reihe unter dem Kacheltext (gemessen:
|
||||
unten rechts läge sie auf Name und Unterzeile), eingerückt wie der Text,
|
||||
mindestens 56 Punkte hoch. Ein eigenes Element neben dem Link der Kachel
|
||||
— ein Link im Link wäre ungültig.
|
||||
|
||||
BEWEGUNG nur über transform/opacity und nur zweimal: Beim Laden schwingt
|
||||
der DogTag einmal an seiner Kette aus; ist er bereit, wandert dreimal ein
|
||||
ruhiger Schimmer darüber. Danach steht alles still — nichts blinkt
|
||||
dauerhaft. Bei „weniger Bewegung“ gar nicht. */
|
||||
.kachel[data-sendung="ja"] > .kachel__dogtag {
|
||||
position: absolute; right: 12px; bottom: 12px; z-index: 3;
|
||||
display: inline-flex; align-items: center; gap: 6px;
|
||||
min-height: 30px; padding: 3px 12px 3px 8px; border-radius: 999px;
|
||||
border: 1px solid rgba(169, 220, 255, .35);
|
||||
background: rgba(13, 34, 56, .82);
|
||||
color: #e8f4ff; font-size: .78rem; font-weight: 700; text-decoration: none;
|
||||
font-variant-numeric: tabular-nums; white-space: nowrap;
|
||||
position: relative; z-index: 3;
|
||||
display: flex; align-items: center; gap: 12px;
|
||||
width: fit-content; max-width: calc(100% - 122px);
|
||||
min-height: 56px; margin: -8px 16px 16px 106px; padding: 6px 14px 6px 10px;
|
||||
border-radius: 16px; overflow: hidden;
|
||||
border: 1px solid rgba(169, 220, 255, .3);
|
||||
background:
|
||||
radial-gradient(120% 140% at 0% 50%, rgba(108, 196, 255, .2), rgba(108, 196, 255, 0) 60%),
|
||||
rgba(9, 22, 38, .9);
|
||||
color: #e8f4ff; text-decoration: none;
|
||||
box-shadow: 0 10px 24px -16px #000, inset 0 1px 0 rgba(243, 250, 255, .06);
|
||||
transition: border-color .25s ease, transform .2s ease;
|
||||
}
|
||||
.kachel__dogtag svg { display: block; width: 18px; height: auto; flex: none; }
|
||||
.kachel__dogtag[data-bereit="ja"] { border-color: rgba(243, 250, 255, .6); }
|
||||
.kachel__dogtag:hover, .kachel__dogtag:focus-visible { border-color: #a9dcff; }
|
||||
@media (pointer: coarse) { .kachel[data-sendung="ja"] > .kachel__dogtag { min-height: 44px; } }
|
||||
/* AM HANDY ALS EIGENE REIHE UNTER DEM TEXT. Gemessen: Die Kachel ist auf
|
||||
360 Punkten 96 hoch, Name und Unterzeile füllen sie — unten rechts
|
||||
läge die Zeile auf dem Text. Hier rückt sie in den Fluss, eingerückt
|
||||
wie der Text darüber, und die Kachel wird um diese Reihe höher. */
|
||||
.kachel[data-sendung="ja"] > .kachel__dogtag[data-bereit="ja"] {
|
||||
border-color: rgba(243, 250, 255, .55);
|
||||
box-shadow: 0 10px 26px -14px rgba(108, 196, 255, .55), inset 0 1px 0 rgba(243, 250, 255, .1);
|
||||
}
|
||||
.kachel[data-sendung="ja"] > .kachel__dogtag:hover,
|
||||
.kachel[data-sendung="ja"] > .kachel__dogtag:focus-visible { border-color: #a9dcff; }
|
||||
.kachel[data-sendung="ja"] > .kachel__dogtag:active { transform: scale(.98); }
|
||||
.kachel[data-sendung="ja"] > .kachel__dogtag:focus-visible { outline: 2px solid #a9dcff; outline-offset: 2px; }
|
||||
|
||||
/* Kette, Ring und Marke */
|
||||
.kdt-haenger { position: relative; flex: none; width: 52px; height: 58px; display: grid; justify-items: center; }
|
||||
.kdt-kette {
|
||||
width: 2px; height: 8px; border-radius: 1px;
|
||||
background: linear-gradient(#cfd8e2, #8d99a7);
|
||||
}
|
||||
.kdt-marke {
|
||||
position: relative; width: 50px; height: 50px; display: grid; place-items: center;
|
||||
transform-origin: 50% -6px;
|
||||
animation: kdt-schwingen 2.6s cubic-bezier(.3, .7, .3, 1) .35s 1 both;
|
||||
}
|
||||
.kdt-marke > svg.dogtag-marke { position: relative; width: 32px; height: auto; display: block; margin-top: -5px; }
|
||||
.kdt-ring { position: absolute; inset: 0; width: 50px; height: 50px; transform: rotate(-90deg); }
|
||||
.kdt-ring__spur { fill: rgba(5, 11, 20, .55); stroke: rgba(169, 220, 255, .18); stroke-width: 3; }
|
||||
.kdt-ring__fuell { fill: none; stroke: #a9dcff; stroke-width: 3; stroke-linecap: round; }
|
||||
.kachel__dogtag[data-bereit="ja"] .kdt-ring__fuell { stroke: #f3faff; }
|
||||
.kdt-punkt {
|
||||
position: absolute; top: 9px; right: 0; width: 9px; height: 9px; border-radius: 50%;
|
||||
background: #f3faff; box-shadow: 0 0 8px #6cc4ff;
|
||||
}
|
||||
@keyframes kdt-schwingen {
|
||||
0% { transform: rotate(14deg); }
|
||||
30% { transform: rotate(-9deg); }
|
||||
55% { transform: rotate(5deg); }
|
||||
78% { transform: rotate(-2deg); }
|
||||
100% { transform: rotate(0); }
|
||||
}
|
||||
|
||||
/* Text und Pfeil */
|
||||
.kdt-text { display: grid; gap: 1px; min-width: 0; }
|
||||
.kdt-titel { font-weight: 800; font-size: .92rem; color: #f3faff; letter-spacing: .01em; }
|
||||
.kdt-neben { font-size: .74rem; color: #a9dcff; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||
.kdt-zustand { font-size: .78rem; color: #c9dcee; font-variant-numeric: tabular-nums; white-space: nowrap; }
|
||||
.kdt-pfeil { flex: none; width: 20px; height: 20px; margin-left: 4px; fill: none; stroke: #a9dcff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
|
||||
|
||||
/* Der Schimmer, wenn er bereit ist — dreimal, dann Ruhe */
|
||||
.kdt-glanz { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
|
||||
.kachel__dogtag[data-bereit="ja"] .kdt-glanz {
|
||||
opacity: 1;
|
||||
background: linear-gradient(105deg, rgba(243, 250, 255, 0) 35%, rgba(243, 250, 255, .14) 50%, rgba(243, 250, 255, 0) 65%);
|
||||
transform: translateX(-100%);
|
||||
animation: kdt-schimmer 3.2s ease-in-out 1.4s 3;
|
||||
}
|
||||
@keyframes kdt-schimmer { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }
|
||||
|
||||
@media (max-width: 600px) {
|
||||
.kachel[data-sendung="ja"] > .kachel__dogtag {
|
||||
position: relative; right: auto; bottom: auto;
|
||||
margin: -6px 12px 12px 84px; width: fit-content; max-width: calc(100% - 96px);
|
||||
width: auto; max-width: none; margin: -4px 12px 12px 12px;
|
||||
}
|
||||
.kdt-pfeil { margin-left: auto; }
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.kdt-marke, .kachel__dogtag[data-bereit="ja"] .kdt-glanz { animation: none; }
|
||||
}
|
||||
|
||||
@@ -778,28 +778,94 @@
|
||||
führt. Erst fragen, OB jemand die DogTags sieht (nie ein Fehler
|
||||
in der Konsole), dann holen. */
|
||||
if (sendungsKachel && window.DogTag) {
|
||||
/* ==== DIE MARKE ZUM ANFASSEN (28.10.2026) ====================
|
||||
Filipe: „mach das vielleicht viel geiler und besser so dass man
|
||||
das auch ohne problem auf dem handy öffnen kann“. Statt einer
|
||||
kleinen Pille hängt der DogTag jetzt an einer Kette, schwingt
|
||||
beim Laden einmal aus, und ein Ring um ihn zeigt, wie weit die
|
||||
Nacht bis zum nächsten DogTag ist (voll und leuchtend = bereit).
|
||||
Eine eigene Reihe in der Kachel, mindestens 56 Punkte hoch —
|
||||
ein Ziel für den Daumen, kein Pünktchen. Läuft gerade ein Stream
|
||||
und der DogTag ist noch frei, führt sie direkt in den Saal. */
|
||||
(async () => {
|
||||
try {
|
||||
const darf = await fetch('/workspace/api/dogtag/darf', { credentials: 'same-origin' }).then((a) => (a.ok ? a.json() : null));
|
||||
if (!darf?.sieht) return;
|
||||
const ich = await fetch('/workspace/api/dogtag/ich', { credentials: 'same-origin', cache: 'no-store' }).then((a) => (a.ok ? a.json() : null));
|
||||
if (!ich) return;
|
||||
const p = await fetch('/workspace/api/dogtag/profil', { credentials: 'same-origin', cache: 'no-store' }).then((a) => (a.ok ? a.json() : null));
|
||||
if (!p) return;
|
||||
const svgNs = 'http://www.w3.org/2000/svg';
|
||||
const zeile = el('a', 'kachel__dogtag');
|
||||
zeile.href = 'dogtags.html';
|
||||
const bereit = !p.geheult_heute && !p.gesperrt;
|
||||
zeile.href = bereit && p.live ? 'reaktion.html' : 'dogtags.html';
|
||||
zeile.dataset.bereit = bereit ? 'ja' : 'nein';
|
||||
|
||||
/* Kette, Ring und Marke */
|
||||
const haenger = el('span', 'kdt-haenger');
|
||||
haenger.append(el('span', 'kdt-kette'));
|
||||
const marke = el('span', 'kdt-marke');
|
||||
const ring = document.createElementNS(svgNs, 'svg');
|
||||
ring.setAttribute('viewBox', '0 0 48 48');
|
||||
ring.setAttribute('class', 'kdt-ring');
|
||||
ring.setAttribute('aria-hidden', 'true');
|
||||
const spur = document.createElementNS(svgNs, 'circle');
|
||||
spur.setAttribute('cx', '24'); spur.setAttribute('cy', '24'); spur.setAttribute('r', '21');
|
||||
spur.setAttribute('class', 'kdt-ring__spur');
|
||||
const fuell = document.createElementNS(svgNs, 'circle');
|
||||
fuell.setAttribute('cx', '24'); fuell.setAttribute('cy', '24'); fuell.setAttribute('r', '21');
|
||||
fuell.setAttribute('class', 'kdt-ring__fuell');
|
||||
ring.append(spur, fuell);
|
||||
const t = document.createElement('template');
|
||||
t.innerHTML = window.DogTag.svg({ rang: ich.rang.key, groesse: 22, leitwolf: ich.leitwolf });
|
||||
const text = el('span', 'kachel__dogtag-text', '');
|
||||
zeile.append(t.content.firstElementChild, text);
|
||||
const ziel2 = Date.now() + ich.sekunden_bis_neu * 1000;
|
||||
t.innerHTML = window.DogTag.svg({ rang: p.rang.key, groesse: 30, leitwolf: p.leitwolf });
|
||||
marke.append(ring, t.content.firstElementChild);
|
||||
haenger.append(marke);
|
||||
if (bereit) haenger.append(el('span', 'kdt-punkt'));
|
||||
|
||||
const text = el('span', 'kdt-text');
|
||||
const titel = el('span', 'kdt-titel', bereit ? 'Dein DogTag liegt bereit' : 'Dein DogTag');
|
||||
const neben = el('span', 'kdt-neben', `${p.rang.name} · ${p.sammlung} ${p.sammlung === 1 ? 'DogTag' : 'DogTags'}`);
|
||||
const zustand = el('span', 'kdt-zustand', '');
|
||||
text.append(titel, neben, zustand);
|
||||
const pfeil = document.createElementNS(svgNs, 'svg');
|
||||
pfeil.setAttribute('viewBox', '0 0 24 24');
|
||||
pfeil.setAttribute('class', 'kdt-pfeil');
|
||||
pfeil.setAttribute('aria-hidden', 'true');
|
||||
const pp = document.createElementNS(svgNs, 'path');
|
||||
pp.setAttribute('d', 'M9 5.5 15.5 12 9 18.5');
|
||||
pfeil.append(pp);
|
||||
const glanz = el('span', 'kdt-glanz');
|
||||
glanz.setAttribute('aria-hidden', 'true');
|
||||
zeile.append(glanz, haenger, text, pfeil);
|
||||
|
||||
const umfang = 2 * Math.PI * 21;
|
||||
fuell.style.strokeDasharray = `${umfang.toFixed(1)}`;
|
||||
const ziel2 = Date.now() + p.sekunden_bis_neu * 1000;
|
||||
const zwei = (n) => String(n).padStart(2, '0');
|
||||
let zuletzt = -1;
|
||||
const zeichnen = () => {
|
||||
if (!ich.geheult_heute) { text.textContent = 'Dein DogTag liegt bereit'; return; }
|
||||
const s = Math.max(0, Math.ceil((ziel2 - Date.now()) / 1000));
|
||||
text.textContent = `Nächster DogTag in ${zwei(Math.floor(s / 3600))}:${zwei(Math.floor((s % 3600) / 60))}:${zwei(s % 60)}`;
|
||||
if (bereit) {
|
||||
/* Die Nächte stehen HIER und nicht in der Zeile darüber: Dort
|
||||
waren sie auf 360 Punkten abgeschnitten (gemessen). */
|
||||
const serie = p.naechte > 0 ? ` · ${p.naechte} ${p.naechte === 1 ? 'Nacht' : 'Nächte'} halten` : '';
|
||||
zustand.textContent = p.live ? `Live · im Saal heulen${serie}` : `Jetzt heulen${serie}`;
|
||||
fuell.style.strokeDashoffset = '0';
|
||||
} else {
|
||||
zustand.textContent = `Nächster in ${zwei(Math.floor(s / 3600))}:${zwei(Math.floor((s % 3600) / 60))}:${zwei(s % 60)}`;
|
||||
/* Der Ring füllt sich über die Nacht — einmal je Minute
|
||||
neu gesetzt, nicht im Sekundentakt gemalt. */
|
||||
const minute = Math.floor(s / 60);
|
||||
if (minute !== zuletzt) {
|
||||
zuletzt = minute;
|
||||
const anteil = Math.min(1, Math.max(0, 1 - s / 86400));
|
||||
fuell.style.strokeDashoffset = (umfang * (1 - anteil)).toFixed(1);
|
||||
}
|
||||
}
|
||||
if (!bereit && s === 0) location.reload();
|
||||
};
|
||||
zeichnen();
|
||||
zeile.setAttribute('aria-label', ich.geheult_heute ? 'Dein DogTag: heute geheult' : 'Dein DogTag liegt bereit');
|
||||
zeile.dataset.bereit = ich.geheult_heute ? 'nein' : 'ja';
|
||||
zeile.setAttribute('aria-label', bereit
|
||||
? `Dein DogTag liegt bereit. ${p.rang.name}, ${p.sammlung} DogTags. ${p.live ? 'Im Saal heulen.' : 'Zur Seite Dein DogTag.'}`
|
||||
: `Dein DogTag: heute geheult. ${p.rang.name}, ${p.sammlung} DogTags. Zur Seite Dein DogTag.`);
|
||||
sendungsKachel.append(zeile);
|
||||
setInterval(zeichnen, 1000);
|
||||
} catch { /* die Kachel geht auch ohne */ }
|
||||
|
||||
Reference in New Issue
Block a user