Add ccweb app icons

This commit is contained in:
shiyue
2026-06-24 17:34:27 +08:00
parent 5511a9d7e6
commit 785cf79025
10 changed files with 38 additions and 15 deletions

View File

@@ -2,7 +2,7 @@
(function () {
'use strict';
const ASSET_VERSION = '20260622-streaming-restore';
const ASSET_VERSION = '20260624-icon-refresh';
const WS_URL = `${location.protocol === 'https:' ? 'wss' : 'ws'}://${location.host}/ws`;
const RENDER_DEBOUNCE = 100;
const COMPOSER_SUGGESTION_DEBOUNCE = 120;
@@ -7569,6 +7569,7 @@
navigator.serviceWorker.ready.then((reg) => {
reg.showNotification('CC-Web', {
body: `${title}」任务完成`,
icon: '/icon-192.png',
tag: 'cc-web-task',
renotify: true,
});
@@ -8533,7 +8534,7 @@
panel.className = 'force-change-panel';
panel.innerHTML = `
<div class="login-logo">CC</div>
<img class="login-logo" src="icon-192.png" alt="CC-Web">
<h2>修改初始密码</h2>
<p>首次登录需要设置新密码</p>
<div class="force-change-form">

BIN
public/apple-touch-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
public/favicon-32x32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
public/icon-192.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
public/icon-512.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB

View File

@@ -5,7 +5,13 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="application-name" content="CC-Web">
<meta name="theme-color" content="#020c16">
<title>CC-Web</title>
<link rel="icon" href="favicon.ico" sizes="any">
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
<link rel="manifest" href="site.webmanifest">
<script>
(function () {
var theme = localStorage.getItem('cc-web-theme') || 'washi';
@@ -14,14 +20,14 @@
document.documentElement.dataset.dividerTime = dividerTime;
})();
</script>
<link rel="stylesheet" href="style.css?v=20260622-streaming-restore">
<link rel="stylesheet" href="style.css?v=20260624-icon-refresh">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/atom-one-dark.min.css">
</head>
<body>
<!-- Login -->
<div id="login-overlay" class="login-overlay">
<div class="login-box">
<div class="login-logo">CC</div>
<img class="login-logo" src="icon-192.png" alt="CC-Web">
<h2>CC-Web</h2>
<p>Claude / Codex Web Chat</p>
<form id="login-form">
@@ -163,6 +169,6 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/12.0.1/marked.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mermaid/10.9.1/mermaid.min.js"></script>
<script src="app.js?v=20260622-streaming-restore"></script>
<script src="app.js?v=20260624-icon-refresh"></script>
</body>
</html>

20
public/site.webmanifest Normal file
View File

@@ -0,0 +1,20 @@
{
"name": "CC-Web",
"short_name": "CC-Web",
"start_url": ".",
"display": "standalone",
"background_color": "#020c16",
"theme_color": "#020c16",
"icons": [
{
"src": "icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "icon-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}

View File

@@ -811,12 +811,10 @@ body {
.login-logo {
width: 64px; height: 64px;
margin: 0 auto 16px;
background: var(--accent);
color: #fff;
border-radius: 16px;
display: flex; align-items: center; justify-content: center;
font-size: 24px; font-weight: 800;
letter-spacing: -1px;
display: block;
object-fit: contain;
filter: drop-shadow(0 10px 18px rgba(0, 20, 34, 0.24));
}
.login-box h2 {
font-size: 24px;
@@ -4245,11 +4243,9 @@ html[data-divider-time='hide'] .msg-bubble .agent-message-divider span {
.force-change-panel .login-logo {
width: 56px; height: 56px;
margin: 0 auto 12px;
background: var(--accent);
color: #fff;
border-radius: 14px;
display: flex; align-items: center; justify-content: center;
font-size: 20px; font-weight: 800;
display: block;
object-fit: contain;
}
.force-change-panel h2 {
font-size: 22px;

View File

@@ -4,7 +4,7 @@ self.addEventListener('message', (event) => {
event.waitUntil(
self.registration.showNotification(event.data.title || 'CC-Web', {
body: event.data.body || '',
icon: event.data.icon || undefined,
icon: event.data.icon || '/icon-192.png',
tag: 'cc-web-task',
renotify: true,
data: event.data.data || {},