2024-08-11 16:54:49 +00:00
|
|
|
<template>
|
|
|
|
<v-carousel v-if="!loading" show-arrows="hover" cycle hide-delimiters progress="primary">
|
|
|
|
<v-carousel-item v-for="(item, i) in items" :key="i">
|
|
|
|
<v-sheet color="rgba(0, 0, 0, .4)" class="h-full w-full flex items-center justify-center post-container overflow-scroll">
|
2024-08-16 12:07:20 +00:00
|
|
|
<post-item class="mt-5 mb-2" force-show-content :post="item" />
|
2024-08-11 16:54:49 +00:00
|
|
|
</v-sheet>
|
|
|
|
</v-carousel-item>
|
|
|
|
</v-carousel>
|
2024-08-12 07:55:15 +00:00
|
|
|
<div v-else class="w-full h-full flex items-center justify-center">
|
2024-08-11 16:54:49 +00:00
|
|
|
<v-progress-circular indeterminate />
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
const config = useRuntimeConfig()
|
|
|
|
|
|
|
|
const items = ref<any[]>([])
|
|
|
|
|
|
|
|
const loading = ref(false)
|
|
|
|
|
|
|
|
async function load() {
|
|
|
|
loading.value = true
|
|
|
|
|
2024-08-18 16:44:35 +00:00
|
|
|
const res = await fetch(`${config.public.solarNetworkApi}/cgi/co/posts?take=5&realm=${config.public.solarRealm}`)
|
2024-08-11 16:54:49 +00:00
|
|
|
const result = await res.json()
|
|
|
|
|
|
|
|
items.value.push(...result.data)
|
|
|
|
|
|
|
|
loading.value = false
|
|
|
|
}
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
load()
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.post-container::-webkit-scrollbar {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.post-container {
|
|
|
|
-ms-overflow-style: none;
|
|
|
|
scrollbar-width: none;
|
|
|
|
}
|
|
|
|
</style>
|