mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-10-02 04:52:50 +08:00
feat(web): 给 WebUI 加站点图标与 Web App Manifest
收藏机器人控制页时浏览器只显示空白页图标,移动端加到主屏幕也没有图标。 新增 web/public/:一个蓝底白色八分音符(配色取自 --color-primary #335eea) 的 favicon.svg,以及 16/32/48 三尺寸的 favicon.ico、180px 的 apple-touch-icon、 192/512 的 PNG 和一张 maskable 图标,配 site.webmanifest 供 Android 添加到 主屏幕使用。iOS 会自己裁圆角,所以 apple-touch-icon 是满幅方形。 放在 web/public/ 是因为 Vite 会原样复制到 dist 根目录,而 Express 已经在 serve web/dist(src/index.ts STATIC_DIR),静态资源又不在 /api 鉴权范围内, 所以登录页也能显示,无需改动服务端。同时补上真实的 /favicon.ico —— 没有它 时 SPA 兜底路由会对 /favicon.ico 返回 index.html 和 200,浏览器只会静默地 继续用空白图标。 theme-color 取深色主题的 --bg-primary(#222222):前端默认深色且不跟随系统 配色(stores/player.ts)。 Closes #142 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
db2e70fb11
commit
55695c2d1c
8 files changed
+52
No files matched your search
@@ -22,6 +22,22 @@
|
||||
"same-origin" keeps the real Origin on same-origin requests, so CSRF passes. -->
|
||||
<meta name="referrer" content="same-origin">
|
||||
<title>TSMusicBot</title>
|
||||
<!-- Icons live in web/public/ so Vite copies them to the dist root, which is
|
||||
what Express serves (src/index.ts STATIC_DIR). Both an .ico and an .svg
|
||||
are declared: browsers that understand the vector one prefer it and stay
|
||||
sharp on hi-dpi tabs, the rest fall back to the .ico. The .ico also
|
||||
answers the implicit /favicon.ico request — without a real file there the
|
||||
SPA catch-all hands back index.html with a 200, so the tab silently keeps
|
||||
the blank-page icon (issue #142). -->
|
||||
<link rel="icon" href="/favicon.ico" sizes="48x48">
|
||||
<link rel="icon" href="/favicon.svg" type="image/svg+xml" sizes="any">
|
||||
<!-- iOS home-screen icon; iOS masks the corners itself, so this one is a
|
||||
full square. Android reads the manifest instead. -->
|
||||
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
|
||||
<link rel="manifest" href="/site.webmanifest">
|
||||
<!-- Matches --bg-primary of the dark theme, which is what the app starts in
|
||||
(stores/player.ts defaults to 'dark' and never follows the OS scheme). -->
|
||||
<meta name="theme-color" content="#222222">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700;800&display=swap" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
@@ -0,0 +1,10 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
|
||||
<rect width="100" height="100" rx="22" fill="#335eea"/>
|
||||
<g fill="#ffffff" transform="translate(48.46 51.1) scale(0.88) translate(-50 -50)">
|
||||
<path d="M43.5 24 L86.5 15 L86.5 26 L43.5 35 Z"/>
|
||||
<rect x="43.5" y="24" width="6" height="47"/>
|
||||
<rect x="80.5" y="15" width="6" height="47"/>
|
||||
<ellipse cx="32" cy="71" rx="15" ry="11.5" transform="rotate(-20 32 71)"/>
|
||||
<ellipse cx="69" cy="62" rx="15" ry="11.5" transform="rotate(-20 69 62)"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 533 B |
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.8 KiB |
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "TSMusicBot",
|
||||
"short_name": "TSMusicBot",
|
||||
"start_url": "/",
|
||||
"display": "standalone",
|
||||
"background_color": "#222222",
|
||||
"theme_color": "#222222",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/icon-192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "/icon-512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "/icon-maskable-512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user