<script setup lang="ts">
import Background from "./Background.vue";
import Buttons from "./Buttons.vue";
import LinkConfirmationPopup from "./LinkConfirmationPopup.vue";

const store = useProjectsStore();

onMounted(async () => {
  store.$reset();
  await store.loadProjects();
});

watch(
  () => store.loading,
  () => {
    if (!store.loading) {
      store.animateIntro();
    }
  },
);
</script>

<template>
  <template v-if="!store.loading">
    <Background />
    <Buttons />
    <LinkConfirmationPopup v-if="store.showConfirmationPopup" />
  </template>
</template>
