Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
316 lines (312 loc) · 10.8 KB
/
Copy pathindex.html
File metadata and controls
316 lines (312 loc) · 10.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>LobsterAI</title>
<style>
/* Pre-React splash: a static replica of EngineStartupOverlay so the whole
startup (window shown -> renderer init -> engine starting) is one
continuous screen. Replaced automatically when React mounts into #root.
Keep layout/metrics in sync with EngineStartupOverlay.tsx. */
.splash,
.splash * {
box-sizing: border-box;
}
.splash {
position: fixed;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
background: #ffffff;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
html.dark .splash {
background: #1a1d27;
}
.splash-gradient {
position: absolute;
inset: 0;
background: linear-gradient(360deg, rgba(255, 0, 77, 0) 5.5%, rgba(255, 0, 77, 0.05) 100%);
}
.splash-content {
position: relative;
display: flex;
width: 420px;
flex-direction: column;
align-items: center;
padding: 0 24px;
}
.splash-logo-wrap {
position: relative;
margin-bottom: 20px;
}
.splash-logo-glow {
position: absolute;
inset: -8px;
border-radius: 24px;
background: rgba(59, 130, 246, 0.2);
filter: blur(24px);
animation: splash-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.splash-logo {
position: relative;
display: block;
width: 72px;
height: 72px;
border-radius: 16px;
user-select: none;
-webkit-user-drag: none;
}
.splash-title {
margin: 0 0 8px;
font-size: 24px;
line-height: 32px;
font-weight: 700;
color: #1a1d23;
text-align: center;
}
html.dark .splash-title {
color: #e4e5e9;
}
.splash-subtitle {
margin: 0 0 32px;
font-size: 14px;
line-height: 20px;
color: #6b7280;
text-align: center;
}
html.dark .splash-subtitle {
color: #8b8fa3;
}
.splash-bar {
position: relative;
width: 100%;
height: 6px;
border-radius: 9999px;
background: rgba(59, 130, 246, 0.15);
overflow: hidden;
}
.splash-bar-shimmer {
position: absolute;
inset: 0;
background: linear-gradient(to right, transparent, #3b82f6, transparent);
animation: splash-shimmer 1.5s infinite;
}
.splash-bar-below {
width: 100%;
min-height: 16px;
margin-top: 6px;
}
.splash-tips {
width: 100%;
margin-top: 40px;
border: 1px solid rgba(224, 226, 231, 0.3);
border-radius: 12px;
background: rgba(240, 241, 244, 0.6);
padding: 12px 16px;
}
html.dark .splash-tips {
border-color: rgba(42, 46, 56, 0.3);
background: rgba(36, 40, 48, 0.6);
}
.splash-tips-label {
display: flex;
align-items: center;
gap: 6px;
margin-bottom: 4px;
font-size: 12px;
line-height: 16px;
font-weight: 500;
color: #3b82f6;
}
.splash-tips-label svg {
width: 14px;
height: 14px;
flex-shrink: 0;
}
.splash-tip-text {
margin: 0;
min-height: 40px;
font-size: 14px;
line-height: 1.625;
color: #6b7280;
}
html.dark .splash-tip-text {
color: #8b8fa3;
}
.splash-tip-dots {
display: flex;
justify-content: center;
gap: 6px;
margin-top: 8px;
}
.splash-dot {
position: relative;
width: 4px;
height: 4px;
border-radius: 9999px;
background: rgba(59, 130, 246, 0.25);
border: 0;
padding: 0;
margin: 0;
cursor: pointer;
transition: all 0.3s;
-webkit-appearance: none;
appearance: none;
}
/* enlarged hit area, same as the React overlay's after:-inset-* */
.splash-dot::after {
content: '';
position: absolute;
top: -6px;
bottom: -6px;
left: -2px;
right: -2px;
}
.splash-dot:hover {
background: rgba(59, 130, 246, 0.5);
}
.splash-dot-active,
.splash-dot-active:hover {
width: 12px;
background: #3b82f6;
}
@keyframes splash-pulse {
0%,
100% {
opacity: 1;
}
50% {
opacity: 0.5;
}
}
@keyframes splash-shimmer {
0% {
transform: translateX(-100%);
}
100% {
transform: translateX(100%);
}
}
</style>
<script>
// 在页面加载前预设主题,避免闪烁。
// 'lobster-theme-appearance' 由 theme-manager.ts 在每次应用主题时写入。
(function () {
try {
var appearance = localStorage.getItem('lobster-theme-appearance');
if (appearance !== 'dark' && appearance !== 'light') {
appearance = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
}
document.documentElement.classList.add(appearance);
document.documentElement.style.backgroundColor = appearance === 'dark' ? '#0F1117' : '#F8F9FB';
} catch (e) {
console.error('Error applying theme early:', e);
}
})();
</script>
</head>
<body>
<div id="root">
<div class="splash" role="status">
<div class="splash-gradient"></div>
<div class="splash-content">
<div class="splash-logo-wrap">
<div class="splash-logo-glow"></div>
<img class="splash-logo" src="logo.png" alt="LobsterAI" width="72" height="72" draggable="false" />
</div>
<h1 class="splash-title" id="splash-title">AI 引擎启动中</h1>
<p class="splash-subtitle" id="splash-subtitle">加载中...</p>
<div class="splash-bar"><div class="splash-bar-shimmer"></div></div>
<div class="splash-bar-below"></div>
<div class="splash-tips">
<div class="splash-tips-label">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" d="M12 18v-5.25m0 0a6.01 6.01 0 0 0 1.5-.189m-1.5.189a6.01 6.01 0 0 1-1.5-.189m3.75 7.478a12.06 12.06 0 0 1-4.5 0m3.75 2.383a14.406 14.406 0 0 1-3 0M14.25 18v-.192c0-.983.658-1.823 1.508-2.316a7.5 7.5 0 1 0-7.517 0c.85.493 1.509 1.333 1.509 2.316V18" />
</svg>
<span id="splash-tips-label">小提示</span>
</div>
<p class="splash-tip-text" id="splash-tip-text"></p>
<div class="splash-tip-dots" id="splash-tip-dots"></div>
</div>
</div>
</div>
</div>
<script>
// 本地化启动屏文案并随机选一条小提示。
// 'lobster-language' 由 i18n.ts 在语言确定后写入;首次启动回退到系统语言。
// 文案需与 src/renderer/services/i18n.ts 中的 engineStarting* / loading 保持同步。
(function () {
try {
var lang = localStorage.getItem('lobster-language');
if (lang !== 'zh' && lang !== 'en') {
lang = navigator.language === 'zh-CN' ? 'zh' : 'en';
}
var texts = {
zh: {
title: 'AI 引擎启动中',
subtitle: '加载中...',
label: '小提示',
tips: [
'让 AI 生成 HTML、SVG 或 Mermaid 图表,右侧面板会实时预览效果',
'在「技能」中开启 Word、Excel、PPT 技能,AI 可以直接为你生成办公文档',
'用「定时任务」让 AI 在固定时间自动执行例行工作',
'接入微信、飞书、钉钉等聊天工具,在 IM 里随时召唤 AI',
'对 AI 说"记住……",重要信息会写入长期记忆,下次对话自动生效',
'AI 执行敏感操作前会先请求你的确认,可以放心交给它'
]
},
en: {
title: 'Starting AI engine',
subtitle: 'Loading...',
label: 'Tip',
tips: [
'Ask AI for HTML, SVG, or Mermaid diagrams — the side panel previews them live',
'Enable Word, Excel, and PPT skills in Skills, and AI can generate office documents for you',
'Use Scheduled Tasks to have AI run routine work automatically at fixed times',
'Connect WeChat, Feishu, DingTalk and more to summon AI right from your IM apps',
'Tell AI to "remember..." and it saves key facts to long-term memory for future chats',
'AI asks for your approval before sensitive operations, so you stay in control'
]
}
};
var t = texts[lang];
document.getElementById('splash-title').textContent = t.title;
document.getElementById('splash-subtitle').textContent = t.subtitle;
document.getElementById('splash-tips-label').textContent = t.label;
var tipText = document.getElementById('splash-tip-text');
var dots = document.getElementById('splash-tip-dots');
var dotButtons = [];
// React 侧的 EngineStartupOverlay 会读取该值,从同一条小提示继续轮播
function selectTip(idx) {
tipText.textContent = t.tips[idx];
for (var j = 0; j < dotButtons.length; j++) {
dotButtons[j].className = j === idx ? 'splash-dot splash-dot-active' : 'splash-dot';
}
try {
sessionStorage.setItem('lobster-splash-tip-index', String(idx));
} catch (e) {
/* storage unavailable */
}
}
for (var i = 0; i < t.tips.length; i++) {
var dot = document.createElement('button');
dot.type = 'button';
dot.className = 'splash-dot';
dot.setAttribute('aria-label', t.label + ' ' + (i + 1));
dot.addEventListener('click', selectTip.bind(null, i));
dots.appendChild(dot);
dotButtons.push(dot);
}
// 固定从第一条开始,保证每次启动的阅读顺序一致
selectTip(0);
} catch (e) {
/* keep default zh texts */
}
})();
</script>
<script type="module" src="/src/renderer/main.tsx"></script>
</body>
</html>