index.vue 878 B

1234567891011121314151617181920212223242526272829303132333435
  1. <script setup lang="ts">
  2. import { TresCanvas } from '@tresjs/core'
  3. import TheExperience from './TheExperience.vue'
  4. const state = reactive({
  5. hasFinishLoading: false,
  6. progress: 0,
  7. })
  8. provide('gltf-loader-state', state)
  9. </script>
  10. <template>
  11. <div class="relative h-full w-full">
  12. <Transition
  13. name="fade-overlay"
  14. enter-active-class="opacity-1 transition-opacity duration-200"
  15. leave-active-class="opacity-0 transition-opacity duration-200"
  16. >
  17. <div
  18. v-show="!state.hasFinishLoading"
  19. class="absolute bg-white t-0 l-0 w-full h-full z-20 flex justify-center items-center text-black font-mono"
  20. >
  21. <div class="w-200px">
  22. Loading...
  23. {{ state.progress }} %
  24. </div>
  25. </div>
  26. </Transition>
  27. <TresCanvas clear-color="#C0ffee">
  28. <TheExperience />
  29. </TresCanvas>
  30. </div>
  31. </template>