Skip to content

Commit

Permalink
simplifications
Browse files Browse the repository at this point in the history
  • Loading branch information
martrapp committed Oct 30, 2024
1 parent 9bf44e3 commit d8b18b2
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/vanilla.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,11 @@ function init() {
self.crossingStorage = crossing.fun;
}

document.addEventListener('astro:after-preparation', () => {
pageSwap();
});
document.addEventListener('astro:after-swap', () => {
pageReveal();
});
document.addEventListener('astro:after-preparation', pageSwap);
document.addEventListener('astro:after-swap', pageReveal);

self.addEventListener('onpageswap' in self ? 'pageswap' : 'pagehide', pageSwap, { once: true });
self.addEventListener('onpagereveal' in self ? 'pagereveal' : 'DOMContentLoaded', pageReveal, {
once: true,
});
self.addEventListener('onpageswap' in self ? 'pageswap' : 'pagehide', pageSwap);
self.addEventListener('onpagereveal' in self ? 'pagereveal' : 'DOMContentLoaded', pageReveal);
}

function pageSwap() {
Expand Down

0 comments on commit d8b18b2

Please sign in to comment.