index.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <!DOCTYPE html>
  2. <meta charset="utf-8" />
  3. <html>
  4. <head>
  5. <script src="jquery-3.5.1.js"></script>
  6. <script src="comm.js"></script>
  7. <link rel="stylesheet" href="style.css">
  8. <title>Eichelhäutgerät</title>
  9. </head>
  10. <body>
  11. <div class="header">
  12. <h1>Welcome to Eichelhäutgerät</h1>
  13. </div>
  14. <aside class="side-control">
  15. <div id="side-info">
  16. <div id="lobby-control" style="display:none">
  17. <div id="lobby-info">
  18. </div>
  19. <h3>Connected Players</h3>
  20. <div id="player-list" class="player-list">
  21. </div>
  22. <button type="button" class="button" id="leave-lobby">Leave Lobby</button>
  23. </div>
  24. </div>
  25. </aside>
  26. <div class="main_container">
  27. <form id="loginform" class="loginform">
  28. <div class="row">
  29. <div class="label-col">
  30. <label for="gameId">Game ID:</label>
  31. </div>
  32. <div class="text-col">
  33. <input id="gameId" type="text" />
  34. </div>
  35. </div>
  36. <div class="row">
  37. <div class="label-col">
  38. <label for="nick">Nickname:</label>
  39. </div>
  40. <div class="text-col">
  41. <input id="nick" type="text" />
  42. </div>
  43. </div>
  44. <input id="join" type="button" value="Join" />
  45. <input id="create" type="button" value="Create Game" />
  46. </form>
  47. <div id="startingform" style="display:none">
  48. A new round is ready to be played. Click &quot;Ready&quot; to indicate that you are ready.
  49. <form>
  50. <input id="ready" type="button" value="Ready" />
  51. </form>
  52. </div>
  53. <div id="creating" style="margin: 0px; display:none">
  54. <table class="qtable">
  55. <tr><td style="border:none; vertical-align:top">
  56. <div class="questiontext">
  57. Create a word sounding like...
  58. <div class="question-box" id="question-box">
  59. </div>
  60. </div>
  61. </td><td style="border:none; vertical-align:top">
  62. ... using the following letters:
  63. <div class="letter-box" id="letter-box">
  64. </div>
  65. </td></tr>
  66. </table>
  67. <form id="createform">
  68. <label for="word">Word:</label>
  69. <input id="word" type="text" /><br>
  70. <input id="submit" type="button" value="Submit Word" />
  71. </form>
  72. </div>
  73. <div id="guessing" style="display:none">
  74. You now have to guess!<br><br>
  75. <div id="guessingDynTable">
  76. </div>
  77. <form id="guessingform">
  78. <div id="guessingDyn">
  79. </div>
  80. <input id="submitGuess" type="button" value="Submit Guess" />
  81. </form>
  82. <div id="guessing-draggame" style="display: flex;flex-direction: row; min-height: 110px;">
  83. <script lang="javascript">
  84. function allowDrag(e) {
  85. e.preventDefault();
  86. }
  87. function drag(e) {
  88. e.dataTransfer.setData("id", e.target.id);
  89. }
  90. function drop(e) {
  91. e.preventDefault();
  92. var id = e.dataTransfer.getData("id");
  93. var target = e.target;
  94. while (!target.classList.contains("question-dropzone") && !target.classList.contains("question-dropsource"))
  95. target = target.parentNode;
  96. var occupyingDrop = target.querySelector(".question-dropelement");
  97. var element = document.getElementById(id);
  98. if (occupyingDrop != null && !target.classList.contains("question-dropsource")) {
  99. element.parentNode.appendChild(occupyingDrop);
  100. }
  101. target.appendChild(element);
  102. }
  103. </script>
  104. <div id="dropzones" style="flex: 1;">
  105. <div id="qdz1" class="question-dropzone" ondragover="allowDrag(event)" ondrop="drop(event)">
  106. q1
  107. </div>
  108. <div id="qdz2" class="question-dropzone" ondragover="allowDrag(event)" ondrop="drop(event)">
  109. q2
  110. </div>
  111. </div>
  112. <div id="qdz-source" class="question-dropsource" ondragover="allowDrag(event)" ondrop="drop(event)" style="flex: 1">
  113. <p id="qde1" class="question-dropelement" draggable="true" ondragstart="drag(event)">
  114. a1
  115. </p>
  116. <p id="qde2" class="question-dropelement" draggable="true" ondragstart="drag(event)">
  117. a2
  118. </p>
  119. <p id="qde3" class="question-dropelement" draggable="true" ondragstart="drag(event)">
  120. ae
  121. </p>
  122. <p id="qde4" class="question-dropelement" draggable="true" ondragstart="drag(event)">
  123. wea2
  124. </p>
  125. <p id="qde5" class="question-dropelement" draggable="true" ondragstart="drag(event)">
  126. aqqqwq2
  127. </p>
  128. <p id="qde6" class="question-dropelement" draggable="true" ondragstart="drag(event)">
  129. aganz langa text wo muas azeigt werda
  130. </p>
  131. </div>
  132. </div>
  133. </div>
  134. <div id="results" style="margin-top: 20px; display:none">
  135. </div>
  136. <div id="status">
  137. </div>
  138. </div>
  139. </body>
  140. </html>