2024-10-28 18:18:32 +01:00
|
|
|
|
<template>
|
2024-10-30 16:41:29 +01:00
|
|
|
|
<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">
|
2024-11-05 14:14:40 +01:00
|
|
|
|
<button
|
|
|
|
|
|
class="btn btn--transparent | font-serif"
|
2024-10-30 16:41:29 +01:00
|
|
|
|
data-icon="cursor"
|
|
|
|
|
|
aria-pressed="true"
|
|
|
|
|
|
>
|
|
|
|
|
|
<span>Vue Dynamique</span>
|
|
|
|
|
|
</button>
|
2024-11-05 14:14:40 +01:00
|
|
|
|
<button class="btn btn--transparent | font-serif" data-icon="image">
|
2024-10-30 16:41:29 +01:00
|
|
|
|
<span>Vue statique</span>
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<h2 class="font-serif text-lg">Titre du rendu</h2>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<div class="dialog__inner">
|
|
|
|
|
|
<header class="flex">
|
|
|
|
|
|
<div class="options-selector">
|
2024-11-05 14:14:40 +01:00
|
|
|
|
<button
|
2024-11-20 08:26:12 +01:00
|
|
|
|
v-for="(track, index) in tracks"
|
2024-10-30 16:41:29 +01:00
|
|
|
|
class="btn btn--image"
|
2024-11-20 08:26:12 +01:00
|
|
|
|
:aria-pressed="activeTrack === track ? true : false"
|
|
|
|
|
|
:aria-controls="track.slug"
|
|
|
|
|
|
:style="`--btn-image: url(${track.files[7].url});`"
|
2024-11-20 08:39:26 +01:00
|
|
|
|
@click="
|
|
|
|
|
|
activeTrack = track;
|
|
|
|
|
|
currentX = 0;
|
|
|
|
|
|
"
|
2024-10-30 16:41:29 +01:00
|
|
|
|
>
|
2024-11-20 08:26:12 +01:00
|
|
|
|
<span>{{ track.title }}</span>
|
2024-10-30 16:41:29 +01:00
|
|
|
|
</button>
|
|
|
|
|
|
</div>
|
2024-11-05 14:14:40 +01:00
|
|
|
|
<button class="btn | ml-auto">
|
2024-10-30 16:41:29 +01:00
|
|
|
|
<span>Comparer les pistes</span>
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</header>
|
2024-11-13 07:46:32 +01:00
|
|
|
|
|
2024-11-20 08:26:12 +01:00
|
|
|
|
<!-- -->
|
|
|
|
|
|
<div id="container">
|
|
|
|
|
|
<figure>
|
|
|
|
|
|
<img :src="currentFile.url" alt="" />
|
|
|
|
|
|
</figure>
|
|
|
|
|
|
<fieldset>
|
|
|
|
|
|
<input
|
|
|
|
|
|
id="x"
|
|
|
|
|
|
type="range"
|
|
|
|
|
|
min="0"
|
|
|
|
|
|
:max="xMax"
|
|
|
|
|
|
:steps="xMax + 1"
|
|
|
|
|
|
value="0"
|
|
|
|
|
|
/>
|
|
|
|
|
|
<input
|
|
|
|
|
|
id="y"
|
|
|
|
|
|
type="range"
|
|
|
|
|
|
min="0"
|
|
|
|
|
|
:max="yMax"
|
|
|
|
|
|
:steps="yMax + 1"
|
|
|
|
|
|
orient="vertical"
|
|
|
|
|
|
value="0"
|
|
|
|
|
|
/>
|
|
|
|
|
|
<button
|
|
|
|
|
|
id="y-up"
|
|
|
|
|
|
@click="currentY++"
|
|
|
|
|
|
:disabled="currentY === yMax.length"
|
|
|
|
|
|
>
|
|
|
|
|
|
Top
|
|
|
|
|
|
</button>
|
|
|
|
|
|
<button id="x-down" @click="currentX--" :disabled="currentX === 0">
|
|
|
|
|
|
Left
|
|
|
|
|
|
</button>
|
|
|
|
|
|
<button
|
|
|
|
|
|
id="x-up"
|
|
|
|
|
|
@click="currentX++"
|
|
|
|
|
|
:disabled="currentX === xMax.length"
|
|
|
|
|
|
>
|
|
|
|
|
|
Right
|
|
|
|
|
|
</button>
|
|
|
|
|
|
<button id="y-down" @click="currentY--" :disabled="currentY === 0">
|
|
|
|
|
|
Bottom
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</fieldset>
|
|
|
|
|
|
</div>
|
2024-10-30 16:41:29 +01:00
|
|
|
|
</div>
|
|
|
|
|
|
<template #footer>
|
2024-11-05 14:14:40 +01:00
|
|
|
|
<button
|
2024-10-30 16:41:29 +01:00
|
|
|
|
id="download-image"
|
2024-11-05 14:14:40 +01:00
|
|
|
|
class="btn btn--white-10"
|
2024-10-30 16:41:29 +01:00
|
|
|
|
data-icon="download"
|
|
|
|
|
|
>
|
|
|
|
|
|
<span>Sauvegarder l’image</span>
|
|
|
|
|
|
</button>
|
2024-11-05 14:14:40 +01:00
|
|
|
|
<button
|
2024-10-30 16:41:29 +01:00
|
|
|
|
id="loop-animation"
|
2024-11-05 14:14:40 +01:00
|
|
|
|
class="btn btn--transparent btn--outline"
|
2024-10-30 16:41:29 +01:00
|
|
|
|
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>
|
2024-10-30 16:41:29 +01:00
|
|
|
|
|
|
|
|
|
|
<script setup>
|
2024-11-20 08:26:12 +01:00
|
|
|
|
import { storeToRefs } from "pinia";
|
2024-10-30 16:41:29 +01:00
|
|
|
|
import Dialog from "primevue/dialog";
|
2024-11-20 08:26:12 +01:00
|
|
|
|
import { computed, ref } from "vue";
|
|
|
|
|
|
import { usePageStore } from "../../stores/page";
|
|
|
|
|
|
import { useDialogStore } from "../../stores/dialog";
|
2024-10-30 16:41:29 +01:00
|
|
|
|
|
|
|
|
|
|
const { file } = defineProps({
|
|
|
|
|
|
file: Object,
|
|
|
|
|
|
});
|
2024-11-20 08:26:12 +01:00
|
|
|
|
const { page } = storeToRefs(usePageStore());
|
|
|
|
|
|
const { comments } = storeToRefs(useDialogStore());
|
|
|
|
|
|
|
|
|
|
|
|
const tracks = computed(
|
|
|
|
|
|
() => page.value.steps[page.value.steps.length - 1].files
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
const activeTrack = ref(tracks.value[0]);
|
|
|
|
|
|
const yMax = computed(() => {
|
|
|
|
|
|
return parseInt(
|
|
|
|
|
|
activeTrack.value.files[activeTrack.value.files.length - 1].name.charAt(0)
|
|
|
|
|
|
);
|
|
|
|
|
|
});
|
|
|
|
|
|
const xMax = computed(() => {
|
|
|
|
|
|
return parseInt(
|
|
|
|
|
|
activeTrack.value.files[activeTrack.value.files.length - 1].name
|
|
|
|
|
|
.split("_")[1]
|
|
|
|
|
|
.split(".")[0]
|
|
|
|
|
|
);
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const currentX = ref(0);
|
|
|
|
|
|
const currentY = ref(0);
|
|
|
|
|
|
const currentFileIndex = computed(() => currentY.value + "_" + currentX.value);
|
|
|
|
|
|
const currentFile = computed(() =>
|
|
|
|
|
|
activeTrack.value.files.find((file) =>
|
|
|
|
|
|
file.name.includes(currentFileIndex.value)
|
|
|
|
|
|
)
|
|
|
|
|
|
);
|
2024-10-30 16:41:29 +01:00
|
|
|
|
|
|
|
|
|
|
// Variables
|
2024-11-19 17:20:47 +01:00
|
|
|
|
const isOpen = ref(true);
|
2024-10-30 16:41:29 +01:00
|
|
|
|
const isCommentsOpen = ref(false);
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
.dialog__inner {
|
|
|
|
|
|
padding: var(--space-16);
|
|
|
|
|
|
}
|
2024-11-20 08:26:12 +01:00
|
|
|
|
|
|
|
|
|
|
#container {
|
|
|
|
|
|
--w: 500px;
|
|
|
|
|
|
--h: 500px;
|
|
|
|
|
|
--x-steps: 14;
|
|
|
|
|
|
--y-steps: 5;
|
|
|
|
|
|
width: var(--w);
|
|
|
|
|
|
height: var(--h);
|
|
|
|
|
|
background-color: dimgray;
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#container figure {
|
|
|
|
|
|
padding: 0;
|
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
}
|
|
|
|
|
|
#container img {
|
|
|
|
|
|
display: block;
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
inset: 0;
|
|
|
|
|
|
width: inherit;
|
|
|
|
|
|
height: inherit;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#container fieldset {
|
|
|
|
|
|
--p: 1rem;
|
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
padding: 0;
|
|
|
|
|
|
width: var(--w);
|
|
|
|
|
|
height: var(--h);
|
|
|
|
|
|
border: none;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#container button,
|
|
|
|
|
|
input {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#x {
|
|
|
|
|
|
left: 0;
|
|
|
|
|
|
bottom: calc(-1 * var(--p));
|
|
|
|
|
|
right: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
#y {
|
|
|
|
|
|
top: 0;
|
|
|
|
|
|
bottom: 0;
|
|
|
|
|
|
right: calc(-1 * var(--p));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#y-up {
|
|
|
|
|
|
top: var(--p);
|
|
|
|
|
|
}
|
|
|
|
|
|
#y-down {
|
|
|
|
|
|
bottom: var(--p);
|
|
|
|
|
|
}
|
|
|
|
|
|
#y-up,
|
|
|
|
|
|
#y-down {
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
left: 50%;
|
|
|
|
|
|
transform: translateX(-50%);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#x-down {
|
|
|
|
|
|
left: var(--p);
|
|
|
|
|
|
}
|
|
|
|
|
|
#x-up {
|
|
|
|
|
|
right: var(--p);
|
|
|
|
|
|
}
|
|
|
|
|
|
#x-down,
|
|
|
|
|
|
#x-up {
|
|
|
|
|
|
top: 50%;
|
|
|
|
|
|
transform: translateY(-50%);
|
|
|
|
|
|
}
|
2024-10-30 16:41:29 +01:00
|
|
|
|
</style>
|