mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-06 15:06:38 +02:00
add highlight to scrolled chat message
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user