From 624e9d5b6bf3a8d0965fb2a2c8ed5d2e5e1ca88c Mon Sep 17 00:00:00 2001 From: x Date: Sun, 25 Jan 2026 14:20:59 +0100 Subject: [PATCH] feat: Implement fade-in effect for comments and add database schema for custom emojis, pinned comments, and comment thread locking. --- public/s/js/comments.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/public/s/js/comments.js b/public/s/js/comments.js index 6d33705..9df9553 100644 --- a/public/s/js/comments.js +++ b/public/s/js/comments.js @@ -55,7 +55,12 @@ class CommentSystem { return; } - if (!scrollToId) this.container.innerHTML = '
Loading comments...
'; + // Initialize with opacity 0 for fade-in + if (!scrollToId) { + this.container.innerHTML = ''; + this.container.style.opacity = '0'; + this.container.style.transition = 'opacity 0.5s ease'; + } try { const res = await fetch(`/api/comments/${this.itemId}?sort=${this.sort}`); @@ -72,6 +77,11 @@ class CommentSystem { this.isLocked = data.is_locked || false; this.render(data.comments, data.user_id, data.is_subscribed); + // Trigger fade-in + requestAnimationFrame(() => { + this.container.style.opacity = '1'; + }); + // Priority: Explicit ID > Hash if (scrollToId) { this.scrollToComment(scrollToId);