Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/martrapp/astro-vtbot.
The 👜 Bag of Tricks ✨ for Astro's View Transitions.
⭐️ Please star to support events-3bg.pages.dev
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758---export interface Props { top?: string; bottom?: string; left?: string; right?: string; src?: string;}const { top = '', bottom = '', left = '', right = '', src = '' } = Astro.props;---
<meta name="vtbot-loading-indicator" content=`${top};${bottom};${left};${right};${src}` /><script> import { initialize, vtbotLoadingIndicator } from './loading-indicator'; const data = document.querySelectorAll("meta[name='vtbot-loading-indicator']"); const [top, bottom, left, right, src] = data.length > 0 ? (data[data.length - 1] as HTMLMetaElement).content.split(';') : ['', '', '', '', '']; initialize(() => vtbotLoadingIndicator({ top, bottom, left, right, src }), true);</script>
<style is:global> @layer vtbot { @keyframes vtbot-blink { 0%, 30% { opacity: 0; } 40% { opacity: 0.5; } 50%, 60% { opacity: 0; } 80% { opacity: 0.3; } }
#vtbot-loading-indicator { position: fixed; width: min(10vw, 10vh); z-index: 1000; opacity: 0; } #vtbot-loading-indicator img { width: min(10vw, 10vh); height: auto; }
html.loading #vtbot-loading-indicator { animation: vtbot-blink 1s infinite; } }</style>