diff options
Diffstat (limited to 'smoke/astro.build-main/src/scripts/animations.ts')
-rw-r--r-- | smoke/astro.build-main/src/scripts/animations.ts | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/smoke/astro.build-main/src/scripts/animations.ts b/smoke/astro.build-main/src/scripts/animations.ts deleted file mode 100644 index 2171ebc38..000000000 --- a/smoke/astro.build-main/src/scripts/animations.ts +++ /dev/null @@ -1,21 +0,0 @@ -async function loop(element: Element) { - const animations = element.getAnimations({ subtree: true }); - await Promise.all(animations.map(anim => anim.finished)); - // reset the animation after 3.5 seconds - setTimeout(() => { - const clone = element.cloneNode(true) - element.replaceWith(clone); - loop(clone as Element); - }, 3500) -} - -function setup() { - const illustrations = Array.from(document.querySelectorAll('.illustration')); - const hydrate = illustrations.find(el => (el as HTMLElement).dataset.name === 'hydration'); - loop(hydrate); -} -setup(); - -window.addEventListener('astro:navchange', () => { - setup(); -}); |