index-style8.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  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. :root {
  10. --ice-blue: #A5F2F3;
  11. --ice-deep: #006FBB;
  12. --ice-white: #FFFFFF;
  13. --glass-border: 1px solid rgba(255, 255, 255, 0.4);
  14. }
  15. * {
  16. box-sizing: border-box;
  17. margin: 0;
  18. padding: 0;
  19. font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
  20. -webkit-tap-highlight-color: transparent;
  21. user-select: none;
  22. }
  23. html, body {
  24. width: 100%;
  25. height: 100%;
  26. overflow: hidden;
  27. background: transparent;
  28. display: flex;
  29. justify-content: center;
  30. align-items: center;
  31. }
  32. .card-container {
  33. width: 100%;
  34. height: 100%;
  35. position: relative;
  36. /* 简化背景渐变,减少计算 */
  37. background: linear-gradient(180deg, #2980b9 0%, #2c3e50 100%);
  38. border-radius: 20px;
  39. overflow: hidden;
  40. cursor: pointer;
  41. display: flex;
  42. flex-direction: column;
  43. align-items: center;
  44. border: 2px solid rgba(165, 242, 243, 0.3);
  45. /* 移除昂贵的 box-shadow */
  46. /* box-shadow: 0 0 30px rgba(20, 136, 204, 0.5); */
  47. transform: translateZ(0);
  48. -webkit-mask-image: -webkit-radial-gradient(white, black);
  49. }
  50. /* 替代 SVG 滤镜的简单冰霜层 */
  51. .frost-overlay {
  52. position: absolute;
  53. top: 0; left: 0; width: 100%; height: 100%;
  54. /* 使用简单的径向渐变模拟光照 */
  55. background: radial-gradient(circle at 50% 0%, rgba(255,255,255,0.1) 0%, transparent 60%);
  56. pointer-events: none;
  57. z-index: 1;
  58. }
  59. /* 优化后的雪花:减少阴影,开启硬件加速 */
  60. .snowflakes {
  61. position: absolute;
  62. width: 100%; height: 100%;
  63. z-index: 0;
  64. pointer-events: none;
  65. }
  66. .snowflake {
  67. position: absolute;
  68. color: #fff;
  69. opacity: 0.6;
  70. font-size: 20px;
  71. will-change: transform; /* 关键优化 */
  72. animation: fall linear infinite;
  73. /* 移除 text-shadow 以提升性能 */
  74. }
  75. .s1 { top: -10%; left: 10%; font-size: 15px; animation-duration: 5s; }
  76. .s2 { top: -20%; left: 50%; font-size: 25px; animation-duration: 8s; animation-delay: 2s; }
  77. .s3 { top: -30%; left: 80%; font-size: 18px; animation-duration: 6s; animation-delay: 1s; }
  78. /* 皇冠图标 */
  79. .crown-icon {
  80. position: absolute;
  81. top: -35px;
  82. left: 50%;
  83. transform: translateX(-50%);
  84. font-size: 30px;
  85. color: #ffd700;
  86. /* 使用简单的 text-shadow 替代 filter: drop-shadow */
  87. text-shadow: 0 0 5px rgba(255,255,255,0.5);
  88. animation: floatCrown 3s infinite ease-in-out;
  89. will-change: transform;
  90. }
  91. /* 顶部年份 */
  92. .year-crystal {
  93. margin-top: 15%;
  94. position: relative;
  95. z-index: 2;
  96. padding: 1.5vmin 6vmin;
  97. /* 移除 backdrop-filter,使用纯半透明背景 */
  98. background: rgba(255, 255, 255, 0.2);
  99. border: var(--glass-border);
  100. border-radius: 30px;
  101. font-size: 5vmin;
  102. color: var(--ice-white);
  103. letter-spacing: 3px;
  104. /* 简化 text-shadow */
  105. text-shadow: 0 2px 4px rgba(0,0,0,0.3);
  106. }
  107. /* 核心视觉 */
  108. .magic-core {
  109. flex: 1;
  110. display: flex;
  111. flex-direction: column;
  112. justify-content: center;
  113. align-items: center;
  114. position: relative;
  115. z-index: 2;
  116. width: 100%;
  117. }
  118. /* 优化后的魔法圆环:使用 border 代替 box-shadow */
  119. .ice-fractal {
  120. position: absolute;
  121. width: 60vmin; height: 60vmin;
  122. display: flex;
  123. justify-content: center;
  124. align-items: center;
  125. }
  126. .fractal-ring {
  127. position: absolute;
  128. border: 1px solid rgba(165, 242, 243, 0.4);
  129. width: 100%; height: 100%;
  130. transform: rotate(45deg);
  131. /* 移除 box-shadow 动画 */
  132. animation: spinMagic 20s infinite linear;
  133. will-change: transform;
  134. }
  135. .month-num {
  136. font-size: 40vmin;
  137. font-weight: 100;
  138. color: #fff; /* 纯色文字性能最好,通过透明度模拟质感 */
  139. /* 简化渐变文字为简单的透明度渐变 */
  140. mask-image: linear-gradient(to bottom, black 30%, rgba(0,0,0,0.5) 100%);
  141. -webkit-mask-image: linear-gradient(to bottom, black 30%, rgba(0,0,0,0.5) 100%);
  142. /* 移除 filter: drop-shadow */
  143. text-shadow: 0 0 20px rgba(165, 242, 243, 0.4);
  144. position: relative;
  145. z-index: 3;
  146. }
  147. .month-title {
  148. font-size: 6vmin;
  149. color: var(--ice-blue);
  150. letter-spacing: 2px;
  151. text-transform: uppercase;
  152. margin-top: -2vmin;
  153. text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  154. z-index: 3;
  155. }
  156. /* 水晶按钮 */
  157. .crystal-btn-area {
  158. margin-bottom: 15%;
  159. z-index: 2;
  160. width: 100%;
  161. display: flex;
  162. justify-content: center;
  163. }
  164. .crystal-btn {
  165. /* 移除 backdrop-filter */
  166. background: rgba(255, 255, 255, 0.15);
  167. border: 1px solid rgba(255,255,255,0.5);
  168. border-radius: 50px;
  169. padding: 2.5vmin 8vmin;
  170. color: #fff;
  171. font-size: 4.5vmin;
  172. letter-spacing: 1px;
  173. display: flex;
  174. align-items: center;
  175. gap: 10px;
  176. /* 简化 box-shadow */
  177. box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  178. }
  179. /* 动画 */
  180. @keyframes fall {
  181. 0% { transform: translateY(-20px) rotate(0deg); opacity: 0; }
  182. 20% { opacity: 0.8; }
  183. 100% { transform: translateY(120vh) rotate(360deg); opacity: 0; }
  184. }
  185. @keyframes spinMagic {
  186. 0% { transform: rotate(0deg); }
  187. 100% { transform: rotate(360deg); }
  188. }
  189. @keyframes floatCrown {
  190. 0%, 100% { transform: translateX(-50%) translateY(0); }
  191. 50% { transform: translateX(-50%) translateY(-5px); }
  192. }
  193. </style>
  194. </head>
  195. <body>
  196. <div class="card-container" onclick="redirectToDetail()">
  197. <div class="frost-overlay"></div>
  198. <!-- 减少雪花数量 -->
  199. <div class="snowflakes">
  200. <div class="snowflake s1">❄</div>
  201. <div class="snowflake s2">❅</div>
  202. <div class="snowflake s3">❆</div>
  203. </div>
  204. <!-- 冰晶年份 + 皇冠 -->
  205. <div class="year-crystal">
  206. <i class="fa-solid fa-crown crown-icon"></i>
  207. <span class="year-text">2025年</span>
  208. </div>
  209. <!-- 核心冰魔法 -->
  210. <div class="magic-core">
  211. <div class="ice-fractal">
  212. <div class="fractal-ring"></div>
  213. </div>
  214. <div class="month-num">12</div>
  215. <div class="month-title">月挑战赛</div>
  216. </div>
  217. <!-- 水晶按钮 -->
  218. <div class="crystal-btn-area">
  219. <div class="crystal-btn">
  220. <i class="fa-regular fa-gem"></i>
  221. <span>查看排行榜</span>
  222. </div>
  223. </div>
  224. </div>
  225. <script src="./bridge.js"></script>
  226. <script src="./js/target_logic.js"></script>
  227. <script>
  228. // Auto-Update Date
  229. (function() {
  230. const now = new Date();
  231. const year = now.getFullYear();
  232. const month = now.getMonth() + 1;
  233. const yearEl = document.querySelector('.year-text');
  234. const monthEl = document.querySelector('.month-num');
  235. if (yearEl) yearEl.innerText = year + '年';
  236. if (monthEl) monthEl.innerText = month;
  237. })();
  238. // Logger Utility
  239. const Logger = {
  240. _isDev: false,
  241. init: function(isDev) {
  242. this._isDev = isDev;
  243. },
  244. log: function() {
  245. if (this._isDev) {
  246. console.log.apply(console, arguments);
  247. }
  248. },
  249. warn: function() {
  250. if (this._isDev) {
  251. console.warn.apply(console, arguments);
  252. }
  253. },
  254. error: function() {
  255. console.error.apply(console, arguments);
  256. }
  257. };
  258. function getQueryParam(name) {
  259. const params = new URLSearchParams(window.location.search);
  260. return params.get(name);
  261. }
  262. // Initialize Logger
  263. const env = (getQueryParam('env') || '').toLowerCase();
  264. Logger.init(env === 'mock'); // Only log if env=mock
  265. function redirectToDetail() {
  266. const token = getQueryParam('token');
  267. const id = getQueryParam('id');
  268. // Use centralized logic
  269. let detailUrl = getTargetDetail();
  270. const queryParams = [];
  271. if (token) {
  272. queryParams.push(`token=${encodeURIComponent(token)}`);
  273. }
  274. if (id) {
  275. queryParams.push(`id=${encodeURIComponent(id)}`);
  276. }
  277. if (queryParams.length > 0) {
  278. detailUrl += `?${queryParams.join('&')}`;
  279. }
  280. detailUrl += (detailUrl.includes('?') ? '&' : '?') + 'full=true';
  281. Logger.log("Navigating to:", detailUrl);
  282. if (window.Bridge && window.Bridge.appAction) {
  283. Bridge.appAction(detailUrl);
  284. } else {
  285. window.location.href = detailUrl;
  286. }
  287. }
  288. </script>
  289. </body>
  290. </html>