Weiter am Chastity Game gebastelt
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="icon" href="/img/icon.png" type="image/png">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Chastity Game – XXX The Game</title>
|
||||
<link rel="stylesheet" href="/css/variables.css">
|
||||
@@ -825,9 +826,11 @@
|
||||
document.getElementById('drawnCardImg').alt = def.name;
|
||||
inner.classList.add('flipped');
|
||||
setTimeout(() => {
|
||||
const khName = _currentLock && _currentLock.keyholderName ? _currentLock.keyholderName : 'Deine Keyholderin';
|
||||
const khName = _currentLock && _currentLock.keyholderName ? _currentLock.keyholderName : null;
|
||||
document.getElementById('drawCardName').textContent = def.name;
|
||||
document.getElementById('drawCardDesc').textContent = `🔑 ${khName} hat das Lock freigegeben.`;
|
||||
document.getElementById('drawCardDesc').textContent = khName
|
||||
? `🔑 ${khName} hat das Lock freigegeben.`
|
||||
: '🔓 Das Lock wird freigegeben.';
|
||||
document.getElementById('drawGreenText').style.display = 'none';
|
||||
info.classList.add('visible');
|
||||
actions.style.display = '';
|
||||
@@ -846,9 +849,11 @@
|
||||
if (lock.testLock) {
|
||||
area.innerHTML = `<button class="btn-lock-beenden" onclick="lockBeendenFragen()">🔓 Lock beenden</button>`;
|
||||
} else if (lock.emergencyUnlockRequested) {
|
||||
const khName = lock.keyholderName || 'Deine Keyholderin';
|
||||
const emergencyMsg = lock.keyholderName
|
||||
? `⏳ Notfall-Entsperrung angefordert – ${lock.keyholderName} wurde benachrichtigt.`
|
||||
: `⏳ Notfall-Entsperrung angefordert – Das Lock öffnet sich automatisch.`;
|
||||
area.innerHTML = `<div style="font-size:0.85rem;color:var(--color-muted);padding:0.5rem 0.75rem;border:1px solid rgba(231,76,60,0.3);border-radius:8px;background:rgba(231,76,60,0.06);">
|
||||
⏳ Notfall-Entsperrung angefordert – ${khName} wurde benachrichtigt.
|
||||
${emergencyMsg}
|
||||
</div>`;
|
||||
} else {
|
||||
area.innerHTML = `<button onclick="openEmergencyModal()"
|
||||
@@ -859,13 +864,16 @@
|
||||
}
|
||||
|
||||
function openEmergencyModal() {
|
||||
const khName = _currentLock && _currentLock.keyholderName ? _currentLock.keyholderName : 'Deine Keyholderin';
|
||||
const hasKH = _currentLock && _currentLock.keyholderName;
|
||||
const khName = hasKH ? _currentLock.keyholderName : null;
|
||||
const text = hasKH
|
||||
? `Im Notfall kannst du eine sofortige Freigabe anfordern.<br>
|
||||
<strong style="color:var(--color-text);">${khName}</strong> wird benachrichtigt und hat <strong>1 Stunde</strong> Zeit zu reagieren.
|
||||
Reagiert ${khName} nicht, öffnet sich das Lock automatisch.`
|
||||
: `Im Notfall kannst du eine sofortige Freigabe anfordern.<br>
|
||||
Da kein Keyholder zugewiesen ist, öffnet sich das Lock <strong>sofort</strong>.`;
|
||||
document.getElementById('emergencyModalContent').innerHTML = `
|
||||
<p style="font-size:0.88rem;color:var(--color-muted);line-height:1.5;margin:0 0 0.5rem;">
|
||||
Im Notfall kannst du eine sofortige Freigabe anfordern.<br>
|
||||
<strong style="color:var(--color-text);">${khName}</strong> wird benachrichtigt und hat <strong>1 Stunde</strong> Zeit zu reagieren.
|
||||
Reagiert ${khName} nicht, öffnet sich das Lock automatisch.
|
||||
</p>`;
|
||||
<p style="font-size:0.88rem;color:var(--color-muted);line-height:1.5;margin:0 0 0.5rem;">${text}</p>`;
|
||||
document.getElementById('emergencyModalActions').style.display = '';
|
||||
document.getElementById('emergencyModal').classList.add('open');
|
||||
}
|
||||
@@ -879,10 +887,13 @@
|
||||
try {
|
||||
const res = await fetch('/keyholder/cardlock/' + lockId + '/emergency-unlock', { method: 'POST' });
|
||||
if (res.ok || res.status === 204) {
|
||||
const khName2 = _currentLock && _currentLock.keyholderName ? _currentLock.keyholderName : 'Deine Keyholderin';
|
||||
const hasKH2 = _currentLock && _currentLock.keyholderName;
|
||||
const successText = hasKH2
|
||||
? `✅ Notfall-Anfrage wurde gesendet. ${_currentLock.keyholderName} wurde benachrichtigt.`
|
||||
: `✅ Notfall-Freigabe wurde ausgelöst. Das Lock öffnet sich jetzt.`;
|
||||
document.getElementById('emergencyModalContent').innerHTML = `
|
||||
<p style="font-size:0.88rem;color:#2ecc71;line-height:1.5;margin:0;">
|
||||
✅ Notfall-Anfrage wurde gesendet. ${khName2} wurde benachrichtigt.
|
||||
${successText}
|
||||
</p>`;
|
||||
setTimeout(() => { closeEmergencyModal(); loadLock(); }, 2000);
|
||||
}
|
||||
@@ -1126,8 +1137,10 @@
|
||||
|
||||
if (lock.openPicks > 0) {
|
||||
overlay.style.display = 'none';
|
||||
panel.classList.add('drawable');
|
||||
enableCardClick();
|
||||
if (!lock.keyholderRequestedUnlock) {
|
||||
panel.classList.add('drawable');
|
||||
enableCardClick();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1141,8 +1154,10 @@
|
||||
const diff = target - Date.now();
|
||||
if (diff <= 0) {
|
||||
overlay.style.display = 'none';
|
||||
panel.classList.add('drawable');
|
||||
enableCardClick();
|
||||
if (!lock.keyholderRequestedUnlock) {
|
||||
panel.classList.add('drawable');
|
||||
enableCardClick();
|
||||
}
|
||||
clearInterval(tickInterval); tickInterval = null;
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user