animation et responsive

This commit is contained in:
2026-08-05 18:28:33 +02:00
parent 15d3087fe4
commit 7e467f9b1a
3 changed files with 86 additions and 19 deletions
+39 -17
View File
@@ -290,30 +290,52 @@ document
const response =
await fetch(
"/edt.pdf",
{
const submitButton = document.getElementById("submit-button");
const loader =
document.querySelector(".loader");
const iframe =
document.getElementById("pdf_iframe");
submitButton.disabled = true;
loader.style.display = "block";
try {
const response =
await fetch("/edt.pdf", {
method: "POST",
headers: {
"Content-Type":
"application/json"
"Content-Type": "application/json"
},
body:
JSON.stringify({
cours
})
}
);
body: JSON.stringify({ cours })
});
if (!response.ok)
throw new Error("Erreur lors de la génération du PDF.");
const blob =
await response.blob();
const blob =
await response.blob();
const url =
URL.createObjectURL(blob);
window.open(
URL.createObjectURL(blob)
);
iframe.src = url;
iframe.style.display = "block";
} catch (err) {
console.error(err);
alert(err.message);
} finally {
loader.style.display = "none";
submitButton.disabled = false;
}
}
);