| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334 |
- <!DOCTYPE html>
- <html lang="zh-CN">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
- <title>月度排行榜</title>
- <link href="./css/all.min.css" rel="stylesheet">
- <style>
- :root {
- --ink-bg: #f4f3ee; /* 宣纸白 */
- --ink-black: #2b2b2b; /* 浓墨 */
- --ink-gray: #999999; /* 淡墨 */
- --seal-red: #b73e3e; /* 朱砂红 */
- }
- * {
- box-sizing: border-box;
- margin: 0;
- padding: 0;
- /* 优先使用衬线体/楷体,营造文化感 */
- font-family: "Kaiti SC", "STKaiti", "KaiTi", "Songti SC", "SimSun", serif;
- -webkit-tap-highlight-color: transparent;
- user-select: none;
- }
- html, body {
- width: 100%;
- height: 100%;
- overflow: hidden;
- background: transparent;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- /* 主容器 */
- .card-container {
- width: 100%;
- height: 100%;
- position: relative;
- background-color: var(--ink-bg);
- border-radius: 20px;
- overflow: hidden; /* 核心裁剪 */
- cursor: pointer;
- display: flex;
- flex-direction: column;
- align-items: center;
- /* 模拟宣纸纹理 */
- 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");
- box-shadow: 0 10px 30px rgba(0,0,0,0.1);
- /* 强制硬件加速 & 遮罩修复圆角 */
- transform: translateZ(0);
- -webkit-mask-image: -webkit-radial-gradient(white, black); /* 兼容性修复:强制裁剪 */
- }
- /* 背景淡墨山水意向 */
- .bg-ink {
- position: absolute;
- bottom: -10%;
- left: -10%;
- width: 120%;
- height: 50%;
- background: radial-gradient(ellipse at 50% 100%, rgba(0,0,0,0.05) 0%, transparent 70%);
- filter: blur(20px);
- z-index: 0;
- animation: breathe 10s infinite ease-in-out;
- pointer-events: none;
- }
- /* 左上角年份 - 竖排印章风格 */
- .year-seal {
- position: absolute;
- top: 8%;
- left: 8%;
- width: 10vmin;
- height: auto;
- padding: 2vmin 1vmin;
- border: 2px solid var(--seal-red);
- color: var(--seal-red);
- font-size: 4.5vmin;
- font-weight: bold;
- z-index: 2;
- opacity: 0.8;
- border-radius: 4px;
- box-shadow: 2px 2px 0 rgba(183, 62, 62, 0.1);
-
- /* 使用 Flexbox 强制竖排,避免 writing-mode 兼容性问题 */
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- gap: 0.5vmin; /* 字间距 */
- }
- /* 核心视觉:动态墨韵圆 */
- .ink-wrapper {
- flex: 1;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- position: relative;
- z-index: 1;
- width: 100%;
- }
- .ink-blob {
- position: absolute;
- width: 55vmin;
- height: 55vmin;
- background: var(--ink-black);
- /* 利用不规则圆角模拟墨迹 */
- border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%;
- opacity: 0.9;
- animation: morph 8s ease-in-out infinite both alternate;
- display: flex;
- justify-content: center;
- align-items: center;
- }
-
- /* 第二层淡墨,增加层次 */
- .ink-blob::before {
- content: '';
- position: absolute;
- width: 110%;
- height: 110%;
- background: var(--ink-black);
- border-radius: 58% 42% 30% 70% / 55% 55% 45% 45%;
- opacity: 0.1;
- z-index: -1;
- animation: morph 12s ease-in-out infinite both alternate-reverse;
- }
- .month-num {
- font-size: 30vmin;
- color: var(--ink-bg);
- font-weight: bold;
- font-family: "Times New Roman", serif; /* 西文衬线体配合中文环境 */
- z-index: 2;
- position: relative;
- margin-top: -2vmin;
- }
- .month-label {
- position: absolute;
- bottom: -10vmin;
- font-size: 6vmin;
- color: var(--ink-black);
- letter-spacing: 1vmin;
- font-weight: bold;
- }
- /* 底部按钮 - 极简线条 */
- .action-area {
- margin-bottom: 15%;
- z-index: 2;
- display: flex;
- flex-direction: column;
- align-items: center;
- }
- .divider {
- width: 1px;
- height: 8vmin;
- background: linear-gradient(to bottom, transparent, var(--ink-black), transparent);
- margin-bottom: 2vmin;
- opacity: 0.3;
- }
- .action-text {
- font-size: 4.5vmin;
- color: var(--ink-black);
- letter-spacing: 2px;
- border-bottom: 1px solid transparent;
- padding-bottom: 2px;
- transition: all 0.3s;
- }
-
- .action-sub {
- font-size: 3vmin;
- color: var(--ink-gray);
- margin-top: 1vmin;
- }
- /* 交互:按下效果 */
- .card-container:active .ink-blob {
- transform: scale(0.95);
- transition: transform 0.2s;
- }
- .card-container:active .action-text {
- border-bottom-color: var(--seal-red);
- color: var(--seal-red);
- }
- /* 墨迹流动动画 */
- @keyframes morph {
- 0% { border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%; }
- 33% { border-radius: 70% 30% 30% 70% / 60% 40% 60% 40%; }
- 66% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
- 100% { border-radius: 58% 42% 30% 70% / 55% 55% 45% 45%; }
- }
- @keyframes breathe {
- 0%, 100% { transform: scale(1); opacity: 0.05; }
- 50% { transform: scale(1.1); opacity: 0.1; }
- }
- </style>
- </head>
- <body>
- <div class="card-container" onclick="redirectToDetail()">
- <div class="bg-ink"></div>
- <!-- 左上角竖排年份 -->
- <div class="year-seal">
- <span>二</span>
- <span>零</span>
- <span>二</span>
- <span>五</span>
- </div>
- <!-- 中间墨韵 -->
- <div class="ink-wrapper">
- <div class="ink-blob">
- <div class="month-num">12</div>
- </div>
- <div class="month-label">月挑战赛</div>
- </div>
- <!-- 底部极简引导 -->
- <div class="action-area">
- <div class="divider"></div>
- <div class="action-text">点击查看排行榜</div>
- <div class="action-sub">Monthly Ranking</div>
- </div>
- </div>
- <script src="./bridge.js"></script>
- <script src="./js/target_logic.js"></script>
- <script>
- // Auto-Update Date
- (function() {
- const now = new Date();
- const year = now.getFullYear().toString();
- const month = now.getMonth() + 1;
-
- // 1. Update Month
- const monthEl = document.querySelector('.month-num');
- if (monthEl) monthEl.innerText = month;
- // 2. Update Year (Digit to Chinese)
- const cnMap = {'0':'零', '1':'一', '2':'二', '3':'三', '4':'四', '5':'五', '6':'六', '7':'七', '8':'八', '9':'九'};
- const yearSeal = document.querySelector('.year-seal');
-
- if (yearSeal) {
- let html = '';
- for (let char of year) {
- const cnChar = cnMap[char] || char;
- html += `<span>${cnChar}</span>`;
- }
- yearSeal.innerHTML = html;
- }
- })();
- // Logger Utility
- const Logger = {
- _isDev: false,
- init: function(isDev) {
- this._isDev = isDev;
- },
- log: function() {
- if (this._isDev) {
- console.log.apply(console, arguments);
- }
- },
- warn: function() {
- if (this._isDev) {
- console.warn.apply(console, arguments);
- }
- },
- error: function() {
- console.error.apply(console, arguments);
- }
- };
- function getQueryParam(name) {
- const params = new URLSearchParams(window.location.search);
- return params.get(name);
- }
- // Initialize Logger
- const env = (getQueryParam('env') || '').toLowerCase();
- Logger.init(env === 'mock'); // Only log if env=mock
- function redirectToDetail() {
- const token = getQueryParam('token');
- const id = getQueryParam('id');
-
- // Dynamic Target
- let detailUrl = getTargetDetail();
- const queryParams = [];
- if (token) {
- queryParams.push(`token=${encodeURIComponent(token)}`);
- }
- if (id) {
- queryParams.push(`id=${encodeURIComponent(id)}`);
- }
- if (queryParams.length > 0) {
- detailUrl += `?${queryParams.join('&')}`;
- }
-
- detailUrl += (detailUrl.includes('?') ? '&' : '?') + 'full=true';
- Logger.log("Navigating to:", detailUrl);
-
- if (window.Bridge && window.Bridge.appAction) {
- Bridge.appAction(detailUrl);
- } else {
- window.location.href = detailUrl;
- }
- }
- </script>
- </body>
- </html>
|