diff --git a/src/components/ContentPanel.tsx b/src/components/ContentPanel.tsx index 76f80d76..6bf73346 100644 --- a/src/components/ContentPanel.tsx +++ b/src/components/ContentPanel.tsx @@ -44,12 +44,12 @@ const ContentPanel: React.FC = ({ console.log('📍 Scrolling to highlight in article:', selectedHighlightId.slice(0, 8)) markElement.scrollIntoView({ behavior: 'smooth', block: 'center' }) - // Temporarily enhance the highlight to show it's selected - const originalBackground = (markElement as HTMLElement).style.background - ;(markElement as HTMLElement).style.background = 'rgba(255, 255, 0, 0.7)' + // Add pulsing animation to show it's selected + const htmlElement = markElement as HTMLElement + htmlElement.classList.add('highlight-pulse') setTimeout(() => { - (markElement as HTMLElement).style.background = originalBackground + htmlElement.classList.remove('highlight-pulse') }, 1500) } else { console.log('⚠️ Could not find mark element for highlight:', selectedHighlightId.slice(0, 8)) diff --git a/src/index.css b/src/index.css index 604b6fdb..3d1bb1e7 100644 --- a/src/index.css +++ b/src/index.css @@ -1374,6 +1374,29 @@ body { box-shadow: 0 0 12px rgba(255, 255, 0, 0.3); } +.content-highlight.highlight-pulse { + animation: highlight-pulse-animation 1.5s ease-in-out; +} + +@keyframes highlight-pulse-animation { + 0%, 100% { + box-shadow: 0 0 8px rgba(255, 255, 0, 0.2); + transform: scale(1); + } + 25% { + box-shadow: 0 0 20px rgba(255, 255, 0, 0.6); + transform: scale(1.02); + } + 50% { + box-shadow: 0 0 8px rgba(255, 255, 0, 0.2); + transform: scale(1); + } + 75% { + box-shadow: 0 0 20px rgba(255, 255, 0, 0.6); + transform: scale(1.02); + } +} + .reader-html .content-highlight, .reader-markdown .content-highlight { color: inherit;