index.html 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  6. <title>月度排行榜</title>
  7. <link href="./css/all.min.css" rel="stylesheet">
  8. <style>
  9. * {
  10. box-sizing: border-box;
  11. margin: 0;
  12. padding: 0;
  13. font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
  14. -webkit-tap-highlight-color: transparent;
  15. user-select: none;
  16. }
  17. html, body {
  18. width: 100%;
  19. height: 100%;
  20. overflow: hidden;
  21. background: transparent;
  22. display: flex;
  23. justify-content: center;
  24. align-items: center;
  25. }
  26. /* 容器:100% 充满嵌入框 */
  27. .card-container {
  28. width: 100%;
  29. height: 100%;
  30. border-radius: 20px;
  31. overflow: hidden;
  32. position: relative;
  33. cursor: pointer;
  34. /* 背景图 */
  35. background: url('./card.png') center/cover no-repeat;
  36. }
  37. .card-container:active {
  38. transform: scale(0.98);
  39. transition: transform 0.1s;
  40. }
  41. .content-layer {
  42. position: absolute;
  43. top: 0; left: 0; width: 100%; height: 100%;
  44. display: flex;
  45. flex-direction: column;
  46. align-items: center;
  47. z-index: 2;
  48. }
  49. /* 1. 年份标签 - 修改:去背景、放大字体、单位改 vmin */
  50. .year-tag {
  51. /* 距离顶部约 14% */
  52. margin-top: 13%;
  53. /* vmin 单位:确保随容器大小自动缩放 */
  54. font-size: 8vmin; /* 字体加大 */
  55. font-weight: 800;
  56. color: #fff;
  57. letter-spacing: 2px;
  58. /* 去掉背景和边框 */
  59. background: none;
  60. border: none;
  61. padding: 0;
  62. /* 增加投影以保证清晰度 */
  63. text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  64. }
  65. /* 2. 月份数字 - 修改:单位改 vmin */
  66. .month-num {
  67. /* 字体极大,随容器缩放 */
  68. font-size: 32vmin;
  69. font-weight: 900;
  70. line-height: 1;
  71. margin-top: 9%;
  72. /* 金色渐变字 */
  73. background: linear-gradient(to bottom, #ffffff 20%, #ffd700 60%, #ff9f43 100%);
  74. -webkit-background-clip: text;
  75. -webkit-text-fill-color: transparent;
  76. filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  77. }
  78. /* 3. 奖杯动画图标 - 修改:大幅下移 */
  79. .trophy-icon {
  80. /* 修改:往下移动 (从原来的 4% 增加到 15%) */
  81. margin-top: 13%;
  82. /* 图标大小也随容器缩放 */
  83. width: 15vmin;
  84. height: 15vmin;
  85. display: flex; justify-content: center; align-items: center;
  86. animation: trophy-pulse 2s infinite ease-in-out;
  87. }
  88. .trophy-icon i {
  89. /* 图标字体大小随容器缩放 */
  90. font-size: 10vmin;
  91. color: #ffd700;
  92. filter: drop-shadow(0 0 5px rgba(253, 203, 110, 0.8));
  93. }
  94. @keyframes trophy-pulse {
  95. 0% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(253, 203, 110, 0)); }
  96. 50% { transform: scale(1.2); filter: drop-shadow(0 0 8px rgba(253, 203, 110, 0.6)); }
  97. 100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(253, 203, 110, 0)); }
  98. }
  99. </style>
  100. </head>
  101. <body>
  102. <div class="card-container" onclick="redirectToDetail()">
  103. <div class="content-layer">
  104. <div class="year-tag">2025年</div>
  105. <div class="month-num">12</div>
  106. <div class="trophy-icon">
  107. <i class="fa-solid fa-trophy"></i>
  108. </div>
  109. </div>
  110. </div>
  111. <script src="./bridge.js"></script>
  112. <script>
  113. // Logger Utility
  114. const Logger = {
  115. _isDev: false,
  116. init: function(isDev) {
  117. this._isDev = isDev;
  118. },
  119. log: function() {
  120. if (this._isDev) {
  121. console.log.apply(console, arguments);
  122. }
  123. },
  124. warn: function() {
  125. if (this._isDev) {
  126. console.warn.apply(console, arguments);
  127. }
  128. },
  129. error: function() {
  130. console.error.apply(console, arguments);
  131. }
  132. };
  133. function getQueryParam(name) {
  134. const params = new URLSearchParams(window.location.search);
  135. return params.get(name);
  136. }
  137. // Initialize Logger
  138. const env = (getQueryParam('env') || '').toLowerCase();
  139. Logger.init(env === 'mock'); // Only log if env=mock
  140. function getTargetDetail() {
  141. // 1. 30% Chance for default
  142. if (Math.random() < 0.3) {
  143. return 'detail.html';
  144. }
  145. // 2. Date & Season Logic
  146. const now = new Date();
  147. const month = now.getMonth() + 1; // 1-12
  148. const date = now.getDate();
  149. // Christmas: Dec 18 - Dec 31
  150. if (month === 12 && date >= 18) {
  151. return 'detail-christmas.html';
  152. }
  153. // New Year: Jan 1 - Jan 7
  154. if (month === 1 && date <= 7) {
  155. return 'detail-newyear.html';
  156. }
  157. // Seasons
  158. // Spring (3, 4, 5) -> Windy
  159. if (month >= 3 && month <= 5) return 'detail-windy.html';
  160. // Summer (6, 7, 8) -> Rain
  161. if (month >= 6 && month <= 8) return 'detail-rain.html';
  162. // Autumn (9, 10, 11) -> Cloud
  163. if (month >= 9 && month <= 11) return 'detail-cloud.html';
  164. // Winter (Non-holiday Dec, Jan, Feb) -> Mix of Snow and Sun
  165. // 60% chance for Snow (Snowman), 40% for Winter Sun
  166. return Math.random() < 0.6 ? 'detail-snow.html' : 'detail-sun.html';
  167. }
  168. function redirectToDetail() {
  169. const token = getQueryParam('token');
  170. const id = getQueryParam('id');
  171. // Dynamic Target
  172. let detailUrl = getTargetDetail();
  173. const queryParams = [];
  174. if (token) {
  175. queryParams.push(`token=${encodeURIComponent(token)}`);
  176. }
  177. if (id) {
  178. queryParams.push(`id=${encodeURIComponent(id)}`);
  179. }
  180. if (queryParams.length > 0) {
  181. detailUrl += `?${queryParams.join('&')}`;
  182. }
  183. detailUrl += (detailUrl.includes('?') ? '&' : '?') + 'full=true';
  184. Logger.log("Navigating to:", detailUrl);
  185. if (window.Bridge && window.Bridge.appAction) {
  186. Bridge.appAction(detailUrl);
  187. } else {
  188. window.location.href = detailUrl;
  189. }
  190. }
  191. </script>
  192. </body>
  193. </html>