From 39a196fb1c101c574f0d2c504b9c4902aaf04420 Mon Sep 17 00:00:00 2001 From: SauceyRed Date: Sun, 3 Aug 2025 20:41:02 +0200 Subject: [PATCH] style(ui): add highlighting of reply when scrolled to --- components/UserInterface/MessageReply.vue | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/components/UserInterface/MessageReply.vue b/components/UserInterface/MessageReply.vue index f60c0bc..c3efd2b 100644 --- a/components/UserInterface/MessageReply.vue +++ b/components/UserInterface/MessageReply.vue @@ -46,11 +46,22 @@ onMounted(async () => { function scrollToReply(e: MouseEvent) { e.preventDefault(); console.log("clicked on reply box"); - const reply = document.querySelector(`.message[data-message-id="${props.replyId}"]`); - if (reply) { + let replyId: string; + if (props.maxWidth == "reply") { + replyId = props.replyId; + } else { + replyId = props.id; + } + const reply = document.querySelector(`.message[data-message-id="${replyId}"]`); + if (reply instanceof HTMLDivElement) { console.log("reply:", reply); console.log("scrolling into view"); reply.scrollIntoView({ behavior: "smooth", block: "center" }); + reply.style.transition = "background-color .3s"; + reply.style.backgroundColor = "var(--primary-highlighted-color)"; + setTimeout(() => { + reply.style.backgroundColor = ""; + }, 1000); } }