Etik94 commited on
Commit
0ac414a
·
verified ·
1 Parent(s): ce554d5

can you make a button with the name 'New Game' in the Congratulation Window and stay in this until the Button get clicked and go then to the begining - Follow Up Deployment

Browse files
Files changed (2) hide show
  1. index.html +24 -13
  2. prompts.txt +3 -1
index.html CHANGED
@@ -99,6 +99,10 @@
99
  <label class="block mb-2">Institution</label>
100
  <input type="text" class="w-full bg-white/10 border border-white/20 rounded-lg px-4 py-3 focus:outline-none focus:ring-2 focus:ring-pink-500">
101
  </div>
 
 
 
 
102
  <div class="flex items-center">
103
  <input type="checkbox" id="agb" class="mr-3 h-5 w-5 rounded border-white/30 bg-white/10 focus:ring-pink-500">
104
  <label for="agb">I accept the AGB</label>
@@ -235,9 +239,10 @@
235
  function checkForm() {
236
  const name = formInputs[0].value.trim();
237
  const institution = formInputs[1].value.trim();
238
- const agbChecked = formInputs[2].checked;
 
239
 
240
- if (name && institution && agbChecked) {
241
  startButton.disabled = false;
242
  } else {
243
  startButton.disabled = true;
@@ -346,26 +351,31 @@
346
  <div class="text-4xl animate-ping">🏆</div>
347
  <div class="text-4xl animate-bounce">⭐</div>
348
  </div>
 
 
 
349
  </div>
350
  `;
351
-
352
- // Save data to Excel (using SheetJS)
353
- const name = formInputs[0].value.trim();
354
- const institution = formInputs[1].value.trim();
355
- saveToExcel(name, institution, score);
356
-
357
- // Return to form after 5 seconds
358
- setTimeout(() => {
359
  gameArea.remove();
360
  document.querySelector('.bg-white\\/10').classList.remove('hidden');
361
  formInputs[0].value = '';
362
  formInputs[1].value = '';
363
- formInputs[2].checked = false;
 
364
  startButton.disabled = true;
365
- }, 5000);
 
 
 
 
 
 
 
366
  }
367
 
368
- function saveToExcel(name, institution, score) {
369
  // Using SheetJS to save data
370
  const script = document.createElement('script');
371
  script.src = 'https://cdn.sheetjs.com/xlsx-0.19.3/package/dist/xlsx.full.min.js';
@@ -383,6 +393,7 @@
383
  data.push({
384
  name,
385
  institution,
 
386
  score,
387
  date: new Date().toISOString()
388
  });
 
99
  <label class="block mb-2">Institution</label>
100
  <input type="text" class="w-full bg-white/10 border border-white/20 rounded-lg px-4 py-3 focus:outline-none focus:ring-2 focus:ring-pink-500">
101
  </div>
102
+ <div>
103
+ <label class="block mb-2">City</label>
104
+ <input type="text" class="w-full bg-white/10 border border-white/20 rounded-lg px-4 py-3 focus:outline-none focus:ring-2 focus:ring-pink-500">
105
+ </div>
106
  <div class="flex items-center">
107
  <input type="checkbox" id="agb" class="mr-3 h-5 w-5 rounded border-white/30 bg-white/10 focus:ring-pink-500">
108
  <label for="agb">I accept the AGB</label>
 
239
  function checkForm() {
240
  const name = formInputs[0].value.trim();
241
  const institution = formInputs[1].value.trim();
242
+ const city = formInputs[2].value.trim();
243
+ const agbChecked = formInputs[3].checked;
244
 
245
+ if (name && institution && city && agbChecked) {
246
  startButton.disabled = false;
247
  } else {
248
  startButton.disabled = true;
 
351
  <div class="text-4xl animate-ping">🏆</div>
352
  <div class="text-4xl animate-bounce">⭐</div>
353
  </div>
354
+ <button id="newGameBtn" class="mt-8 bg-white text-purple-900 hover:bg-purple-100 font-bold py-3 px-8 rounded-full transition-all transform hover:scale-105 shadow-lg text-xl">
355
+ New Game
356
+ </button>
357
  </div>
358
  `;
359
+
360
+ document.getElementById('newGameBtn').addEventListener('click', () => {
 
 
 
 
 
 
361
  gameArea.remove();
362
  document.querySelector('.bg-white\\/10').classList.remove('hidden');
363
  formInputs[0].value = '';
364
  formInputs[1].value = '';
365
+ formInputs[2].value = '';
366
+ formInputs[3].checked = false;
367
  startButton.disabled = true;
368
+ });
369
+
370
+ // Save data to Excel (using SheetJS)
371
+ const name = formInputs[0].value.trim();
372
+ const institution = formInputs[1].value.trim();
373
+ const city = formInputs[2].value.trim();
374
+ saveToExcel(name, institution, city, score);
375
+
376
  }
377
 
378
+ function saveToExcel(name, institution, city, score) {
379
  // Using SheetJS to save data
380
  const script = document.createElement('script');
381
  script.src = 'https://cdn.sheetjs.com/xlsx-0.19.3/package/dist/xlsx.full.min.js';
 
393
  data.push({
394
  name,
395
  institution,
396
+ city,
397
  score,
398
  date: new Date().toISOString()
399
  });
prompts.txt CHANGED
@@ -16,4 +16,6 @@ make the Congratulations Window more colorful
16
  it is not working in the Webside. Change it that it works
17
  delete it
18
  creat a new htlm link that is working for Web, phone and tablet
19
- Change the https name from Trouble Bubble into QOBubbleTrouble
 
 
 
16
  it is not working in the Webside. Change it that it works
17
  delete it
18
  creat a new htlm link that is working for Web, phone and tablet
19
+ Change the https name from Trouble Bubble into QOBubbleTrouble
20
+ Can you add a Feld called City and even that should be transfert into the same excel like the other once
21
+ can you make a button with the name 'New Game' in the Congratulation Window and stay in this until the Button get clicked and go then to the begining