_TermResultHistoryGrouped.cshtml 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. @using LotteryWebApp.Service
  2. @using LotteryWebApp.Languages
  3. @using System.Linq
  4. @model List<IGrouping<DateTime, Term>>
  5. @if (Model != null && Model.Count > 0)
  6. {
  7. foreach (var group in Model)
  8. {
  9. var drawDate = group.Key;
  10. var filteredGames = group.Where(x => !string.Equals(x.result, "NA", StringComparison.OrdinalIgnoreCase)).ToList();
  11. if (filteredGames.Count == 0) continue;
  12. <div class="result-card-premium animate__animated animate__fadeInUp mb-6 overflow-hidden bg-white rounded-2xl shadow-sm border border-gray-100">
  13. <!-- Simplified Header -->
  14. <div class="bg-gray-50/50 px-4 py-2.5 border-b border-gray-100 flex items-center justify-between">
  15. <div class="flex items-center gap-2">
  16. <i class="fas fa-trophy text-[#0062FF] text-[12px]"></i>
  17. <span class="text-[11px] font-black text-gray-500 uppercase tracking-widest">@Lang.results</span>
  18. </div>
  19. <div class="flex items-center gap-1.5">
  20. <div class="w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse"></div>
  21. <span class="text-[9px] font-bold text-gray-400 uppercase">Live Update</span>
  22. </div>
  23. </div>
  24. <!-- Games Container -->
  25. <div class="px-3 pt-2 pb-3 space-y-0.5">
  26. <!-- Date/Time Info Row -->
  27. <div class="flex items-center gap-3 mb-1.5 bg-gray-50/50 p-2 rounded-2xl border border-gray-100/80 shadow-xs">
  28. <div class="w-11 h-11 flex flex-col items-center justify-center bg-white rounded-xl shadow-xs border border-gray-100 shrink-0">
  29. <span class="text-[9px] font-bold text-gray-400 uppercase leading-none">@drawDate.ToString("MMM")</span>
  30. <span class="text-[18px] font-black text-[#0062FF] leading-none">@drawDate.ToString("dd")</span>
  31. </div>
  32. <div class="flex flex-col">
  33. <span class="text-[14px] font-black text-gray-800 leading-tight">@drawDate.ToString("dddd, MMM dd yyyy", System.Globalization.CultureInfo.InvariantCulture)</span>
  34. <div class="flex items-center gap-1.5 mt-0.5">
  35. <i class="far fa-calendar-alt text-[11px] text-[#0062FF]"></i>
  36. <span class="text-[11px] font-bold text-gray-400 uppercase tracking-tighter">@Lang.draw_date</span>
  37. </div>
  38. </div>
  39. </div>
  40. @{
  41. var games = filteredGames.OrderBy(x => x.gameId).ToList();
  42. for (int i = 0; i < games.Count; i++)
  43. {
  44. var item = games[i];
  45. var isBasic = item.gameId == "30";
  46. var isBigSmall = item.gameId == "31";
  47. var isOddEven = item.gameId == "32";
  48. var gameName = isBasic ? Lang.millions_classic_pick_10 :
  49. isBigSmall ? Lang.millions_big_small :
  50. isOddEven ? Lang.millions_odd_even : "Game";
  51. // Fallback labels if resource is missing
  52. if (string.IsNullOrEmpty(gameName)) {
  53. gameName = isBasic ? "Basic" : isBigSmall ? "Big/Small" : isOddEven ? "Odd/Even" : "Game";
  54. }
  55. var gameColor = isBasic ? "#0062FF" : isBigSmall ? "#26A31E" : isOddEven ? "#B529E9" : "#0062FF";
  56. var gameBg = isBasic ? "bg-[#0062FF]/5" : isBigSmall ? "bg-[#26A31E]/5" : isOddEven ? "bg-[#B529E9]/5" : "bg-gray-50";
  57. <div class="game-result-row px-1">
  58. <div class="flex items-center justify-between mb-0 px-1">
  59. <div class="flex items-center gap-2">
  60. <div class="w-1.5 h-4 rounded-full" style="background-color: @gameColor"></div>
  61. <span class="text-[14px] font-black uppercase tracking-widest" style="color: @gameColor">@gameName</span>
  62. </div>
  63. <div class="flex flex-col items-end">
  64. <span class="text-[13px] font-bold text-gray-400 opacity-60">#@item.id</span>
  65. @{
  66. DateTime drawTime;
  67. var timeStr = DateTime.TryParse(item.date_random, out drawTime) ? drawTime.ToString("HH:mm") : "--:--";
  68. }
  69. <span class="text-[11px] font-black text-[#0062FF]/60 uppercase tracking-tighter">@timeStr</span>
  70. </div>
  71. </div>
  72. <div class="flex items-center justify-center gap-2.5 flex-wrap">
  73. @if (!string.IsNullOrEmpty(item.result))
  74. {
  75. var balls = item.result.Split(new[] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries);
  76. foreach (var ball in balls)
  77. {
  78. var cleanBall = ball.Trim();
  79. if (isBasic)
  80. {
  81. <div class="w-8 h-8 flex items-center justify-center rounded-full text-white text-[15px] font-black shadow-md transform hover:scale-110 transition-transform"
  82. style="background: linear-gradient(135deg, #FF3D63 0%, #E3132D 60%, #BA0F21 100%);">
  83. @cleanBall
  84. </div>
  85. }
  86. else
  87. {
  88. var ballText = cleanBall.ToUpper();
  89. if (isBigSmall) {
  90. if (ballText == "S") ballText = Lang.Small;
  91. else if (ballText == "B") ballText = Lang.Big;
  92. } else if (isOddEven) {
  93. if (ballText == "O") ballText = Lang.Odd;
  94. else if (ballText == "E") ballText = Lang.Even;
  95. }
  96. <div class="px-4 py-1.5 rounded-xl bg-white border border-gray-100 shadow-sm text-[13px] font-black transform hover:bg-gray-50 transition-colors uppercase tracking-tight" style="color: @gameColor">
  97. @ballText
  98. </div>
  99. }
  100. }
  101. }
  102. else
  103. {
  104. <div class="py-2 px-4 rounded-lg border border-dashed" style="background-color: @(gameColor + "10"); border-color: @(gameColor + "30");">
  105. <span class="italic text-[11px] font-bold" style="color: @gameColor">@Lang.waiting_for_result</span>
  106. </div>
  107. }
  108. </div>
  109. </div>
  110. if (i < games.Count - 1)
  111. {
  112. <!-- Red Separator Line -->
  113. <div class="py-0">
  114. <div class="h-[1px] bg-gradient-to-r from-transparent via-[#0062FF]/20 to-transparent"></div>
  115. </div>
  116. }
  117. }
  118. }
  119. </div>
  120. </div>
  121. }
  122. }
  123. else
  124. {
  125. <div class="w-full py-20 flex flex-col items-center justify-center text-gray-400 opacity-60">
  126. <div class="w-20 h-20 bg-gray-50 rounded-full flex items-center justify-center mb-4">
  127. <i class="fas fa-search text-3xl"></i>
  128. </div>
  129. <p class="font-black text-[14px] uppercase tracking-widest">@Lang.no_results_found</p>
  130. </div>
  131. }