Empereur-Pirate commited on
Commit
c191d97
·
verified ·
1 Parent(s): a96f53c

Update static/script.js

Browse files
Files changed (1) hide show
  1. static/script.js +7 -0
static/script.js CHANGED
@@ -28,9 +28,16 @@ const generateText = async (text) => {
28
 
29
  function handleFormSubmit(event) {
30
  event.preventDefault();
 
 
 
 
 
31
  console.log("Form submitted");
32
  const textGenInput = document.getElementById("text-gen-input");
33
  const textGenParagraph = document.querySelector(".text-gen-output");
34
 
35
  textGenParagraph.textContent = await generateText(textGenInput.value);
 
 
36
  }
 
28
 
29
  function handleFormSubmit(event) {
30
  event.preventDefault();
31
+ // Afficher l'image de chargement
32
+ const loader = document.querySelector('#loader');
33
+ const loadingImage = document.querySelector('#loading-image');
34
+ loader.classList.remove('hidden');
35
+ loader.classList.add('show');
36
  console.log("Form submitted");
37
  const textGenInput = document.getElementById("text-gen-input");
38
  const textGenParagraph = document.querySelector(".text-gen-output");
39
 
40
  textGenParagraph.textContent = await generateText(textGenInput.value);
41
+ loader.classList.remove('show');
42
+ loader.classList.add('hidden');
43
  }