no dependencies, works with animated elements, simple api,
typescript, modern, can highlight multiple elements
const boxOverlay = new BoxOverlay()
const selectors = [
['.example-element1'],
['.example-element2'],
['.example-element3'],
['.example-element1', '.example-element2'],
]
let currentIndex = 0
setInterval(() => {
currentIndex+=1
currentIndex = currentIndex >= selectors.length ? 0 : currentIndex
boxOverlay.clear()
selectors[currentIndex].forEach(boxOverlay.add)
}, 3000)