mirror of
https://github.com/dergigi/boris.git
synced 2026-02-09 09:04:38 +01:00
fix: delay pulse animation to let scroll complete first
- Add 500ms delay before starting pulse animation - Prevents pulse from starting while element is still scrolling - Creates better visual flow: scroll → pause → pulse - Makes the highlight easier to track with your eyes The pulse now starts after the smooth scroll completes, making it much clearer which highlight you jumped to.
This commit is contained in:
@@ -44,13 +44,15 @@ const ContentPanel: React.FC<ContentPanelProps> = ({
|
||||
console.log('📍 Scrolling to highlight in article:', selectedHighlightId.slice(0, 8))
|
||||
markElement.scrollIntoView({ behavior: 'smooth', block: 'center' })
|
||||
|
||||
// Add pulsing animation to show it's selected
|
||||
// Add pulsing animation after scroll completes
|
||||
const htmlElement = markElement as HTMLElement
|
||||
htmlElement.classList.add('highlight-pulse')
|
||||
|
||||
setTimeout(() => {
|
||||
htmlElement.classList.remove('highlight-pulse')
|
||||
}, 1500)
|
||||
htmlElement.classList.add('highlight-pulse')
|
||||
|
||||
setTimeout(() => {
|
||||
htmlElement.classList.remove('highlight-pulse')
|
||||
}, 1500)
|
||||
}, 500) // Delay to let scroll animation complete
|
||||
} else {
|
||||
console.log('⚠️ Could not find mark element for highlight:', selectedHighlightId.slice(0, 8))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user