import { timeout } from '@/lib/utils/dom'; export const highlightAnimationByClass = (clazz: string, animation: string) => { const allAnimations = Array.from( document.getElementsByClassName(clazz) as HTMLCollectionOf, ).map((element) => { element.style.animation = animation; return timeout(() => (element.style.animation = null), 1000); }); return Promise.all(allAnimations); }; export const isVisible = (element: HTMLElement) => { return element?.style?.display !== 'none'; };