election-game/web/index.html

72 lines
3.7 KiB
HTML
Raw Permalink Normal View History

<!doctype html>
<html lang="zh-Hant-TW">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>選舉小鎮</title>
選戰卡牌第五版:趕場、政見支票、資源瘦身、新主畫面圖示、修 Bug 資源與載入(docs/27 第 1 節):首頁下載 8.7 → 1.6 MB、載入畫面 4.4 → 1.5 秒,進一局 5.0 → 1.3 MB - 中文字型切成 unicode-range 小片,照畫面出現的頻率排(art/fonts/split-webfonts.py),拿掉 Google Fonts; canvas 上的字(3D 看板、名牌、分享圖)字型片載好再畫一次(ui/canvasFont.ts) - 3D 模型 meshopt 壓縮、只留用到的動作(art/optimize-3d.mjs、game/gltf.ts),5.5 → 1.0 MB - 卡圖 320 px 小圖+srcset(art/cards-small.sh);木紋貼圖縮小;背景音樂改 Opus 96 kbps(art/music-opus.sh) - 新增 GET /api/scenarios/list 只回大廳用到的欄位(1.52 → 0.44 MB);伺服器沒有這條路由時前端改抓舊的清單 玩法(docs/27 第 2–4 節,研究桌遊機制後挑兩個做): - 趕場(推運氣):每週可以翻牌庫頂的牌免費打,越翻越容易翻車(POST /api/rogue/runs/:id/overtime) - 政見支票(藏起來的長期目標):第 1 週開跑記者會三選一或不開,開票時兌現全市加票、跳票掉票 新主畫面圖示:重畫投票箱(art/icon/icon.svg、render-icons.sh),apple-touch 滿版不透明,加 Android maskable 修 Bug: - 舊版伺服器沒有新路由時,首頁、政治生涯的紅色「Not Found」改成照樣能用;版本對不上時寫中文說明 - 捏人物「存起來,去政治生涯」直接選好剛捏的角色、跳到選家鄉 - 政見支票:開票畫面的兌現與否和開票結果一致(照投票日的票數判定);跳過=不開;模擬玩家都不開 - 趕場翻到的免費牌只免費一次 - 劇本清單算錯一次後不會一直回錯誤 - 分享圖的標語、減少動態效果時的 3D 看板,字型晚到後重畫 - Safari 解不開 OGG 時改放 MP3 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 09:04:19 +00:00
<link rel="icon" href="/favicon.svg?v=2" type="image/svg+xml" />
<link rel="icon" href="/icon-192.png" type="image/png" sizes="192x192" />
選戰卡牌第五版:趕場、政見支票、資源瘦身、新主畫面圖示、修 Bug 資源與載入(docs/27 第 1 節):首頁下載 8.7 → 1.6 MB、載入畫面 4.4 → 1.5 秒,進一局 5.0 → 1.3 MB - 中文字型切成 unicode-range 小片,照畫面出現的頻率排(art/fonts/split-webfonts.py),拿掉 Google Fonts; canvas 上的字(3D 看板、名牌、分享圖)字型片載好再畫一次(ui/canvasFont.ts) - 3D 模型 meshopt 壓縮、只留用到的動作(art/optimize-3d.mjs、game/gltf.ts),5.5 → 1.0 MB - 卡圖 320 px 小圖+srcset(art/cards-small.sh);木紋貼圖縮小;背景音樂改 Opus 96 kbps(art/music-opus.sh) - 新增 GET /api/scenarios/list 只回大廳用到的欄位(1.52 → 0.44 MB);伺服器沒有這條路由時前端改抓舊的清單 玩法(docs/27 第 2–4 節,研究桌遊機制後挑兩個做): - 趕場(推運氣):每週可以翻牌庫頂的牌免費打,越翻越容易翻車(POST /api/rogue/runs/:id/overtime) - 政見支票(藏起來的長期目標):第 1 週開跑記者會三選一或不開,開票時兌現全市加票、跳票掉票 新主畫面圖示:重畫投票箱(art/icon/icon.svg、render-icons.sh),apple-touch 滿版不透明,加 Android maskable 修 Bug: - 舊版伺服器沒有新路由時,首頁、政治生涯的紅色「Not Found」改成照樣能用;版本對不上時寫中文說明 - 捏人物「存起來,去政治生涯」直接選好剛捏的角色、跳到選家鄉 - 政見支票:開票畫面的兌現與否和開票結果一致(照投票日的票數判定);跳過=不開;模擬玩家都不開 - 趕場翻到的免費牌只免費一次 - 劇本清單算錯一次後不會一直回錯誤 - 分享圖的標語、減少動態效果時的 3D 看板,字型晚到後重畫 - Safari 解不開 OGG 時改放 MP3 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 09:04:19 +00:00
<!-- 圖示原稿在 art/icon(render-icons.sh 出各尺寸);?v= 是換圖時讓 iPhone、瀏覽器不用舊的快取 -->
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png?v=2" />
<link rel="manifest" href="/manifest.webmanifest" />
<meta name="theme-color" content="#d61f2c" />
選戰卡牌第五版:趕場、政見支票、資源瘦身、新主畫面圖示、修 Bug 資源與載入(docs/27 第 1 節):首頁下載 8.7 → 1.6 MB、載入畫面 4.4 → 1.5 秒,進一局 5.0 → 1.3 MB - 中文字型切成 unicode-range 小片,照畫面出現的頻率排(art/fonts/split-webfonts.py),拿掉 Google Fonts; canvas 上的字(3D 看板、名牌、分享圖)字型片載好再畫一次(ui/canvasFont.ts) - 3D 模型 meshopt 壓縮、只留用到的動作(art/optimize-3d.mjs、game/gltf.ts),5.5 → 1.0 MB - 卡圖 320 px 小圖+srcset(art/cards-small.sh);木紋貼圖縮小;背景音樂改 Opus 96 kbps(art/music-opus.sh) - 新增 GET /api/scenarios/list 只回大廳用到的欄位(1.52 → 0.44 MB);伺服器沒有這條路由時前端改抓舊的清單 玩法(docs/27 第 2–4 節,研究桌遊機制後挑兩個做): - 趕場(推運氣):每週可以翻牌庫頂的牌免費打,越翻越容易翻車(POST /api/rogue/runs/:id/overtime) - 政見支票(藏起來的長期目標):第 1 週開跑記者會三選一或不開,開票時兌現全市加票、跳票掉票 新主畫面圖示:重畫投票箱(art/icon/icon.svg、render-icons.sh),apple-touch 滿版不透明,加 Android maskable 修 Bug: - 舊版伺服器沒有新路由時,首頁、政治生涯的紅色「Not Found」改成照樣能用;版本對不上時寫中文說明 - 捏人物「存起來,去政治生涯」直接選好剛捏的角色、跳到選家鄉 - 政見支票:開票畫面的兌現與否和開票結果一致(照投票日的票數判定);跳過=不開;模擬玩家都不開 - 趕場翻到的免費牌只免費一次 - 劇本清單算錯一次後不會一直回錯誤 - 分享圖的標語、減少動態效果時的 3D 看板,字型晚到後重畫 - Safari 解不開 OGG 時改放 MP3 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 09:04:19 +00:00
<!-- 字型都在 src/theme/tokens.css(自己放、切成小片),不連外部;載入畫面只用系統字,馬上畫得出來 -->
<style>
/* 載入畫面:只用內嵌的 HTML/CSS,不等任何下載就畫得出來;src/splash.ts 更新進度、淡出 */
#splash {
position: fixed;
inset: 0;
z-index: 1000;
display: grid;
place-content: center;
justify-items: center;
gap: 18px;
background: #ecebe6;
color: #111419;
font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
transition: opacity 300ms ease;
}
#splash.is-done { opacity: 0; pointer-events: none; }
#splash .splash-stamp {
padding: 10px 22px;
border: 5px solid #d61f2c;
border-radius: 14px;
color: #d61f2c;
font-size: clamp(34px, 8vw, 56px);
font-weight: 900;
letter-spacing: 0.12em;
transform: rotate(-4deg);
animation: splash-stamp 1.8s ease-in-out infinite;
}
#splash .splash-bar { position: relative; width: min(260px, 70vw); height: 8px; border-radius: 999px; background: rgb(17 20 25 / 0.12); overflow: hidden; }
/* 進度條上一直跑的光、印章輕輕蓋章:只動 transform,主執行緒在搭 3D 小鎮的時候也不會停 */
#splash .splash-bar::after { content: ""; position: absolute; inset: 0; width: 35%; background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.75), transparent); animation: splash-run 1.1s linear infinite; will-change: transform; }
@keyframes splash-run { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
@keyframes splash-stamp { 0%, 100% { transform: rotate(-4deg) scale(1); } 45% { transform: rotate(-4deg) scale(1); } 55% { transform: rotate(-4deg) scale(0.93); } 65% { transform: rotate(-4deg) scale(1.02); } }
#splash .splash-fill { width: 8%; height: 100%; border-radius: inherit; background: #d61f2c; transition: width 250ms ease; }
#splash .splash-text { margin: 0; font-size: 14px; color: #5b6270; }
@media (prefers-color-scheme: dark) {
#splash { background: #0b1420; color: #eef1f5; }
#splash .splash-stamp { border-color: #ff4d5a; color: #ff4d5a; }
#splash .splash-bar { background: rgb(238 241 245 / 0.14); }
#splash .splash-fill { background: #ff4d5a; }
#splash .splash-text { color: #a9b2bf; }
}
@media (prefers-reduced-motion: reduce) {
#splash, #splash .splash-fill { transition: none; }
#splash .splash-stamp { animation: none; }
#splash .splash-bar::after { animation-duration: 2.4s; }
}
</style>
</head>
<body>
<div id="splash" role="status" aria-live="polite">
<div class="splash-stamp">選舉小鎮</div>
<div class="splash-bar" aria-hidden="true"><div class="splash-fill"></div></div>
<p class="splash-text">載入中…</p>
</div>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>