designtopack/src/components/project/PhysicalSample.vue

51 lines
1.4 KiB
Vue
Raw Normal View History

2024-12-11 15:05:40 +01:00
<template>
2024-12-11 15:07:13 +01:00
<Dialog
id="physical-sample"
v-model:visible="isOpen"
modal
:draggable="false"
2025-09-09 09:37:34 +02:00
:dismissableMask="true"
2024-12-11 15:07:13 +01:00
class="dialog"
:closeOnEscape="true"
2025-09-09 09:37:34 +02:00
:style="'--cover: url(' + physicalSample.cover + ')'"
2024-12-11 15:07:13 +01:00
>
2025-09-09 09:37:34 +02:00
<template #header>
<h2 class="text-lg font-serif">{{ physicalSample.title }}</h2>
<time class="font-medium text-sm py-8" :datetime="physicalSample.date">{{
physicalSample.date
}}</time>
<p>{{ physicalSample.description }}</p>
2025-09-09 09:37:34 +02:00
</template>
<div class="overflow-y h-full mt-32 pb-32">
<div class="masonry flow pb-32">
2024-12-18 16:01:01 +01:00
<template v-for="(item, index) in physicalSample.files" :key="item.id">
2025-09-09 09:37:34 +02:00
<img
class="rounded-xl"
:src="item.url"
:alt="item.alt"
:data-id="item.id"
/>
2024-12-18 16:01:01 +01:00
</template>
</div>
</div>
2024-12-11 15:07:13 +01:00
</Dialog>
2024-12-11 15:05:40 +01:00
</template>
<script setup>
2025-09-09 09:37:34 +02:00
import Dialog from 'primevue/dialog';
import { ref, watch } from 'vue';
import { useDialogStore } from '../../stores/dialog';
import { useRoute, useRouter } from 'vue-router';
import { usePageStore } from '../../stores/page.js';
2024-12-11 15:05:40 +01:00
// Variables
const router = useRouter();
const route = useRoute();
const isOpen = ref(true);
watch(isOpen, (newValue) => {
router.push({ name: route.name });
});
const { page } = usePageStore();
const physicalSample = page.steps[page.steps.length - 1];
2024-12-11 15:05:40 +01:00
</script>