home.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
  7. <title>Kvíz: Který učitel na GJS jsi ty?</title>
  8. <script src="https://cdn.tailwindcss.com"></script>
  9. <script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
  10. <style>
  11. body { background-color: #f0f4f8; }
  12. .gjs-blue { background-color: #0055a4; }
  13. .card { border-radius: 15px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
  14. </style>
  15. <script>
  16. function quizApp() {
  17. return {
  18. zacalqiz: false,
  19. otazky: [],
  20. async startQuiz() {
  21. this.zacalqiz = ! this.zacalqiz
  22. if (this.zacalqiz && !this.otazky.length) {
  23. const res = await fetch('/api/questions?count=5');
  24. this.otazky = await res.json();
  25. }
  26. }
  27. }
  28. }
  29. </script>
  30. </head>
  31. <body x-data="quizApp()">
  32. <template x-if="!zacalqiz">
  33. <div>
  34. <div >
  35. <h1>silly_qiz</h1>
  36. <h3 class="rainbow">toto bude mega giga silly qiz, aby jste mohli zjistit který z učítelů gimjs jste :3</h3>
  37. <a href="{{ url_for('index') }}">Začít kvíz</a>
  38. </div>
  39. </div>
  40. </template>
  41. <template x-if="zacalqiz">
  42. <div class="flex flex-col items-center justify-center min-h-screen p-4" x-data="{
  43. skoncilqiz: false,
  44. CurrentOtazka: 0,
  45. SvobodaBody: 0,
  46. SvobodovaBody: 0,
  47. ReditelkBody: 0,
  48. PasterikovaBody: 0,
  49. HelgertBody: 0,
  50. DominecBody: 0,
  51. DudilieuxBody: 0,
  52. HlavacekBody: 0,
  53. HolasovaBody: 0,
  54. BesinBody: 0,
  55. JilekBody: 0,
  56. JungovaBody: 0,
  57. HorovaBody: 0,
  58. KarnoltovaBody: 0,
  59. ValdaBody: 0,
  60. KozubekBody: 0,
  61. HrabecBody: 0,
  62. KubiskovaBody: 0,
  63. MarekBody: 0,
  64. LímanováBody: 0,
  65. NajemnikBody: 0,
  66. OrrBody: 0,
  67. AparicioBody: 0,
  68. HornicekBody: 0,
  69. SibaBody: 0,
  70. ToulecBody: 0,
  71. UlrichovaBody: 0,
  72. ZabranskaBody: 0,
  73. ZalskaBody: 0,
  74. SmidBody: 0,
  75. LafreniereBody: 0,
  76. StejskalBody: 0,
  77. EkrtovaBody: 0,
  78. BurdenovaBody: 0,
  79. VavraBody: 0
  80. }">
  81. <div class="card bg-white w-full max-w-lg p-6 border-t-8 border-blue-700">
  82. <h1 class="text-2xl font-bold text-center text-gray-800 mb-8">
  83. Který učitel na GJS jsi ty?
  84. </h1>
  85. <div class="mb-8">
  86. <p class="text-lg font-semibold text-gray-700 mb-4 text-center" x-text="otazky[CurrentOtazka]['question']"></p>
  87. <div class="space-y-3">
  88. <template x-for="(option, index) in otazky[CurrentOtazka]['options']" :key="index">
  89. <label class="block p-3 border rounded-lg cursor-pointer hover:bg-blue-50 transition">
  90. <input
  91. type="radio"
  92. name="q1"
  93. class="mr-2"
  94. :value="option"
  95. >
  96. <span x-text="option"></span>
  97. </label>
  98. </template>
  99. </div>
  100. </div>
  101. <div class="flex justify-between mt-10">
  102. <button class="px-6 py-2 bg-gray-200 text-gray-700 rounded font-bold hover:bg-gray-300 transition" x-on:click="CurrentOtazka = Math.max(CurrentOtazka - 1, 0)" x-bind:disabled="CurrentOtazka === 0">
  103. Předchozí
  104. </button>
  105. <button class="px-6 py-2 gjs-blue text-white rounded font-bold hover:opacity-90 transition" x-on:click="CurrentOtazka = Math.min(CurrentOtazka + 1, otazky.length - 1)" x-bind:disabled="CurrentOtazka >= otazky.length - 1">
  106. Další
  107. </button>
  108. </div>
  109. </div>
  110. </div>
  111. </template>
  112. <button @click="startQuiz()">Začít kvíz</button>
  113. </body>
  114. </html>