2024-09-25 17:33:28 +02:00
|
|
|
|
<template>
|
|
|
|
|
|
<section
|
|
|
|
|
|
class="h-full | flex flex-col justify-center items-center | mx-auto | max-w"
|
|
|
|
|
|
style="--max-w: 42rem; --row-gap: var(--space-32)"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="flex">
|
|
|
|
|
|
<div
|
2024-10-08 17:29:59 +02:00
|
|
|
|
@click="emit('update:step', 'Images')"
|
2024-09-25 17:33:28 +02:00
|
|
|
|
class="card card--cta | flex-1 | h-full"
|
|
|
|
|
|
style="--padding: var(--space-32); --row-gap: var(--space-32)"
|
|
|
|
|
|
>
|
|
|
|
|
|
<svg
|
|
|
|
|
|
aria-hidden="true"
|
|
|
|
|
|
width="100"
|
|
|
|
|
|
height="100"
|
|
|
|
|
|
viewBox="0 0 100 100"
|
|
|
|
|
|
fill="none"
|
|
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
|
|
>
|
2024-10-14 15:23:06 +02:00
|
|
|
|
<!-- SVG content -->
|
2024-09-25 17:33:28 +02:00
|
|
|
|
</svg>
|
|
|
|
|
|
<h2 class="font-serif text-lg">Créer via la plateforme</h2>
|
|
|
|
|
|
<p class="text-sm text-grey-700">
|
|
|
|
|
|
Ajouter différents éléments tels que des images et du texte sur la
|
|
|
|
|
|
plateforme afin de créer votre brief.
|
|
|
|
|
|
</p>
|
|
|
|
|
|
</div>
|
2024-10-14 15:23:06 +02:00
|
|
|
|
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="file"
|
|
|
|
|
|
@change="addPdf($event)"
|
|
|
|
|
|
accept="application/pdf"
|
|
|
|
|
|
ref="pdfInput"
|
|
|
|
|
|
/>
|
2024-09-25 17:33:28 +02:00
|
|
|
|
</div>
|
2024-10-14 15:23:06 +02:00
|
|
|
|
|
2024-09-25 17:33:28 +02:00
|
|
|
|
<div
|
|
|
|
|
|
class="card | bg-grey-200 | items-center | text-center | w-full"
|
|
|
|
|
|
style="--padding: var(--space-32); --row-gap: var(--space-16)"
|
|
|
|
|
|
>
|
|
|
|
|
|
<h2 class="font-serif text-lg">Qu’est ce que le brief ?</h2>
|
|
|
|
|
|
<p class="text-sm text-grey-700">
|
|
|
|
|
|
Le brief est un outil créatif qui permet de définir les perspectives
|
2024-10-14 15:23:06 +02:00
|
|
|
|
esthétiques de votre projet.
|
2024-09-25 17:33:28 +02:00
|
|
|
|
</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</section>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup>
|
2024-10-14 15:23:06 +02:00
|
|
|
|
import { ref } from "vue";
|
|
|
|
|
|
import { usePageStore } from "../../../stores/page";
|
|
|
|
|
|
import { storeToRefs } from "pinia";
|
|
|
|
|
|
|
2024-09-25 17:33:28 +02:00
|
|
|
|
const emit = defineEmits("update:step");
|
2024-10-14 15:23:06 +02:00
|
|
|
|
|
|
|
|
|
|
const { page } = storeToRefs(usePageStore());
|
|
|
|
|
|
const pdfInput = ref(null);
|
|
|
|
|
|
|
|
|
|
|
|
async function addPdf(event) {
|
|
|
|
|
|
const file = event.target.files[0];
|
|
|
|
|
|
|
|
|
|
|
|
if (file) {
|
|
|
|
|
|
const formData = new FormData();
|
|
|
|
|
|
formData.append("file", file);
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
const response = await fetch(
|
|
|
|
|
|
"/upload-pdf.json?pageUri=" + page.value.uri,
|
|
|
|
|
|
{
|
|
|
|
|
|
method: "POST",
|
|
|
|
|
|
body: formData,
|
|
|
|
|
|
}
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
const result = await response.json();
|
|
|
|
|
|
|
|
|
|
|
|
if (response.ok) {
|
|
|
|
|
|
console.log("File uploaded successfully.");
|
|
|
|
|
|
page.value = result;
|
|
|
|
|
|
emit("update:step", "PdfViewer");
|
|
|
|
|
|
} else {
|
|
|
|
|
|
console.error("Error uploading file:", result.error);
|
|
|
|
|
|
}
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
|
console.error("Request failed:", error);
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
console.error("No file selected.");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-09-25 17:33:28 +02:00
|
|
|
|
</script>
|
2024-10-14 15:23:06 +02:00
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
input[type="file"] {
|
|
|
|
|
|
display: block;
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|