First_level1.cshtml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. @model NEducation.Models.WinnerMiniGameModel
  2. <div class="body_first">
  3. <div class="container">
  4. <h1>MINIGAME</h1>
  5. <p>Let me know your answers!</p>
  6. <button class="play-now" onclick="redirectToGame()">PLAY NOW</button>
  7. <div class="tabs">
  8. <button class="tab" onclick="redirectToRank()">RANKING</button>
  9. <button class="tab" onclick="showHowToPlay()">HOW TO PLAY</button>
  10. </div>
  11. <!-- Placeholder for ranking content -->
  12. <div id="rankingContent"></div>
  13. <div id="howToPlayContent" style="display: none;">
  14. <div class="container_howtoplay">
  15. <ol>
  16. <li>The mini-game starts at 10:00 AM every Sunday.</li>
  17. <li>You have 15 seconds to think and give your answer.</li>
  18. <li>Each person can only participate in the minigame once per day. If there is a system error during the minigame, the participant cannot play again, and it will be counted as one play.</li>
  19. <li>Participants must be subscribers of the service.</li>
  20. <li>The minigame consists of 20 questions.</li>
  21. <li>Each question must be answered within 15 seconds.</li>
  22. <li>If a participant answers incorrectly, the game will immediately end, and they will not be able to play again.</li>
  23. <li>
  24. Prizes:
  25. <ul>
  26. <li>There is only one prize for the participant who correctly answers all 20 questions the fastest. The prize is $20 added to Emoney.</li>
  27. <li>If multiple participants answer correctly with the same time, the prize money will be evenly divided among them.</li>
  28. </ul>
  29. </li>
  30. <li>Results will be sent to the participants via SMS at 09:00 AM on the following Monday.</li>
  31. </ol>
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. <style>
  37. .body_first {
  38. font-family: Arial, sans-serif;
  39. background: #D6641F;
  40. display: flex;
  41. justify-content: center;
  42. align-items: center;
  43. height: 100vh;
  44. margin: 0;
  45. }
  46. .container {
  47. text-align: center;
  48. background: #D6641F;
  49. border-radius: 10px;
  50. }
  51. h1 {
  52. color: white;
  53. }
  54. button.play-now {
  55. background-color: #ff6347;
  56. color: white;
  57. border: none;
  58. padding: 10px 20px;
  59. font-size: 16px;
  60. cursor: pointer;
  61. border-radius: 5px;
  62. }
  63. button.play-now:hover {
  64. background-color: #ff4500;
  65. }
  66. .tabs {
  67. margin-top: 20px;
  68. }
  69. button.tab {
  70. background-color: #f0f0f0;
  71. border: none;
  72. padding: 10px 20px;
  73. margin: 5px;
  74. cursor: pointer;
  75. border-radius: 5px;
  76. }
  77. button.tab:hover {
  78. background-color: #dcdcdc;
  79. }
  80. #rankingContent, #howToPlayContent {
  81. margin-top: 20px;
  82. }
  83. .container_howtoplay {
  84. font-family: Arial, sans-serif;
  85. background-color: #D6641F;
  86. padding: 20px;
  87. border-radius: 10px;
  88. box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  89. margin-top: 20px;
  90. text-align: left;
  91. }
  92. .container_howtoplay ol {
  93. padding-left: 20px;
  94. margin: 0;
  95. list-style-position: outside;
  96. line-height: 1.6; /* Tăng line-height để dễ đọc hơn */
  97. }
  98. .container_howtoplay li {
  99. margin-bottom: 10px;
  100. color: #ffffff;
  101. font-size: 14px; /* Đảm bảo kích thước chữ hợp lý */
  102. }
  103. .container_howtoplay ul {
  104. padding-left: 40px;
  105. list-style-type: disc;
  106. margin: 0;
  107. list-style-position: outside;
  108. }
  109. .container_howtoplay ul li {
  110. margin-bottom: 5px;
  111. font-size: 14px; /* Đảm bảo kích thước chữ hợp lý */
  112. }
  113. </style>
  114. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  115. <script>
  116. function redirectToGame() {
  117. window.location.href = '@Url.Action("Play", "MiniGame")';
  118. }
  119. function redirectToRank() {
  120. $.ajax({
  121. url: '@Url.Action("GetRanking", "MiniGame")',
  122. type: 'GET',
  123. success: function (result) {
  124. $('#rankingContent').html(result);
  125. $('#rankingContent').show();
  126. $('#howToPlayContent').hide();
  127. },
  128. error: function () {
  129. $('#rankingContent').html('<p>Error loading ranking.</p>');
  130. }
  131. });
  132. }
  133. function showHowToPlay() {
  134. $('#rankingContent').hide();
  135. $('#howToPlayContent').css('display', 'block'); // Đảm bảo hiển thị đầy đủ
  136. }
  137. </script>