feat: Implement fade-in effect for comments and add database schema for custom emojis, pinned comments, and comment thread locking.
This commit is contained in:
@@ -55,7 +55,12 @@ class CommentSystem {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!scrollToId) this.container.innerHTML = '<div class="loading">Loading comments...</div>';
|
||||
// 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);
|
||||
|
||||
Reference in New Issue
Block a user