index-style5.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  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. --ink-bg: #f4f3ee; /* 宣纸白 */
  11. --ink-black: #2b2b2b; /* 浓墨 */
  12. --ink-gray: #999999; /* 淡墨 */
  13. --seal-red: #b73e3e; /* 朱砂红 */
  14. }
  15. * {
  16. box-sizing: border-box;
  17. margin: 0;
  18. padding: 0;
  19. /* 优先使用衬线体/楷体,营造文化感 */
  20. font-family: "Kaiti SC", "STKaiti", "KaiTi", "Songti SC", "SimSun", serif;
  21. -webkit-tap-highlight-color: transparent;
  22. user-select: none;
  23. }
  24. html, body {
  25. width: 100%;
  26. height: 100%;
  27. overflow: hidden;
  28. background: transparent;
  29. display: flex;
  30. justify-content: center;
  31. align-items: center;
  32. }
  33. /* 主容器 */
  34. .card-container {
  35. width: 100%;
  36. height: 100%;
  37. position: relative;
  38. background-color: var(--ink-bg);
  39. border-radius: 20px;
  40. overflow: hidden; /* 核心裁剪 */
  41. cursor: pointer;
  42. display: flex;
  43. flex-direction: column;
  44. align-items: center;
  45. /* 模拟宣纸纹理 */
  46. background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='paper'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23paper)' opacity='0.08'/%3E%3C/svg%3E");
  47. box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  48. /* 强制硬件加速 & 遮罩修复圆角 */
  49. transform: translateZ(0);
  50. -webkit-mask-image: -webkit-radial-gradient(white, black); /* 兼容性修复:强制裁剪 */
  51. }
  52. /* 背景淡墨山水意向 */
  53. .bg-ink {
  54. position: absolute;
  55. bottom: -10%;
  56. left: -10%;
  57. width: 120%;
  58. height: 50%;
  59. background: radial-gradient(ellipse at 50% 100%, rgba(0,0,0,0.05) 0%, transparent 70%);
  60. filter: blur(20px);
  61. z-index: 0;
  62. animation: breathe 10s infinite ease-in-out;
  63. pointer-events: none;
  64. }
  65. /* 左上角年份 - 竖排印章风格 */
  66. .year-seal {
  67. position: absolute;
  68. top: 8%;
  69. left: 8%;
  70. width: 10vmin;
  71. height: auto;
  72. padding: 2vmin 1vmin;
  73. border: 2px solid var(--seal-red);
  74. color: var(--seal-red);
  75. font-size: 4.5vmin;
  76. font-weight: bold;
  77. z-index: 2;
  78. opacity: 0.8;
  79. border-radius: 4px;
  80. box-shadow: 2px 2px 0 rgba(183, 62, 62, 0.1);
  81. /* 使用 Flexbox 强制竖排,避免 writing-mode 兼容性问题 */
  82. display: flex;
  83. flex-direction: column;
  84. align-items: center;
  85. justify-content: center;
  86. gap: 0.5vmin; /* 字间距 */
  87. }
  88. /* 核心视觉:动态墨韵圆 */
  89. .ink-wrapper {
  90. flex: 1;
  91. display: flex;
  92. flex-direction: column;
  93. justify-content: center;
  94. align-items: center;
  95. position: relative;
  96. z-index: 1;
  97. width: 100%;
  98. }
  99. .ink-blob {
  100. position: absolute;
  101. width: 55vmin;
  102. height: 55vmin;
  103. background: var(--ink-black);
  104. /* 利用不规则圆角模拟墨迹 */
  105. border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%;
  106. opacity: 0.9;
  107. animation: morph 8s ease-in-out infinite both alternate;
  108. display: flex;
  109. justify-content: center;
  110. align-items: center;
  111. }
  112. /* 第二层淡墨,增加层次 */
  113. .ink-blob::before {
  114. content: '';
  115. position: absolute;
  116. width: 110%;
  117. height: 110%;
  118. background: var(--ink-black);
  119. border-radius: 58% 42% 30% 70% / 55% 55% 45% 45%;
  120. opacity: 0.1;
  121. z-index: -1;
  122. animation: morph 12s ease-in-out infinite both alternate-reverse;
  123. }
  124. .month-num {
  125. font-size: 30vmin;
  126. color: var(--ink-bg);
  127. font-weight: bold;
  128. font-family: "Times New Roman", serif; /* 西文衬线体配合中文环境 */
  129. z-index: 2;
  130. position: relative;
  131. margin-top: -2vmin;
  132. }
  133. .month-label {
  134. position: absolute;
  135. bottom: -10vmin;
  136. font-size: 6vmin;
  137. color: var(--ink-black);
  138. letter-spacing: 1vmin;
  139. font-weight: bold;
  140. }
  141. /* 底部按钮 - 极简线条 */
  142. .action-area {
  143. margin-bottom: 15%;
  144. z-index: 2;
  145. display: flex;
  146. flex-direction: column;
  147. align-items: center;
  148. }
  149. .divider {
  150. width: 1px;
  151. height: 8vmin;
  152. background: linear-gradient(to bottom, transparent, var(--ink-black), transparent);
  153. margin-bottom: 2vmin;
  154. opacity: 0.3;
  155. }
  156. .action-text {
  157. font-size: 4.5vmin;
  158. color: var(--ink-black);
  159. letter-spacing: 2px;
  160. border-bottom: 1px solid transparent;
  161. padding-bottom: 2px;
  162. transition: all 0.3s;
  163. }
  164. .action-sub {
  165. font-size: 3vmin;
  166. color: var(--ink-gray);
  167. margin-top: 1vmin;
  168. }
  169. /* 交互:按下效果 */
  170. .card-container:active .ink-blob {
  171. transform: scale(0.95);
  172. transition: transform 0.2s;
  173. }
  174. .card-container:active .action-text {
  175. border-bottom-color: var(--seal-red);
  176. color: var(--seal-red);
  177. }
  178. /* 墨迹流动动画 */
  179. @keyframes morph {
  180. 0% { border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%; }
  181. 33% { border-radius: 70% 30% 30% 70% / 60% 40% 60% 40%; }
  182. 66% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
  183. 100% { border-radius: 58% 42% 30% 70% / 55% 55% 45% 45%; }
  184. }
  185. @keyframes breathe {
  186. 0%, 100% { transform: scale(1); opacity: 0.05; }
  187. 50% { transform: scale(1.1); opacity: 0.1; }
  188. }
  189. </style>
  190. </head>
  191. <body>
  192. <div class="card-container" onclick="redirectToDetail()">
  193. <div class="bg-ink"></div>
  194. <!-- 左上角竖排年份 -->
  195. <div class="year-seal">
  196. <span>二</span>
  197. <span>零</span>
  198. <span>二</span>
  199. <span>五</span>
  200. </div>
  201. <!-- 中间墨韵 -->
  202. <div class="ink-wrapper">
  203. <div class="ink-blob">
  204. <div class="month-num">12</div>
  205. </div>
  206. <div class="month-label">月挑战赛</div>
  207. </div>
  208. <!-- 底部极简引导 -->
  209. <div class="action-area">
  210. <div class="divider"></div>
  211. <div class="action-text">点击查看排行榜</div>
  212. <div class="action-sub">Monthly Ranking</div>
  213. </div>
  214. </div>
  215. <script src="./bridge.js"></script>
  216. <script src="./js/target_logic.js"></script>
  217. <script>
  218. // Auto-Update Date
  219. (function() {
  220. const now = new Date();
  221. const year = now.getFullYear().toString();
  222. const month = now.getMonth() + 1;
  223. // 1. Update Month
  224. const monthEl = document.querySelector('.month-num');
  225. if (monthEl) monthEl.innerText = month;
  226. // 2. Update Year (Digit to Chinese)
  227. const cnMap = {'0':'零', '1':'一', '2':'二', '3':'三', '4':'四', '5':'五', '6':'六', '7':'七', '8':'八', '9':'九'};
  228. const yearSeal = document.querySelector('.year-seal');
  229. if (yearSeal) {
  230. let html = '';
  231. for (let char of year) {
  232. const cnChar = cnMap[char] || char;
  233. html += `<span>${cnChar}</span>`;
  234. }
  235. yearSeal.innerHTML = html;
  236. }
  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. // Dynamic Target
  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>