2024-09-26 17:21:24 +02:00
|
|
|
<template>
|
2024-11-21 11:27:14 +01:00
|
|
|
<section
|
|
|
|
|
class="flex-1"
|
|
|
|
|
:aria-labelledby="step.id"
|
2024-11-21 11:47:36 +01:00
|
|
|
:data-status="setStatus(page.steps, page.content.currentstep, step)"
|
2024-11-21 11:27:14 +01:00
|
|
|
>
|
2024-11-18 16:21:07 +01:00
|
|
|
<h2 :id="step.id">
|
|
|
|
|
<span :data-icon="step.id">{{ step.label }}</span>
|
|
|
|
|
</h2>
|
2025-01-09 09:41:58 +01:00
|
|
|
<div ref="cards-node" class="cards | flow">
|
2025-01-08 17:09:56 +01:00
|
|
|
<component :is="cardsMap[step.id]" :step="step" />
|
2024-11-18 16:21:07 +01:00
|
|
|
</div>
|
2024-09-26 17:21:24 +02:00
|
|
|
</section>
|
|
|
|
|
</template>
|
2024-09-26 19:14:20 +02:00
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
import dayjs from "dayjs";
|
|
|
|
|
import "dayjs/locale/fr";
|
2024-10-16 15:32:24 +02:00
|
|
|
import { usePageStore } from "../../stores/page";
|
2025-01-07 17:31:05 +01:00
|
|
|
import { computed, onMounted, useTemplateRef } from "vue";
|
2024-11-21 11:27:14 +01:00
|
|
|
import { useProjectStore } from "../../stores/project";
|
2024-12-20 07:19:46 +01:00
|
|
|
import ClientBrief from "./cards/ClientBrief.vue";
|
2024-12-20 08:05:55 +01:00
|
|
|
import MultipleDocuments from "./cards/MultipleDocuments.vue";
|
|
|
|
|
import SimpleDocument from "./cards/SimpleDocument.vue";
|
|
|
|
|
import VirtualSample from "./cards/VirtualSample.vue";
|
|
|
|
|
import PhysicalSample from "./cards/PhysicalSample.vue";
|
2024-09-26 19:14:20 +02:00
|
|
|
|
|
|
|
|
const { step } = defineProps({
|
|
|
|
|
step: Object,
|
|
|
|
|
});
|
2024-10-16 15:32:24 +02:00
|
|
|
|
2024-12-20 07:19:46 +01:00
|
|
|
const cardsMap = {
|
|
|
|
|
clientBrief: ClientBrief,
|
2024-12-20 08:05:55 +01:00
|
|
|
proposal: MultipleDocuments,
|
|
|
|
|
extendedBrief: SimpleDocument,
|
|
|
|
|
industrialIdeation: SimpleDocument,
|
|
|
|
|
virtualSample: VirtualSample,
|
|
|
|
|
physicalSample: PhysicalSample,
|
2024-12-20 07:19:46 +01:00
|
|
|
};
|
|
|
|
|
|
2024-10-16 15:32:24 +02:00
|
|
|
dayjs.locale("fr");
|
|
|
|
|
|
|
|
|
|
const { page } = usePageStore();
|
2024-11-21 11:27:14 +01:00
|
|
|
const { setStatus } = useProjectStore();
|
2025-01-09 09:41:58 +01:00
|
|
|
const cardsNode = useTemplateRef("cards-node");
|
2024-10-16 15:32:24 +02:00
|
|
|
|
2024-10-16 17:32:15 +02:00
|
|
|
const steps = page.steps.map((item) => {
|
|
|
|
|
return item.value;
|
|
|
|
|
});
|
2024-10-16 15:32:24 +02:00
|
|
|
|
2024-11-20 15:31:41 +01:00
|
|
|
const mergedFiles = computed(() => {
|
|
|
|
|
if (step.id !== "virtualSample") return false;
|
|
|
|
|
|
|
|
|
|
const staticFiles = step.files?.static ?? [];
|
|
|
|
|
const dynamicFiles = step.files?.dynamic ?? [];
|
|
|
|
|
|
|
|
|
|
return [...staticFiles, ...dynamicFiles];
|
|
|
|
|
});
|
2024-12-17 16:56:21 +01:00
|
|
|
|
2025-01-07 17:31:05 +01:00
|
|
|
// Hooks
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
if (step.id === page.content.currentstep) {
|
2025-01-09 09:41:58 +01:00
|
|
|
cardsNode.value.scrollIntoView({
|
2025-01-07 17:31:05 +01:00
|
|
|
behavior: "smooth",
|
|
|
|
|
inline: "center",
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Functions
|
2024-12-17 16:56:21 +01:00
|
|
|
function getFrontView(track) {
|
|
|
|
|
if (track.files.length === 1) return track.files[0];
|
|
|
|
|
const xMax = parseInt(
|
|
|
|
|
track.files[track.files.length - 1].name.split("_")[1].split(".")[0]
|
|
|
|
|
);
|
|
|
|
|
const xFrontView = (xMax + 1) / 2;
|
|
|
|
|
const extension = track.files[0].name.split(".")[1];
|
|
|
|
|
const frontViewName = "0_" + xFrontView + "." + extension;
|
|
|
|
|
const frontView = track.files.find((file) => file.name === frontViewName);
|
|
|
|
|
return frontView;
|
|
|
|
|
}
|
2024-09-26 19:14:20 +02:00
|
|
|
</script>
|
2024-12-11 16:00:00 +01:00
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.physical-sample header {
|
|
|
|
|
color: var(--color-white);
|
2024-12-16 17:52:49 +01:00
|
|
|
background: linear-gradient(
|
|
|
|
|
90deg,
|
|
|
|
|
hsla(0, 0%, 10%, 0.5) 0%,
|
|
|
|
|
hsla(0, 0%, 10%, 0.9) 50%,
|
|
|
|
|
hsla(0, 0%, 10%, 0.9) 100%
|
|
|
|
|
),
|
|
|
|
|
var(--cover), var(--color-black);
|
2024-12-11 16:00:00 +01:00
|
|
|
background-repeat: no-repeat;
|
|
|
|
|
background-size: cover;
|
|
|
|
|
}
|
|
|
|
|
.physical-sample header > * {
|
|
|
|
|
padding-inline: var(--space-16);
|
|
|
|
|
}
|
|
|
|
|
.physical-sample header h3 {
|
|
|
|
|
position: initial;
|
|
|
|
|
}
|
|
|
|
|
</style>
|