designtopack/src/components/project/virtual-sample/VirtualSample.vue

97 lines
2.4 KiB
Vue
Raw Normal View History

2024-10-28 18:18:32 +01:00
<template>
<Dialog
id="virtual-sample"
v-model:visible="isOpen"
modal
:draggable="false"
header="Titre du rendu"
class="dialog"
:class="{ 'with-comments': isCommentsOpen }"
:closeOnEscape="true"
>
<template #header>
<div class="dialog__tabs">
<button
class="btn btn--transparent | font-serif"
data-icon="cursor"
:aria-pressed="activeTab === 'dynamic' ? true : false"
@click="activeTab = 'dynamic'"
>
<span>Vue Dynamique</span>
</button>
<button
@click="activeTab = 'static'"
class="btn btn--transparent | font-serif"
data-icon="image"
:aria-pressed="activeTab === 'static' ? true : false"
>
<span>Vue statique</span>
</button>
</div>
<h2 class="font-serif text-lg">Titre du rendu</h2>
</template>
2024-11-13 07:46:32 +01:00
<Dynamic v-if="activeTab === 'dynamic'" />
<Static v-if="activeTab === 'static'" />
<template #footer>
<button
id="download-image"
class="btn btn--white-10"
data-icon="download"
>
<span>Sauvegarder limage</span>
</button>
<button
id="loop-animation"
class="btn btn--transparent btn--outline"
data-icon="loop"
>
<span>Animation en boucle</span>
</button>
<button
id="toggle-comments"
:aria-pressed="isCommentsOpen"
class="btn btn--transparent btn--outline"
data-icon="comment"
@click="isCommentsOpen = !isCommentsOpen"
>
<span class="sr-only">Afficher les commentaires</span>
</button>
<Comments
v-if="isCommentsOpen"
:current-page-index="currentPageIndex"
:file="file"
:comments="file.comments"
@update:file="changeFile"
/>
</template>
</Dialog>
2024-10-28 18:18:32 +01:00
</template>
<script setup>
2024-11-20 08:26:12 +01:00
import { storeToRefs } from "pinia";
import Dialog from "primevue/dialog";
import Dynamic from "./Dynamic.vue";
import Static from "./Static.vue";
import { ref } from "vue";
import { useDialogStore } from "../../../stores/dialog";
const { file } = defineProps({
file: Object,
});
2024-11-20 08:26:12 +01:00
const { comments } = storeToRefs(useDialogStore());
// Variables
2024-11-19 17:20:47 +01:00
const isOpen = ref(true);
const isCommentsOpen = ref(false);
const activeTab = ref("dynamic");
</script>
<style scoped>
.dialog__inner {
padding: var(--space-16);
}
</style>