GameHome - Copy.cshtml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  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. <div class="main-container animate__animated animate__fadeIn bg-[#F5F5F5] min-h-screen">
  20. <!-- Top Account Profile Bar / Backgound Red header -->
  21. <div class="w-full bg-[#0062FF] p-4 text-white rounded-b-0xl shadow-md">
  22. <!-- Row 1: Profile Info -->
  23. <div class="flex items-center gap-4">
  24. <a href="/LotteryV2/Home/Index" class="shrink-0 w-10 h-10 bg-white/20 backdrop-blur-md rounded-full flex items-center justify-center text-white border border-white/20 hover:bg-white/30 transition-all shadow-lg active:scale-90">
  25. <i class="fas fa-chevron-left text-lg"></i>
  26. </a>
  27. <div class="flex items-center gap-4">
  28. <div class="w-16 h-16 rounded-full border-2 border-white/60 overflow-hidden bg-[#FFE] shadow-sm">
  29. <img src="https://api.dicebear.com/7.x/avataaars/svg?seed=Ngan" alt="Avatar" class="w-full h-full object-cover">
  30. </div>
  31. <div>
  32. <div class="font-bold text-sm tracking-wide opacity-90">@(Model?.profile?.users ?? "User")</div>
  33. <div class="flex items-center gap-1 mt-0.5">
  34. <span class="text-3xl font-black text-[#FBF3A7]" style="text-shadow: 0 1px 2px rgba(0,0,0,0.2)">@FormatMoney(Model?.userStatus?.bet_coin)</span>
  35. <span class="text-xs font-bold text-[#FBF3A7] uppercase mt-1">@Lang.millions_htg</span>
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. <!-- Row 2: Pill Actions Full Width Split -->
  41. <div class="grid grid-cols-2 gap-3 mt-4">
  42. <a onclick="checkTerm('@Constants.PIC10_BASIC_CODE')" class="btn-pulse border border-white/50 rounded-xl py-2 px-3 flex items-center justify-center gap-1 text-xr font-extrabold bg-white/10 hover:bg-white/20 transition-all text-white no-underline">
  43. <span class="text-yellow-300 text-xl">⚡</span> @Lang.quick_pick
  44. </a>
  45. <a href="/Millions/Home/Results" class="btn-pulse border border-white/50 rounded-xl py-2 px-3 flex items-center justify-center gap-1 text-xr font-extrabold bg-white/10 hover:bg-white/20 transition-all text-white no-underline">
  46. <span class="text-yellow-300 text-xl">🎫</span> @Lang.results
  47. </a>
  48. </div>
  49. <!-- Row 3: Withdraw Button Full Width -->
  50. <div class="w-full mt-3">
  51. <button onclick="location.href='@Url.Action("TransferWinMoney", "Home")'" class="btn-pulse w-full text-black font-black py-3 rounded-2xl text-[18px] flex items-center justify-center gap-2 shadow-lg transition-all" style="background: linear-gradient(118deg, #19EF4B 0%, #C0FF4B 100%);">
  52. <span>@Lang.tranfer_win_money</span>
  53. <img src="/Millions/img/gold_wallet.png" alt="Wallet" class="w-6 h-6 object-contain">
  54. </button>
  55. </div>
  56. </div>
  57. <!-- Countdown Timer Bar with Scalloped bottom divider background -->
  58. <div class="relative w-full overflow-hidden" style="background-image: url('/Millions/img/wavy_border.svg'); background-size: 102% 100%; background-position: center; background-repeat: no-repeat; height: 114px;">
  59. <!-- Top border red line -->
  60. <div class="absolute top-0 left-0 w-full h-[1.5px] bg-[#0062FF]"></div>
  61. <div class="flex items-center justify-between px-4 pt-7 relative z-10">
  62. <!-- Left: Draw Date -->
  63. <div class="flex items-center gap-1 flex-1 min-w-0">
  64. <div class="w-8 h-8 flex-shrink-0">
  65. <img src="/Millions/img/calendar_icon_3d.png" alt="Calendar" class="w-full h-full object-contain" onerror="this.src='/Millions/img/icon_calendar.svg'">
  66. </div>
  67. <div class="flex flex-col min-w-0">
  68. <span class="text-[11px] text-[#A1A1A1] font-bold leading-none mb-1">Next Pick 10 draw</span>
  69. <span class="text-[12px] font-[900] text-black tracking-tight leading-none" id="draw-date">Friday, Mar 20, 2026</span>
  70. </div>
  71. </div>
  72. <!-- Middle: Dashed Divider -->
  73. <div class="h-10 w-px border-l border-dashed border-gray-300 mx-2"></div>
  74. <!-- Right: Timer -->
  75. <div class="flex gap-4 shrink-0">
  76. <div class="flex flex-col items-center min-w-[42px]">
  77. <span class="text-[10px] text-[#A1A1A1] font-bold uppercase tracking-tighter mb-1">@Lang.hours</span>
  78. <span class="text-[28px] font-black text-black leading-none font-bricolage" id="countdown-hours">00</span>
  79. </div>
  80. <div class="flex flex-col items-center min-w-[42px]">
  81. <span class="text-[10px] text-[#A1A1A1] font-bold uppercase tracking-tighter mb-1">@Lang.Minutes</span>
  82. <span class="text-[28px] font-black text-black leading-none font-bricolage" id="countdown-minutes">00</span>
  83. </div>
  84. <div class="flex flex-col items-center min-w-[42px]">
  85. <span class="text-[10px] text-[#A1A1A1] font-bold uppercase tracking-tighter mb-1">@Lang.Secs</span>
  86. <span class="text-[28px] font-black text-black leading-none font-bricolage" id="countdown-seconds">00</span>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. <!-- Anti-forgery token for AJAX -->
  92. @Html.AntiForgeryToken()
  93. <!-- Card list items with accurate illustrations -->
  94. <div class="px-3 flex flex-col gap-2 pb-40 relative z-10 mt-[14px]">
  95. <!-- Game item: Millions -->
  96. <div class="relative w-full h-[120px] rounded-2xl overflow-hidden shadow-xl font-bricolage transition-all duration-300 active:scale-[0.98] cursor-pointer card-red" onclick="checkTerm('@Constants.Millions_CODE')">
  97. <!-- 1. Premium Gradient Border -->
  98. <div class="absolute inset-0 rounded-2xl border-[1.5px] border-white/40 pointer-events-none z-20"></div>
  99. <!-- 2. Decorative Highlights -->
  100. <img src="/Millions/img/decorations/ellipse_1183.png" class="absolute -left-[80px] -top-[130px] w-[220px] h-[220px] pointer-events-none z-10 mix-blend-screen scale-y-[-1]" alt="highlight">
  101. <img src="/Millions/img/decorations/ellipse_1181.png" class="absolute -right-[60px] -top-[20px] w-[200px] h-[200px] pointer-events-none z-10 mix-blend-screen" alt="highlight">
  102. <div class="absolute inset-0 grid grid-cols-10 items-center px-3 z-20 gap-0">
  103. <!-- Left: Millions + Ball (3 columns) -->
  104. <div class="col-span-3 flex items-center h-full -ml-2 relative">
  105. <!-- Text Layout -->
  106. <div class="flex flex-col items-center leading-[0.85] relative z-10 font-UTM_Futura_Extra">
  107. <span class="text-white font-[900] text-[16px] drop-shadow-md">Millions</span>
  108. <span class="font-[900] text-[30px] drop-shadow-lg leading-[0.9]" style="background: linear-gradient(180deg, #FFFFFF 20%, #FFF307 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent;">6 số</span>
  109. <!-- Floating Bubbles -->
  110. <div class="absolute top-[-4px] right-[-4px] w-2.5 h-2.5 bg-white rounded-full shadow-sm"></div>
  111. <div class="absolute top-[18px] right-[-6px] w-2 h-2 bg-yellow-400 rounded-full shadow-sm"></div>
  112. </div>
  113. <!-- Single Ball (Yellow) -->
  114. <div class="relative w-[36px] h-[36px] flex-shrink-0 -ml-18 aspect-square z-20">
  115. <div class="w-full h-full bg-[#FFDE59] rounded-full border-[2.5px] border-white flex items-center justify-center shadow-lg">
  116. <span class="text-black font-[900] text-[18px] leading-none mb-0.5">6</span>
  117. </div>
  118. </div>
  119. </div>
  120. <!-- Center: Jackpot info (4 columns) -->
  121. <div class="col-span-4 flex flex-col items-center justify-center text-center">
  122. <div class="text-[14px] font-bold text-white mb-0.5 whitespace-nowrap opacity-90">@Lang.jackpot_prize</div>
  123. <div class="flex items-start gap-0.5">
  124. <span class="text-[22px] font-black text-[#FBF3A7] leading-none" style="text-shadow: 0 4px 8px rgba(0,0,0,0.3)">30.000.000</span>
  125. <span class="text-[9px] font-bold text-white uppercase opacity-90 mt-1">@Lang.millions_htg</span>
  126. </div>
  127. <div class="text-[12px] text-white/90 font-medium whitespace-nowrap mt-1">@Lang.next_round <span class="font-black text-yellow-300 ml-1 countdown-timer">00:00:00</span></div>
  128. </div>
  129. <!-- Right: Action Section (3 columns) -->
  130. <div class="col-span-3 flex flex-col items-center justify-end h-full pb-3.5 relative">
  131. <img src="/Millions/img/gold_chest.png" alt="Chest" class="absolute bottom-[38px] w-18 h-20 object-contain filter drop-shadow-lg z-10">
  132. <button class="text-black font-black px-3 w-full py-1.5 rounded-[12px] text-[13px] shadow-xl border border-white/50 hover:brightness-110 active:scale-95 transition-all relative z-0" style="background: linear-gradient(180deg, #FFF385 0%, #EFAD19 100%);">@Lang.rule_play_now</button>
  133. </div>
  134. </div>
  135. </div>
  136. </div>
  137. <!-- Banner Info Section centered red text bar -->
  138. <div class="fixed bottom-[82px] left-1/2 -translate-x-1/2 w-full min-[600px]:max-w-[414px] bg-[#0062FF] text-white py-2 text-center text-[13px] font-bold tracking-wide z-40 flex flex-col items-center justify-center overflow-hidden h-auto shadow-md">
  139. <div class="flex flex-col items-center w-full animate-slide-up">
  140. <!-- Row 1 -->
  141. <div class="opacity-90">@Lang.have_chance_to_get</div>
  142. <!-- Row 2 -->
  143. <div class="text-[20px] font-black text-[#FBF3A7] mt-0.5">
  144. @Lang.millions_jackpot_today_htg
  145. </div>
  146. </div>
  147. </div>
  148. <!-- Custom Notification Modal (Branded design from Profile) -->
  149. <div id="notificationModal" class="fixed inset-0 z-[100] flex items-center justify-center hidden px-6 font-bricolage" style="background: linear-gradient(135deg, rgba(26, 26, 46, 0.9) 0%, rgba(22, 33, 62, 0.9) 100%);">
  150. <div class="w-full max-w-[343px] min-h-[480px] bg-white rounded-[24px] overflow-hidden flex flex-col items-center p-8 animate__animated animate__zoomIn animate__faster shadow-2xl">
  151. <!-- Alert Icon -->
  152. <div class="w-full flex justify-center mb-8 mt-6">
  153. <img src="/Millions/img/modal/fail_icon.png" class="w-[180px] h-auto object-contain" alt="Notificaton icon" />
  154. </div>
  155. <!-- Message Area -->
  156. <div class="px-2 text-center mb-10 flex-1 flex items-center justify-center">
  157. <p id="notificationMessage" class="text-black font-[800] text-[22px] leading-snug">
  158. <!-- Message content -->
  159. </p>
  160. </div>
  161. <!-- Action Button -->
  162. <div class="w-full">
  163. <button onclick="closeNotificationModal()" class="w-full bg-[#0062FF] text-white font-[800] text-[20px] py-[12px] rounded-[14px] shadow-lg active:scale-95 transition-all">
  164. @Lang.try_again
  165. </button>
  166. </div>
  167. </div>
  168. </div>
  169. <!-- Bottom Navbar shared component -->
  170. <partial name="_BottomNavbar" />
  171. </div>
  172. @section Scripts {
  173. <script>
  174. var systemUpgrading = false;
  175. function showNotification(message, code) {
  176. $("#notificationMessage").text(message);
  177. const $btn = $("#notificationModal button");
  178. if (code === "-2" || (message && message.includes("System is upgrading"))) {
  179. systemUpgrading = true;
  180. $btn.text("@Lang.login");
  181. } else {
  182. systemUpgrading = false;
  183. $btn.text("@Lang.try_again");
  184. }
  185. $("#notificationModal").removeClass("hidden").addClass("flex");
  186. }
  187. function closeNotificationModal() {
  188. $("#notificationModal").addClass("hidden").removeClass("flex");
  189. if (systemUpgrading) {
  190. window.location.href = subDomain + "/Account/Login";
  191. }
  192. }
  193. let isCheckingTerm = false;
  194. function checkTerm(termType) {
  195. if (isCheckingTerm) return;
  196. isCheckingTerm = true;
  197. // Get anti-forgery token from the page
  198. var token = $('input[name="__RequestVerificationToken"]').val();
  199. // Show loading or disable buttons if needed
  200. $.ajax({
  201. url: subDomain + '/Millions/Home/TermResult',
  202. type: 'POST',
  203. data: {
  204. __RequestVerificationToken: token,
  205. termType: termType
  206. },
  207. success: function (res) {
  208. if (res.responseCode === "0") {
  209. if (res.listTerm && res.listTerm.length > 0) {
  210. var status = res.listTerm[0].status;
  211. if (status === "0" || status === "1") {
  212. location.href = subDomain + '/Millions/Home/BuyTicket?termType=' + termType;
  213. return;
  214. } else if (status === "2") {
  215. showNotification("@Lang.millions_game_locked");
  216. } else if (status === "3") {
  217. showNotification("@Lang.millions_updating_results");
  218. } else {
  219. showNotification("@Lang.millions_game_locked");
  220. }
  221. } else {
  222. showNotification("@Lang.no_results_found");
  223. }
  224. } else if (res.responseCode === "401") {
  225. window.location.href = subDomain + "/Account/Login";
  226. return;
  227. } else {
  228. showNotification(res.responseMessage || "@Lang.error_happened", res.responseCode);
  229. }
  230. isCheckingTerm = false;
  231. },
  232. error: function (err) {
  233. showNotification("@Lang.error_happened");
  234. isCheckingTerm = false;
  235. }
  236. });
  237. }
  238. function startCountdown() {
  239. const targetHour = 20; // 20:00 (8h tối)
  240. const now = new Date();
  241. let target = new Date();
  242. target.setHours(targetHour, 0, 0, 0);
  243. if (now >= target) {
  244. target.setDate(target.getDate() + 1);
  245. }
  246. // Định dạng ngày hiển thị (VD: Friday, Mar 20, 2026)
  247. const options = { weekday: 'long', month: 'short', day: 'numeric', year: 'numeric' };
  248. const dateText = target.toLocaleDateString('en-US', options);
  249. document.getElementById('draw-date').innerText = dateText;
  250. function updateTime() {
  251. const current = new Date();
  252. const diff = target - current;
  253. if (diff <= 0) {
  254. target.setDate(target.getDate() + 1);
  255. const updatedDateText = target.toLocaleDateString('en-US', options);
  256. document.getElementById('draw-date').innerText = updatedDateText;
  257. updateTime();
  258. return;
  259. }
  260. const hours = Math.floor((diff / (1000 * 60 * 60)));
  261. const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
  262. const seconds = Math.floor((diff % (1000 * 60)) / 1000);
  263. document.getElementById('countdown-hours').innerText = hours.toString().padStart(2, '0');
  264. document.getElementById('countdown-minutes').innerText = minutes.toString().padStart(2, '0');
  265. document.getElementById('countdown-seconds').innerText = seconds.toString().padStart(2, '0');
  266. // Update all card timers
  267. const timeStr = `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
  268. document.querySelectorAll('.countdown-timer').forEach(t => t.innerText = timeStr);
  269. }
  270. updateTime();
  271. setInterval(updateTime, 1000);
  272. }
  273. document.addEventListener('DOMContentLoaded', startCountdown);
  274. </script>
  275. }