<template>
  <div class="pptScreen">
    <Screen v-if="!initLoading" />
  </div>
</template>

<script setup lang="ts">
import Screen from "../Screen/index.vue"
import { ref } from "vue"
import { useSlidesStore } from "@/store"
import { getHttpJson } from "@/libs/jsonTool"

const slidesStore = useSlidesStore()

const initLoading = ref(true)

getHttpJson("data.json").then(res => {
  if (res.code === 200) {
    const { width, theme, slides } = res.data
    console.log(res.data)
    slidesStore.setViewportSize(width)
    slidesStore.setViewportRatio(theme.viewportRatio)
    slidesStore.setTheme(theme)
    slidesStore.setSlides(slides)
    initLoading.value = false
  }
})
</script>

<style lang="scss" scoped>
.pptScreen {
  width: 100%;
  height: 100%;
}
</style>
