add alternative controls
This commit is contained in:
@@ -9023,6 +9023,28 @@ html[theme="f0ck95d"] .badge-dark {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.steuerung.steuerung-icon {
|
||||
font-size: x-large;
|
||||
}
|
||||
|
||||
.steuerung.steuerung-icon a {
|
||||
color: white;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 1.6em;
|
||||
transition: color 0.15s ease, transform 0.15s ease;
|
||||
}
|
||||
|
||||
.steuerung.steuerung-icon a:hover {
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
.steuerung.steuerung-icon .fa-solid {
|
||||
font-size: 0.85em;
|
||||
}
|
||||
|
||||
|
||||
.blahlol {
|
||||
grid-column: 1 / 4;
|
||||
width: 100%;
|
||||
|
||||
@@ -9099,6 +9099,16 @@ if (navigator.vibrate) {
|
||||
}, { passive: true });
|
||||
}
|
||||
|
||||
// ── Steuerung icon style: #scrolltobottom smooth scroll ───────────────────────
|
||||
// The alternative icon nav replaces the Zufall link with a down-chevron that
|
||||
// scrolls the page to the bottom (comments / tag section).
|
||||
document.addEventListener('click', (e) => {
|
||||
const link = e.target.closest('a.steuerung-scroll-down');
|
||||
if (!link) return;
|
||||
e.preventDefault();
|
||||
window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' });
|
||||
});
|
||||
|
||||
// ── Spoiler Tags Event Delegation ─────────────────────────────────────────────
|
||||
(function() {
|
||||
const isHidden = (el) => el && el.classList && (el.classList.contains('spoiler') || el.classList.contains('blur-text'));
|
||||
|
||||
@@ -670,6 +670,37 @@
|
||||
});
|
||||
}
|
||||
|
||||
// Alternative Steuerung Toggle (icon-only nav style)
|
||||
const alternativeSteuerungToggle = document.getElementById('alternative_steuerung_toggle');
|
||||
if (alternativeSteuerungToggle) {
|
||||
alternativeSteuerungToggle.addEventListener('change', async () => {
|
||||
const use_alternative_steuerung = alternativeSteuerungToggle.checked;
|
||||
try {
|
||||
const res = await fetch('/api/v2/settings/alternative_steuerung', {
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'X-CSRF-Token': window.f0ckSession?.csrf_token
|
||||
},
|
||||
body: new URLSearchParams({ use_alternative_steuerung })
|
||||
});
|
||||
const data = await res.json();
|
||||
if (data.success) {
|
||||
showStatus('Navigation style updated!', 'success');
|
||||
if (window.f0ckSession) window.f0ckSession.use_alternative_steuerung = use_alternative_steuerung;
|
||||
} else {
|
||||
alert(data.msg || 'Error saving preference');
|
||||
alternativeSteuerungToggle.checked = !use_alternative_steuerung;
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
alert('Failed to save navigation style preference');
|
||||
alternativeSteuerungToggle.checked = !use_alternative_steuerung;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Notification Preferences Toggles
|
||||
const setupPreferenceToggle = (id, sessionKey) => {
|
||||
const el = document.getElementById(id);
|
||||
|
||||
Reference in New Issue
Block a user