scroll to top button for mobile

This commit is contained in:
2026-05-31 18:48:45 +02:00
parent 08cdada5bc
commit 994039370c
4 changed files with 23 additions and 1 deletions

View File

@@ -2192,7 +2192,7 @@ body.sidebar-right-hidden .global-sidebar-right {
} }
} }
/* Common sizing for the Legacy content area */
.item-layout-container .item-main-content>._204863, .item-layout-container .item-main-content>._204863,
.item-layout-container .item-main-content>.item_title, .item-layout-container .item-main-content>.item_title,
.item-layout-container .item-main-content>.content, .item-layout-container .item-main-content>.content,
@@ -9132,6 +9132,15 @@ html[theme="f0ck95d"] .badge-dark {
color: var(--accent); color: var(--accent);
} }
.mobile-scroll-to-top {
background: none;
border: none;
color: var(--white);
position: absolute;
bottom: 20px;
cursor: pointer;
}
.steuerung.steuerung-icon .fa-solid { .steuerung.steuerung-icon .fa-solid {
font-size: 0.85em; font-size: 0.85em;
} }

View File

@@ -9183,6 +9183,16 @@ document.addEventListener('click', (e) => {
window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' }); window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' });
}); });
// ── Mobile scroll-to-top button ───────────────────────────────────────────────
// Visible only on mobile (≤999px), appears below #comments-container so users
// can easily get back to the top after reading comments.
document.addEventListener('click', (e) => {
if (!e.target.closest('.mobile-scroll-to-top')) return;
e.preventDefault();
window.scrollTo({ top: 0, behavior: 'smooth' });
if (navigator.vibrate) navigator.vibrate(20);
});
// ── Spoiler Tags Event Delegation ───────────────────────────────────────────── // ── Spoiler Tags Event Delegation ─────────────────────────────────────────────
(function() { (function() {
const isHidden = (el) => el && el.classList && (el.classList.contains('spoiler') || el.classList.contains('blur-text')); const isHidden = (el) => el && el.classList && (el.classList.contains('spoiler') || el.classList.contains('blur-text'));

View File

@@ -205,6 +205,7 @@
</div> </div>
@endif @endif
</div> </div>
<button class="mobile-scroll-to-top" title="Back to top" aria-label="Scroll to top"><i class="fa-solid fa-chevron-up"></i></button>
<script id="initial-subscription" type="application/json">{{ isSubscribed }}</script> <script id="initial-subscription" type="application/json">{{ isSubscribed }}</script>
</div> </div>

View File

@@ -51,6 +51,8 @@
</span> </span>
</div> </div>
<button class="mobile-scroll-to-top" title="Back to top" aria-label="Scroll to top"><i class="fa-solid fa-chevron-up"></i></button>
</div> </div>
{{-- MAIN CONTENT: media + navigation + metadata --}} {{-- MAIN CONTENT: media + navigation + metadata --}}