import { createApp } from 'vue'
import App from './App.vue'
import './styles/theme.css'

if ('scrollRestoration' in history) {
  history.scrollRestoration = 'manual'
}

if (!window.location.hash) {
  const scrollToTop = () => window.scrollTo(0, 0)

  scrollToTop()
  requestAnimationFrame(scrollToTop)
  window.addEventListener('load', scrollToTop, { once: true })
  window.addEventListener('pageshow', scrollToTop, { once: true })
  window.setTimeout(scrollToTop, 120)
  window.setTimeout(scrollToTop, 360)
}

createApp(App).mount('#app')
