diff --git a/public/s/css/f0ckm.css b/public/s/css/f0ckm.css index 0025501..39d4e6a 100644 --- a/public/s/css/f0ckm.css +++ b/public/s/css/f0ckm.css @@ -8351,7 +8351,7 @@ input#s_avatar { .nav-user-menu a { display: block; - padding: 10px 15px; + padding: 10px 10px; color: var(--white); text-decoration: none; transition: background 0.2s; @@ -8722,6 +8722,8 @@ video.autoplay-gif { text-align: center; background: var(--bg); border-bottom: 1px solid var(--nav-link-hover-bg); +border-left: 1px solid var(--nav-border-color); + border-right: 1px solid var(--nav-border-color); } /* Markdown Styles */ diff --git a/public/s/js/comments.js b/public/s/js/comments.js index 641ba63..ce9daea 100644 --- a/public/s/js/comments.js +++ b/public/s/js/comments.js @@ -120,6 +120,8 @@ class CommentSystem { if (!document.body.classList.contains('layout-legacy') && !document.body.classList.contains('legacy-view')) return; const updateBtn = () => { + if (!this.initialLoadDone) return; + const btn = document.querySelector('.scroll-to-bottom'); if (!btn) return; @@ -128,7 +130,9 @@ class CommentSystem { const rect = container.getBoundingClientRect(); // Detect if we are at the bottom of the comments section - const isAtBottom = rect.bottom < window.innerHeight + 100; + // We also require window.scrollY > 50 to prevent flickering to 'scroll to top' + // when the page first loads and images haven't fully pushed the container down yet. + const isAtBottom = (rect.bottom < window.innerHeight + 100) && (window.scrollY > 50); if (isAtBottom) { btn.classList.add('is-at-bottom'); @@ -673,6 +677,7 @@ class CommentSystem { this.render(comments, this.user, initialIsSubscribed); this.initialLoadDone = true; this.restoreState(state); + if (this.scrollHandler) this.scrollHandler(); this._loadDanmaku(comments); if (scrollToId) { @@ -743,6 +748,7 @@ class CommentSystem { this.reconcile(data.comments, data.user_id, data.is_subscribed); this.initialLoadDone = true; this.restoreState(state); + if (this.scrollHandler) this.scrollHandler(); if (scrollToId) { this.preservingScroll = false; @@ -772,6 +778,7 @@ class CommentSystem { this.render(data.comments, data.user_id, data.is_subscribed); this.initialLoadDone = true; this.restoreState(state); + if (this.scrollHandler) this.scrollHandler(); this._loadDanmaku(data.comments); if (scrollToId) { diff --git a/src/index.mjs b/src/index.mjs index 914a2b3..3cc4611 100644 --- a/src/index.mjs +++ b/src/index.mjs @@ -1358,11 +1358,11 @@ process.on('uncaughtException', err => { globals.lang = perRequestLang; // Resolve per-request infobox preference - // Guests always get false — the alternative infobox is a logged-in user preference only + // Guests check the new config flag, whereas users use their session pref or default to the user flag const useAltInfobox = (req && req.session && typeof req.session.use_alternative_infobox === 'boolean') ? req.session.use_alternative_infobox : (req && !req.session - ? false + ? (cfg.websrv.guest_alternative_infobox === true) : (data && typeof data.user_alternative_infobox === 'boolean' ? data.user_alternative_infobox : (cfg.websrv.user_alternative_infobox !== false))); diff --git a/views/snippets/footer.html b/views/snippets/footer.html index 6decbda..c211967 100644 --- a/views/snippets/footer.html +++ b/views/snippets/footer.html @@ -102,7 +102,7 @@ @if(session) @include(snippets/metadata-modal) @endif -@if((!private_society || session) && enable_sidebar) +@if(!private_society && enable_sidebar || session && enable_sidebar)