feat(ui): 优化加载界面动画效果

- 将原有的旋转圆环加载动画替换为三点脉冲动画
- 调整加载文字字号从14px增大到16px,提高可读性
- 重构HTML结构,新增loading-container包裹元素
- 修改状态文本样式,增加字体粗细和间距调整
- 删除旧的spin关键帧动画定义
- 更新JavaScript轮播文案逻辑,使用取模运算循环显示提示语
- 增加APP_STATE.namasteStableFrames变量重置逻辑
- 调整加载文案切换间隔时间从600ms延长至800ms
This commit is contained in:
hehh
2025-12-04 21:19:28 +08:00
parent 978b618df2
commit 5268f35af1

93
me.html
View File

@@ -65,46 +65,65 @@
font-size: 32px;
letter-spacing: 8px;
color: var(--loader-text);
margin-bottom: 20px;
margin-bottom: 30px;
animation: breathe 3s infinite;
}
.loader-ring {
width: 50px;
height: 50px;
border: 2px solid rgba(128, 128, 128, 0.2);
border-top-color: var(--accent-color);
border-radius: 50%;
animation: spin 1s linear infinite;
margin-bottom: 20px;
/* 加载容器样式 */
.loading-container {
text-align: center;
min-height: 80px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.status-text {
font-size: 14px;
font-size: 16px;
letter-spacing: 2px;
color: var(--loader-text);
opacity: 0.8;
height: 20px;
opacity: 0.9;
height: 24px;
margin-bottom: 15px;
font-weight: 300;
}
.perm-hint {
margin-top: 30px;
padding: 10px 20px;
border: 1px solid var(--accent-color);
border-radius: 20px;
font-size: 12px;
color: var(--loader-text);
opacity: 0;
transform: translateY(10px);
transition: all 1s;
/* 加载动画点 */
.loading-dots {
display: flex;
justify-content: center;
align-items: center;
}
.perm-hint.show {
opacity: 1;
transform: translateY(0);
.dot {
width: 8px;
height: 8px;
background-color: var(--accent-color);
border-radius: 50%;
margin: 0 4px;
animation: dot-pulse 1.5s infinite ease-in-out;
}
.dot:nth-child(2) {
animation-delay: 0.2s;
}
.dot:nth-child(3) {
animation-delay: 0.4s;
}
@keyframes dot-pulse {
0%, 60%, 100% {
transform: translateY(0);
opacity: 0.8;
}
30% {
transform: translateY(-8px);
opacity: 1;
}
}
/* 进入按钮样式 */
.enter-container {
text-align: center;
}
@@ -338,12 +357,6 @@
}
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
@keyframes gradientShift {
0% {
background-position: 0% 50%;
@@ -430,8 +443,14 @@
<!-- 1. 智能加载层 -->
<div id="start-screen">
<div class="logo-text">Honesty</div>
<div class="loader-ring"></div>
<div class="status-text" id="loader-msg">正在唤醒灵感...</div>
<div class="loading-container">
<div class="status-text" id="loader-msg">正在唤醒灵感...</div>
<div class="loading-dots">
<span class="dot"></span>
<span class="dot"></span>
<span class="dot"></span>
</div>
</div>
<div class="enter-container" id="enter-container" style="margin-top: 30px; text-align: center; opacity: 0; transition: opacity 1s;">
<div class="countdown-hint" id="countdown-hint" style="font-size: 14px; margin-bottom: 15px; color: var(--loader-text);">5秒后自动进入</div>
<button class="enter-btn" id="enter-btn" style="padding: 12px 24px; background: transparent; border: 1px solid var(--accent-color); color: var(--loader-text); border-radius: 30px; cursor: pointer; font-size: 14px; letter-spacing: 2px;">立即进入</button>
@@ -984,6 +1003,7 @@
window.exitArchive = function () {
APP_STATE.mode = 'LOCKED';
APP_STATE.exitCooldownUntil = Date.now() + 2000;
APP_STATE.namasteStableFrames = 0; // 清空手势识别进度
DOM_CACHE.mainHint.style.display = 'block';
DOM_CACHE.subHint.style.display = 'block';
@@ -1158,15 +1178,14 @@
// 循环播放加载文案
let loadIdx = 0;
const maxIdx = CONTENT.load.length - 1;
const loadTimer = setInterval(() => {
if (APP_STATE.isLoaded) {
clearInterval(loadTimer);
return;
}
safeUpdateText(DOM_CACHE.loaderMsg, CONTENT.load[loadIdx > maxIdx ? maxIdx : loadIdx]);
safeUpdateText(DOM_CACHE.loaderMsg, CONTENT.load[loadIdx % CONTENT.load.length]);
loadIdx++;
}, 600);
}, 800);
// 资源加载完成后显示进入按钮
setTimeout(() => {