Index.cshtml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. @{
  2. ViewData["Title"] = "Home Page";
  3. }
  4. @using WebChallenge.Extensions
  5. @using WebChallenge.Controllers
  6. @{
  7. UserInfo userInfo = Context.Session.GetComplexData<UserInfo>("userInfo");
  8. string isdn = userInfo.msisdn.Substring(3);
  9. }
  10. <div class="main-content logo-background glass-background h-dvh relative z-0">
  11. <div class="h-full">
  12. <div class="h-full flex flex-col">
  13. <div class="overflow-auto flex-grow-1 relative z-10 h-full flex flex-col">
  14. <div class="mt-4 mx-4 px-1 rounded-3xl">
  15. <div class="flex justify-between">
  16. <button id="exitBtn" onclick="showModal('exitModal')"
  17. class="w-10 h-10 rounded-full flex justify-center items-center bg-[#F20] border border-white">
  18. <img src="../assets/icons/exit.svg" alt="exit" />
  19. </button>
  20. <a href="/Home/Setting"
  21. class="w-10 h-10 rounded-full flex justify-center items-center bg-[#2EA929] border border-white">
  22. <img src="../assets/icons/setting.svg" alt="setting" />
  23. </a>
  24. </div>
  25. </div>
  26. <div class="flex flex-col flex-grow justify-center">
  27. <div class="flex flex-col items-center gap-[5px] justify-center -mt-1 h-full max-h-[175px]">
  28. <img src="../assets/icons/logo.svg" alt="movitel_challenges.png" class="max-w-[40px] max-h-[45px]" />
  29. <img src="../assets/images/movitel_challenges.png" alt="movitel_challenges.png"
  30. class="max-w-[14.125rem] max-h-[7.5625rem]" />
  31. </div>
  32. @if (userInfo.isactive == "0")
  33. {
  34. <div class="flex justify-between pt-[2px]">
  35. <div onclick="register('DAILY')"
  36. class="text-white uppercase relative z-10 h-[55px] w-[147px] hover:cursor-pointer pulse-animation">
  37. <div class="absolute w-full h-full z-0">
  38. <img src="../assets/images/image_1.png" alt="image 1" class="w-full"
  39. style="height: calc(100% + 11px)">
  40. </div>
  41. <div class="relative z-10 h-full flex flex-col justify-end pl-2 pb-[3px]">
  42. <p class="text-[2rem] italic font-black leading-none">@Lang.Daily</p>
  43. <p class="text-[0.6875rem] italic font-black leading-none flex items-center gap-2">
  44. @Lang.package <img src="../assets/icons/arrow-to-right.svg" alt="arrow" />
  45. </p>
  46. </div>
  47. </div>
  48. <div onclick="register('WEEKLY')"
  49. class="text-white uppercase relative z-10 h-[55px] w-[147px] hover:cursor-pointer pulse-animation">
  50. <div class="absolute w-full h-full z-0">
  51. <img src="../assets/images/image_3.png" alt="image 1" class="w-full"
  52. style="height: calc(100% + 11px)">
  53. </div>
  54. <div class="relative z-10 h-full flex flex-col justify-end pr-2 pb-[3px]">
  55. <p class="text-[1.5625rem] italic font-black leading-none text-end">@Lang.Weekly</p>
  56. <p class="text-[0.6875rem] italic font-black leading-none flex items-center justify-end gap-2">
  57. <img src="../assets/icons/arrow-to-left.svg" alt="arrow" class="translate-y-[180deg]" />
  58. @Lang.package
  59. </p>
  60. </div>
  61. </div>
  62. </div>
  63. }
  64. <div class="mt-[2.31rem] flex flex-col gap-5 items-center">
  65. @if (userInfo.remain_turn > 0)
  66. {
  67. <a href="/Home/CheckPlay"
  68. class="play-button max-w-[17.375rem] w-full py-5 text-[#5A5A5A] text-[2.5rem] leading-[2.025rem] font-Alatsi text-center pulse-animation">
  69. @Lang.Play
  70. </a>
  71. }
  72. <a href="/Home/BuyTurn"
  73. class="max-w-[17.375rem] w-full py-1 px-[0.625rem] rounded-[1.25rem] border border-white bg-1 font-Alatsi text-white text-2xl text-center pulse-animation">
  74. @Lang.BuyTurn
  75. </a>
  76. </div>
  77. <div class="mb-[2.07rem]">
  78. <div class="flex justify-center items-center relative mt-10">
  79. <img src="../assets/icons/arrow_1.svg" alt="arrow 1"
  80. class="absolute left-0 w-[81.7px] h-[129.2px] z-10" />
  81. <a href="/Home/Ranking" class="relative w-full h-full">
  82. <img src="../assets/images/Group-35.png" alt="arrow 2"
  83. class="z-0 overflow-hidden absolute top-0 h-full w-full" />
  84. <p class="relative w-full text-center uppercase text-white font-Alatsi text-[2rem] font-normal py-[0.53rem] px-[0.625rem] z-10 pulse-animation">
  85. @Lang.RankingCoin
  86. </p>
  87. </a>
  88. <img src="../assets/icons/arrow_2.svg" alt="arrow 2"
  89. class="absolute right-0 w-[81.7px] h-[129.2px] overflow-hidden" />
  90. </div>
  91. <div class="mt-[1.38rem] px-16">
  92. <div class="flex items-center gap-3">
  93. <img src="../assets/icons/coin.svg" alt="icons" />
  94. <div class="flex justify-between flex-grow">
  95. <p class="text-white text-2xl">@Lang.MyCoin</p>
  96. <p class="text-[#FDB514] text-end font-black text-2xl">@userInfo.score</p>
  97. </div>
  98. </div>
  99. <hr class="my-3 h-[0.5px]" />
  100. <div class="flex items-center gap-3">
  101. <img src="../assets/icons/start-fill.svg" alt="icons" />
  102. <div class="flex justify-between flex-grow">
  103. <p class="text-white text-2xl">@Lang.turns</p>
  104. <p class="text-[#FDB514] text-end font-black text-2xl" id="remainTurn">@userInfo.remain_turn</p>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112. </div>
  113. @Html.Partial("_Navigation")
  114. </div>
  115. @section Scripts {
  116. <script>
  117. var getUrlParameter = function getUrlParameter(sParam) {
  118. var sPageURL = window.location.search.substring(1),
  119. sURLVariables = sPageURL.split('&'),
  120. sParameterName,
  121. i;
  122. for (i = 0; i < sURLVariables.length; i++) {
  123. sParameterName = sURLVariables[i].split('=');
  124. if (sParameterName[0] === sParam) {
  125. return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]);
  126. }
  127. }
  128. return false;
  129. };
  130. //function hideModal(modalName) {
  131. // $("#" + modalName).modal('hide');
  132. //}
  133. //function showModal(id) {
  134. // $("#" + id).modal('show');
  135. //}
  136. $(document).ready(function () {
  137. var gameOver = getUrlParameter("gameover");
  138. var stage = getUrlParameter("stage");
  139. if (gameOver == '1' && stage != null && stage != '0') {
  140. // show game over & score
  141. $("#challengeOver").html(stage);
  142. showModal('dialogGameOver');
  143. }
  144. });
  145. function homepage() {
  146. location.href = "/Home/Index";
  147. }
  148. //$(".play-now").click(function () {
  149. // // start play
  150. //});
  151. //$(".btn-register").click(function () {
  152. // //showModal('confirm-otp');
  153. //});
  154. //function checkPlay() {
  155. // let remainTurn = parseInt($("#remainTurn").html());
  156. // if (remainTurn <= 0) {
  157. // // show dialog
  158. // $("#dialog-failed-message").html('Lang.OutOfTurn');
  159. // showModal("failed-register");
  160. // } else {
  161. // // send check play
  162. // $.ajax({
  163. // url: "/Home/CheckPlay",
  164. // data: {
  165. // },
  166. // type: "POST",
  167. // success: function (data) {
  168. // if (data.error == "0") {
  169. // // redirect to play
  170. // location.href = data.href;
  171. // } else {
  172. // // show dialog
  173. // $("#dialog-info-message").html(data.content);
  174. // showModal("dialog-info");
  175. // }
  176. // },
  177. // error: function (data) {
  178. // console.log(data);
  179. // }
  180. // });
  181. // }
  182. //}
  183. </script>
  184. }