GameHome.cshtml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. @model LotteryWebApp.Models.HomeIndex_ViewModel
  2. @{
  3. ViewData["Title"] = "Millions - Game Home";
  4. Layout = "~/Areas/Millions/Views/Shared/_Layout.cshtml";
  5. }
  6. @using LotteryWebApp.Languages;
  7. @using LotteryWebApp.Controllers;
  8. @using LotteryWebApp.Common;
  9. @functions {
  10. public string FormatMoney(string amount) {
  11. if (string.IsNullOrEmpty(amount)) return "0";
  12. var clean = new string(amount.Where(c => char.IsDigit(c)).ToArray());
  13. if (long.TryParse(clean, out long val)) {
  14. return val.ToString("#,##0", new System.Globalization.CultureInfo("vi-VN")).Replace(",", ".");
  15. }
  16. return amount;
  17. }
  18. }
  19. @section Styles {
  20. <link rel="preconnect" href="https://fonts.googleapis.com">
  21. <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  22. <link href="https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800&family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,500;12..96,600;12..96,700;12..96,800&display=swap" rel="stylesheet">
  23. <link rel="stylesheet" href="/Millions/css/all.min.css"/>
  24. }
  25. <div class="main-content h-dvh w-full max-w-[430px] mx-auto bg-[#f5f7fb] relative overflow-hidden font-bricolage">
  26. <!-- Scrollable content area -->
  27. <div class="absolute inset-x-0 top-0 bottom-[88px] overflow-y-auto flex flex-col">
  28. <!-- Top section with header + cards -->
  29. <div class="relative">
  30. <!-- Header gradient background -->
  31. <div class="header-bg relative h-[160px] rounded-b-[40px] overflow-hidden">
  32. <!-- Top bar -->
  33. <div class="flex items-center justify-between px-3 pt-3 relative z-10">
  34. <button onclick='location.href=subDomain + "@Url.Action("Index", "Home", new { area = "LotteryV2" })";' class="js-back w-6 h-6 flex items-center justify-center">
  35. <img src="/Millions/assets/icons/arrow-left.svg" alt="Back" class="w-6 h-6"/>
  36. </button>
  37. <!-- <button class="flex items-center gap-2 bg-white/15 rounded-full px-3 py-1 text-white text-sm">
  38. <span>🏴󠁧󠁢󠁥󠁮󠁧󠁿 English</span>
  39. <img src="/Millions/assets/icons/chevron-down.svg" alt="" class="w-2 h-2"/>
  40. </button> -->
  41. </div>
  42. <!-- User profile -->
  43. <div class="flex items-center gap-4 px-4 -mt-2">
  44. <div class="w-[84px] h-[84px] rounded-full overflow-hidden bg-white/20 border-[3px] border-white shrink-0">
  45. <img src="/Millions/assets/images/avatar.png" alt="Avatar" class="w-full h-full object-cover"/>
  46. </div>
  47. <div class="flex-1 min-w-0">
  48. <p class="text-white text-base font-semibold leading-tight">@(Model?.profile?.users ?? "User")</p>
  49. <div class="mt-2 flex items-center justify-between gap-2 rounded-full border border-white/35 bg-white/10 px-3 py-2">
  50. <div class="flex items-center gap-1 min-w-0">
  51. <span class="text-3xl font-condensed text-gold-gradient leading-none truncate">@FormatMoney(Model?.userStatus?.bet_coin)</span>
  52. <img src="/Millions/assets/icons/coin.png" alt="" class="w-5 h-5 shrink-0"/>
  53. <span class="text-white text-sm shrink-0">@Lang.millions_htg</span>
  54. </div>
  55. <button type="button" onclick="transferWinMoney()" class="shrink-0 rounded-full px-3 py-2 min-h-[40px] w-[4.9rem] font-extrabold text-[#0a1f44] text-[9px] leading-[1.12] text-center active:scale-[0.98] transition-transform" style="background: linear-gradient(90deg, #ffcf0f 0%, #fff1b8 100%); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);">
  56. @Lang.millions_redeem_rewards
  57. </button>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. <!-- Floating info card -->
  63. <div class="absolute left-5 right-5 -bottom-[52px] bg-white rounded-2xl shadow-md flex items-center h-20 px-4">
  64. <div class="flex items-center gap-2 flex-1">
  65. <img src="/Millions/assets/icons/calendar.png" alt="" class="w-6 h-6"/>
  66. <div>
  67. <p class="text-xs text-[#797979]">@Lang.next_round</p>
  68. <p class="text-xs font-bold text-black" id="draw-date">Friday, Mar 20, 2026</p>
  69. </div>
  70. </div>
  71. <div class="w-px h-12 bg-gray-200"></div>
  72. <div class="flex items-center gap-2 flex-1 pl-4">
  73. <img src="/Millions/assets/icons/money-bag.png" alt="" class="w-6 h-[34px] object-contain"/>
  74. <div>
  75. <p class="text-xs text-[#797979]">@Lang.jackpot_prize</p>
  76. <p class="leading-none ">
  77. <span class="text-base font-extrabold text-[#002bff]">30.000.000</span><span class="text-[10.32px] font-extrabold text-black align-top">@Lang.millions_htg</span>
  78. </p>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. <!-- Result section -->
  84. <div class="px-4 mt-20">
  85. <div class="result-box rounded-[32px] py-3 flex flex-col gap-2">
  86. <div class="flex items-center justify-between px-4">
  87. <div class="flex items-center gap-2 text-xs">
  88. <span class="text-[#797979]">@Lang.results</span>
  89. <span class="font-bold text-black">Monday, Mar 20, 2026</span>
  90. </div>
  91. <a href="/Millions/Home/Results" class="flex items-center gap-1 text-[10px] font-bold text-black border border-[#c2c2c2] rounded-lg px-2 py-1">
  92. View all results
  93. <img src="/Millions/assets/icons/chevron-right.svg" alt="" class="w-[5px] h-2"/>
  94. </a>
  95. </div>
  96. <!-- Result balls -->
  97. <div class="flex items-center justify-between gap-1 px-4">
  98. <div class="ball ball-blue">7</div>
  99. <div class="ball ball-blue">16</div>
  100. <div class="ball ball-blue">32</div>
  101. <div class="ball ball-blue">35</div>
  102. <div class="ball ball-blue">40</div>
  103. <div class="relative">
  104. <img src="/Millions/assets/icons/crown.png" alt="" class="absolute -top-4 -right-1 w-7 h-auto pointer-events-none rotate-[15deg] z-0"/>
  105. <div class="ball ball-mb relative z-10">
  106. <span>12</span>
  107. <span class="absolute -bottom-1 -right-2 bg-[#ee0033] text-white text-[8px] font-bold px-1.5 py-0.5 rounded z-20">MB</span>
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112. </div>
  113. <!-- Mega Jackpot banner -->
  114. <div class="px-2 mt-6">
  115. <div class="mega-banner relative rounded-[20px] overflow-hidden px-4 py-3 flex flex-col">
  116. <span class="mega-glow" style="left:-79px; top:-101px;"></span>
  117. <span class="mega-glow" style="right:-78px; top:9px;"></span>
  118. <span class="mega-glow" style="right:-107px; top:20px;"></span>
  119. <p class="mega-title relative inline-block text-white text-[22px] font-futura leading-none">
  120. <img src="/Millions/assets/icons/crown.png" alt="" class="absolute -top-[5px] left-[26px] w-[12px] h-auto rotate-[10deg] pointer-events-none"/>
  121. Mega Jackpot
  122. </p>
  123. <p class="text-white text-xs mt-2">Estimate Jackpot Prize</p>
  124. <p class="leading-none mt-1 flex items-start" style="margin-bottom:18px;">
  125. <span class="mega-amount mega-jackpot-wiggle text-[40px] font-condensed text-gold-gradient tracking-tight leading-none">30.000.000</span>
  126. <span class="mega-jackpot-wiggle text-gold-gradient text-sm font-bold uppercase ml-1">@Lang.v2_htg</span>
  127. </p>
  128. <p class="text-white text-[10px] mt-1 ">Be the next millionaire</p>
  129. <!-- Decorative elements -->
  130. <img src="/Millions/assets/images/crown-balls.png" alt="" class="absolute right-2 top-1/2 -translate-y-1/2 w-44 h-auto pointer-events-none"/>
  131. </div>
  132. </div>
  133. <!-- Play now button + decorative balls -->
  134. <div class="relative shrink-0 mt-8 z-10">
  135. <img src="/Millions/assets/images/play-decor.png" alt="" class="block w-full h-auto pointer-events-none"/>
  136. <a onclick="checkTerm('@Constants.Millions_CODE')" class="play-now-outer rounded-full animate-pulse-play" style="position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); width:155px; height:155px; padding:11px; cursor:pointer;">
  137. <div class="play-now-ring rounded-full" style="width:100%;height:100%;padding:4px;">
  138. <div class="play-now-btn rounded-full flex flex-col items-center justify-center text-white text-[32px] font-black border-[1.8px] border-white animate-pulse-play" style="width:100%;height:100%;line-height:24px;">
  139. <span class="uppercase">@Lang.millions_play</span>
  140. <span class="uppercase">@Lang.millions_now</span>
  141. </div>
  142. </div>
  143. </a>
  144. </div>
  145. </div>
  146. @{
  147. ViewData["ActiveTab"] = "Home";
  148. }
  149. @await Html.PartialAsync("~/Areas/Millions/Views/Shared/_BottomNavbar.cshtml")
  150. </div>
  151. @section Scripts {
  152. <script src="/Millions/js/all.min.js"></script>
  153. <script>
  154. let isCheckingTerm = false;
  155. function checkTerm(termType) {
  156. if (isCheckingTerm) return;
  157. isCheckingTerm = true;
  158. var token = $('input[name="__RequestVerificationToken"]').val();
  159. $.ajax({
  160. url: subDomain + '/Millions/Home/TermResult',
  161. type: 'POST',
  162. data: {
  163. __RequestVerificationToken: token,
  164. termType: termType
  165. },
  166. success: function (res) {
  167. if (res.responseCode === "0") {
  168. if (res.listTerm && res.listTerm.length > 0) {
  169. var status = res.listTerm[0].status;
  170. if (status === "0" || status === "1") {
  171. location.href = subDomain + '/Millions/Home/BuyTicket?termType=' + termType;
  172. return;
  173. } else {
  174. alert("@Lang.millions_game_locked");
  175. }
  176. } else {
  177. alert("@Lang.no_results_found");
  178. }
  179. } else if (res.responseCode === "401") {
  180. window.location.href = subDomain + "/Account/Login";
  181. return;
  182. } else {
  183. alert(res.responseMessage || "@Lang.error_happened");
  184. }
  185. isCheckingTerm = false;
  186. },
  187. error: function (err) {
  188. alert("@Lang.error_happened");
  189. isCheckingTerm = false;
  190. }
  191. });
  192. }
  193. function startCountdown() {
  194. const targetHour = 20;
  195. const now = new Date();
  196. let target = new Date();
  197. target.setHours(targetHour, 0, 0, 0);
  198. if (now >= target) {
  199. target.setDate(target.getDate() + 1);
  200. }
  201. const options = { weekday: 'long', month: 'short', day: 'numeric', year: 'numeric' };
  202. const dateText = target.toLocaleDateString('en-US', options);
  203. const drawDateEl = document.getElementById('draw-date');
  204. if(drawDateEl) drawDateEl.innerText = dateText;
  205. }
  206. // Withdraw money function
  207. function transferWinMoney() {
  208. location.href = subDomain + '@Url.Action("TransferWinMoney", "Home", new { area = "Millions" })';
  209. }
  210. document.addEventListener('DOMContentLoaded', startCountdown);
  211. </script>
  212. }