add highlight to scrolled chat message

This commit is contained in:
Barış Soner Uşaklı
2026-02-18 18:21:04 -05:00
parent 16bbbab71a
commit f1113cfb1a
2 changed files with 23 additions and 0 deletions

View File

@@ -194,4 +194,21 @@ $hidden-elements-for-first-last-child: br, hr;
img.emoji {
height: $font-size-lg;
}
.highlight-pulse {
animation: pulse-grow 1.5s ease-in-out 3;
transform-origin: center;
z-index: 10;
}
@keyframes pulse-grow {
0%, 100% {
transform: scale(1);
background-color: transparent;
}
50% {
transform: scale(1.005);
background-color: var(--bs-tertiary-bg);
}
}

View File

@@ -75,6 +75,12 @@ define('forum/chats', [
messages.toggleScrollUpAlert(chatContentEl);
const scrollToEl = chatContentEl.find(`[data-index="${ajaxify.data.scrollToIndex - 1}"]`);
messages.scrollToMessageAfterImageLoad(chatContentEl, scrollToEl);
if (scrollToEl) {
scrollToEl.addClass('highlight-pulse');
setTimeout(() => {
scrollToEl.removeClass('highlight-pulse');
}, 5000);
}
} else {
messages.scrollToBottomAfterImageLoad(chatContentEl);
}