Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:sparkles: New booting UI

Danielda82c9b17f52
diff --git a/app/appearance/boot/index.html b/app/appearance/boot/index.html
index c25d44b373..7e554b992a 100644
--- a/app/appearance/boot/index.html
+++ b/app/appearance/boot/index.html
@@ -16,20 +16,182 @@
font-size: 12px;
font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";
}
+
+ #bg {
+ width: 100%;
+ display: flex;
+ justify-content: space-around;
+ height: 100%;
+ }
+
+ #bg svg {
+ width: 24vh;
+ height: 24vh;
+ align-self: center;
+ }
+
+ /* 斜向发光光带:从屏幕四周汇聚飞向 logo 区域,到位后淡出 */
+ #bg svg .streak {
+ opacity: 0;
+ transform-box: fill-box;
+ transform-origin: center;
+ animation: bootStreakConverge 1.8s cubic-bezier(0.33, 0, 0.2, 1) var(--delay, 0s) forwards,
+ bootStreakFade 0.6s ease 1.6s forwards;
+ }
+
+ @keyframes bootStreakConverge {
+ 0% {
+ opacity: 0;
+ transform: translate(var(--dx, 0), var(--dy, 0));
+ }
+ 20% {
+ opacity: 0.9;
+ }
+ 100% {
+ opacity: 0.9;
+ transform: translate(0, 0);
+ }
+ }
+
+ @keyframes bootStreakFade {
+ to {
+ opacity: 0;
+ }
+ }
+
+ /* logo 碎片成型:光带汇聚末期柔和浮现,之后静止 */
+ #bg svg .logo path {
+ opacity: 0;
+ transform-box: fill-box;
+ transform-origin: center;
+ transform: scale(0.94);
+ animation: bootLogoForm 1s cubic-bezier(0.22, 1, 0.36, 1) 1.5s forwards;
+ }
+
+ @keyframes bootLogoForm {
+ 0% {
+ opacity: 0;
+ transform: scale(0.94);
+ }
+ 100% {
+ opacity: 1;
+ transform: scale(1);
+ }
+ }
+
+ /* 底部进度区,预留安全区域防止移动端手势条遮挡 */
+ #progressWrap {
+ position: absolute;
+ bottom: env(safe-area-inset-bottom);
+ width: 100%;
+ padding-bottom: env(safe-area-inset-bottom);
+ }
+
+ #progressTrack {
+ position: absolute;
+ height: 2px;
+ background-color: #2a2c2f;
+ width: 100%;
+ top: 0;
+ }
+
+ #progress {
+ position: absolute;
+ height: 2px;
+ background-color: #3b3e43;
+ box-shadow: 0 0 8px rgba(59, 62, 67, 0.6);
+ transition: width 0.6s cubic-bezier(0, 0, 0.2, 1);
+ top: 0;
+ width: 0;
+ }
+
+ #details {
+ color: #9aa0a6;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+ padding: 8px;
+ height: 16px;
+ line-height: 16px;
+ }
</style>
</head>
<body>
-<div id="bg" style="width: 100%;display: flex;justify-content: space-around;height: 100%;">
- <img style="width:36vh;align-self: center;" src="icon.png"/>
+<div id="bg">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
+ <g class="streaks"></g>
+ <g class="logo">
+ <path fill="#d23f31" d="M37.052 371.676l269.857-269.857v550.507l-269.857 269.857z"></path>
+ <path fill="#3b3e43" d="M306.909 101.818l205.091 205.091v550.507l-205.091-205.091z"></path>
+ <path fill="#d23f31" d="M512 306.909l205.091-205.091v550.507l-205.091 205.091z"></path>
+ <path fill="#3b3e43" d="M717.091 101.818l269.857 269.857v550.507l-269.857-269.857z"></path>
+ </g>
+ </svg>
</div>
-<div style="position: absolute;bottom: 0;width: 100%;">
- <div style="position: absolute;height: 1px;background-color: #3b3e43;width: 100%;top:0"></div>
- <div id="progress"
- style="position: absolute;height: 1px;background-color: #d23f31;transition: width 50ms cubic-bezier(0, 0, 0.2, 1);top:0"></div>
- <div id="details"
- style="color: #9aa0a6;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;padding: 8px;"></div>
+<div id="progressWrap">
+ <div id="progressTrack"></div>
+ <div id="progress"></div>
+ <div id="details"></div>
</div>
<script>
+ // 生成斜向发光光带,沿 logo 折页的斜边排布,汇聚到位时勾勒出 logo 形状
+ (() => {
+ const streaksG = document.querySelector("#bg svg .streaks");
+ if (!streaksG) {
+ return;
+ }
+ const svgNS = "http://www.w3.org/2000/svg";
+ // logo 4 块碎片的斜边:每条 [x1,y1,x2,y2] + 主色,方向沿该块折页的倾斜
+ const edges = [
+ // 块1(红):右上倾斜,顶/底两条斜边
+ {x1: 37, y1: 372, x2: 307, y2: 102, color: "#d23f31"},
+ {x1: 37, y1: 922, x2: 307, y2: 652, color: "#d23f31"},
+ // 块2(灰):右下倾斜
+ {x1: 307, y1: 102, x2: 512, y2: 307, color: "#3b3e43"},
+ {x1: 307, y1: 652, x2: 512, y2: 857, color: "#3b3e43"},
+ // 块3(红):右上倾斜
+ {x1: 512, y1: 307, x2: 717, y2: 102, color: "#d23f31"},
+ {x1: 512, y1: 857, x2: 717, y2: 652, color: "#d23f31"},
+ // 块4(灰):右下倾斜
+ {x1: 717, y1: 102, x2: 987, y2: 372, color: "#3b3e43"},
+ {x1: 717, y1: 652, x2: 987, y2: 922, color: "#3b3e43"},
+ ];
+ const perEdge = 12; // 每条斜边上的光带数
+ edges.forEach((e) => {
+ for (let i = 0; i < perEdge; i++) {
+ // 沿斜边均匀采样终点(带轻微抖动,避免过于规整)
+ const t = (i + 0.5) / perEdge + (Math.random() - 0.5) * 0.08;
+ const ex = e.x1 + (e.x2 - e.x1) * t;
+ const ey = e.y1 + (e.y2 - e.y1) * t;
+ // 光带沿斜边方向延伸(长度为该斜边方向上的一小段)
+ const len = 60 + Math.random() * 80;
+ const ux = (e.x2 - e.x1);
+ const uy = (e.y2 - e.y1);
+ const ul = Math.sqrt(ux * ux + uy * uy);
+ // 起点沿斜边反方向延伸 len
+ const sx = ex - ux / ul * len;
+ const sy = ey - uy / ul * len;
+ const line = document.createElementNS(svgNS, "line");
+ line.setAttribute("x1", sx);
+ line.setAttribute("y1", sy);
+ line.setAttribute("x2", ex);
+ line.setAttribute("y2", ey);
+ line.setAttribute("stroke", e.color);
+ line.setAttribute("stroke-width", 3 + Math.random() * 3);
+ line.setAttribute("stroke-linecap", "round");
+ line.setAttribute("class", "streak");
+ line.style.filter = "drop-shadow(0 0 4px rgba(210,63,49,.5))";
+ // 光带初始从该斜边的法向外侧远处出发,汇聚时平移回斜边
+ const angle = Math.random() * Math.PI * 2;
+ const dist = 600 + Math.random() * 800;
+ line.style.setProperty("--dx", Math.cos(angle) * dist + "px");
+ line.style.setProperty("--dy", Math.sin(angle) * dist + "px");
+ line.style.setProperty("--delay", (Math.random() * 0.6) + "s");
+ streaksG.appendChild(line);
+ }
+ });
+ })();
+
const getSearch = (key) => {
if (window.location.search.indexOf('?') === -1) {
return ''
@@ -46,25 +208,52 @@
return value
}
+ // 进度文案直接使用内核推送的原始英文
const redirect = () => {
const uri = 'http://127.0.0.1:' + location.port
window.location.replace(uri)
}
(async () => {
const v = getSearch('v')
- document.getElementById('details').textContent = "v" + v + ' Booting kernel...'
+ const progressEl = document.getElementById('progress')
+ const detailsEl = document.getElementById('details')
+ detailsEl.textContent = "v" + v + ' Booting kernel...'
+ const bootShowStart = Date.now()
+
+ // 随机起始基数(15~25),等待内核进度时先平滑填充到此值
+ const baseProgress = 15 + Math.random() * 10
+ // 当前进度只增不减,避免内核首帧进度小于初始基数时进度条倒退回 0
+ let currentDisplay = 0
+ const setProgress = (target) => {
+ if (target > currentDisplay) {
+ currentDisplay = target
+ progressEl.style.width = target + '%'
+ }
+ }
+ // 先平滑填充到随机基数
+ setProgress(baseProgress)
+
let progressing = false
const subscribe = () => {
const es = new EventSource('http://127.0.0.1:' + location.port + '/api/system/bootProgressSSE')
es.onmessage = (event) => {
const progressData = JSON.parse(event.data)
- document.getElementById('progress').style.width = progressData.progress + '%'
- document.getElementById('details').textContent = progressData.details
+ // 内核进度按比例映射到 baseProgress~100 区间,从当前显示值继续递增
+ const display = baseProgress + progressData.progress * (100 - baseProgress) / 100
+ setProgress(display)
+ detailsEl.textContent = progressData.details
if (progressData.progress >= 100) {
progressing = true
es.close()
if (navigator.userAgent.indexOf('Electron') === -1) {
- redirect()
+ // 保证启动动画的最小展示时长,启动过快时补足差值再跳转
+ const elapsed = Date.now() - bootShowStart
+ const minDuration = 2500
+ if (elapsed < minDuration) {
+ setTimeout(redirect, minDuration - elapsed)
+ } else {
+ redirect()
+ }
}
}
}
diff --git a/app/electron/boot.html b/app/electron/boot.html
index 1482993f3f..7f910820ae 100644
--- a/app/electron/boot.html
+++ b/app/electron/boot.html
@@ -16,18 +16,49 @@
font-size: 12px;
font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";
}
+
+ /* 底部进度区,预留安全区域防止移动端手势条遮挡 */
+ #progressWrap {
+ position: absolute;
+ bottom: env(safe-area-inset-bottom);
+ width: 100%;
+ padding-bottom: env(safe-area-inset-bottom);
+ }
+
+ #progressTrack {
+ position: absolute;
+ height: 2px;
+ background-color: #2a2c2f;
+ width: 100%;
+ top: 0;
+ }
+
+ #progress {
+ position: absolute;
+ height: 2px;
+ background-color: #3b3e43;
+ box-shadow: 0 0 8px rgba(59, 62, 67, 0.6);
+ transition: width 2s cubic-bezier(0, 0, 0.2, 1);
+ top: 0;
+ width: 0;
+ }
+
+ #details {
+ color: #9aa0a6;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+ padding: 8px;
+ height: 16px;
+ line-height: 16px;
+ }
</style>
</head>
<body>
-<div id="bg" style="width: 100%;display: flex;justify-content: space-around;height: 100%;">
- <img style="width:36vh;align-self: center;" src="icon.png"/>
-</div>
-<div style="position: absolute;bottom: 0;width: 100%;">
- <div style="position: absolute;height: 1px;background-color: #3b3e43;width: 100%;top:0"></div>
- <div id="progress"
- style="position: absolute;height: 1px;background-color: #d23f31;transition: width 50ms cubic-bezier(0, 0, 0.2, 1);top:0"></div>
- <div id="details"
- style="color: #9aa0a6;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;padding: 8px;height: 16px;line-height: 16px;"></div>
+<div id="progressWrap">
+ <div id="progressTrack"></div>
+ <div id="progress"></div>
+ <div id="details"></div>
</div>
<script>
const getSearch = (key) => {
@@ -48,6 +79,11 @@
(async () => {
const v = getSearch('v')
document.getElementById('details').textContent = "v" + v + ' Booting kernel...'
+ // 随机起始基数(15~25),等待内核 HTTP 就绪前先平滑填充到此值
+ const baseProgress = 15 + Math.random() * 10
+ requestAnimationFrame(() => {
+ document.getElementById('progress').style.width = baseProgress + '%'
+ })
})()
</script>
</body>
diff --git a/app/electron/main.js b/app/electron/main.js
index a89ded068b..30093cbe95 100644
--- a/app/electron/main.js
+++ b/app/electron/main.js
@@ -764,11 +764,17 @@ const initKernel = (workspace, port, lang, safeMode) => {
resolve(false);
} else {
let progressing = false;
+ const bootShowStart = Date.now();
while (!progressing) {
try {
const progressResult = await net.fetch(getServer() + "/api/system/bootProgress");
const progressData = await progressResult.json();
if (progressData.data.progress >= 100) {
+ // 保证启动动画的最小展示时长,启动过快时补足差值再进入主窗口
+ const elapsed = Date.now() - bootShowStart;
+ if (elapsed < 2500) {
+ await sleep(2500 - elapsed);
+ }
resolve(true);
progressing = true;
} else {
diff --git a/app/src/assets/template/app/index.tpl b/app/src/assets/template/app/index.tpl
index 7b32bab5e4..09e38d03e9 100644
--- a/app/src/assets/template/app/index.tpl
+++ b/app/src/assets/template/app/index.tpl
@@ -12,7 +12,7 @@
<body class="fn__flex-column">
<div id="loading" class="b3-dialog b3-dialog--open">
<div class="b3-dialog__scrim" style="background-color: #1e1e1e"></div>
- <img style="position: absolute;width: 36vh;" src="../../icon.png">
+ <img style="position: absolute;width: 24vh;" src="../../icon.svg">
<button onclick="window.location.reload()" id="loadingRefresh"
style="display: none;position: absolute;bottom: 16px;background: transparent;border: 1px solid #4285f4;color: #4285f4;border-radius: 6px;line-height: 20px;padding: 4px 8px;">
Click to Refresh<br>点 击 刷 新
diff --git a/app/src/assets/template/desktop/index.tpl b/app/src/assets/template/desktop/index.tpl
index 4728c4f58d..2861285f3d 100644
--- a/app/src/assets/template/desktop/index.tpl
+++ b/app/src/assets/template/desktop/index.tpl
@@ -14,7 +14,7 @@
<body class="fn__flex-column">
<div id="loading" class="b3-dialog b3-dialog--open">
<div class="b3-dialog__scrim" style="background-color: #1e1e1e"></div>
- <img style="position: absolute;width: 36vh;" src="../../icon.png">
+ <img style="position: absolute;width: 24vh;" src="../../icon.svg">
</div>
<div id="toolbar" class="toolbar fn__flex"></div>
<div class="fn__flex-1 fn__flex">
diff --git a/app/src/assets/template/mobile/index.tpl b/app/src/assets/template/mobile/index.tpl
index ee4a17d7bc..8e5cb59e10 100644
--- a/app/src/assets/template/mobile/index.tpl
+++ b/app/src/assets/template/mobile/index.tpl
@@ -9,7 +9,7 @@
<body class="fn__flex-column">
<div id="loading" class="b3-dialog b3-dialog--open">
<div class="b3-dialog__scrim" style="background-color: #1e1e1e"></div>
- <img style="position: absolute;width: 36vh;" src="../../icon.png">
+ <img style="position: absolute;width: 24vh;" src="../../icon.svg">
</div>
<div class="toolbar toolbar--border">
<svg id="toolbarFile" class="toolbar__icon">
diff --git a/app/stage/icon.svg b/app/stage/icon.svg
new file mode 100644
index 0000000000..fc15edd5eb
--- /dev/null
+++ b/app/stage/icon.svg
@@ -0,0 +1,10 @@
+<!-- Generated by IcoMoon.io -->
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024">
+<title></title>
+<g id="icomoon-ignore">
+</g>
+<path fill="#d23f31" d="M37.052 371.676l269.857-269.857v550.507l-269.857 269.857z"></path>
+<path fill="#3b3e43" d="M306.909 101.818l205.091 205.091v550.507l-205.091-205.091z"></path>
+<path fill="#d23f31" d="M512 306.909l205.091-205.091v550.507l-205.091 205.091z"></path>
+<path fill="#3b3e43" d="M717.091 101.818l269.857 269.857v550.507l-269.857-269.857z"></path>
+</svg>