feat(me): 动态化倒计时提示文本
- 将倒计时提示文本中的固定时间替换为动态占位符
- 使用 `{second}` 占位符实现多语言时间显示
- 更新中文和英文场景下的倒计时文本格式
- 优化倒计时逻辑以支持动态文本更新
- 确保语言切换时提示文本正确渲染
This commit is contained in:
11
me.html
11
me.html
@@ -589,7 +589,7 @@
|
|||||||
main: "双手合十 · 解锁档案",
|
main: "双手合十 · 解锁档案",
|
||||||
sub: "单手·引力牵引|双手·力场排斥",
|
sub: "单手·引力牵引|双手·力场排斥",
|
||||||
unlocking: "正在识别...",
|
unlocking: "正在识别...",
|
||||||
countdownHint: "5秒后自动进入",
|
countdownHint: "{second}秒后自动进入",
|
||||||
enterBtn: "立即进入",
|
enterBtn: "立即进入",
|
||||||
interactionModeBtn: "交互模式",
|
interactionModeBtn: "交互模式",
|
||||||
cameraAccessInfo: "点击启用交互模式"
|
cameraAccessInfo: "点击启用交互模式"
|
||||||
@@ -611,7 +611,7 @@
|
|||||||
main: "Click or Namaste",
|
main: "Click or Namaste",
|
||||||
sub: "One Hand Drag · Two Hands Repel",
|
sub: "One Hand Drag · Two Hands Repel",
|
||||||
unlocking: "Identifying...",
|
unlocking: "Identifying...",
|
||||||
countdownHint: "Auto enter in 5 seconds",
|
countdownHint: "Auto enter in {second} seconds",
|
||||||
enterBtn: "Enter Now",
|
enterBtn: "Enter Now",
|
||||||
interactionModeBtn: "Interaction Mode",
|
interactionModeBtn: "Interaction Mode",
|
||||||
cameraAccessInfo: "Click to enable camera interaction"
|
cameraAccessInfo: "Click to enable camera interaction"
|
||||||
@@ -936,6 +936,7 @@
|
|||||||
showInteractionModeButton();
|
showInteractionModeButton();
|
||||||
}
|
}
|
||||||
}, 1500); // 延迟显示,确保页面已完成过渡
|
}, 1500); // 延迟显示,确保页面已完成过渡
|
||||||
|
explode(100)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1242,14 +1243,16 @@
|
|||||||
|
|
||||||
// 开始5秒倒计时
|
// 开始5秒倒计时
|
||||||
let countdown = 5;
|
let countdown = 5;
|
||||||
safeUpdateText(DOM_CACHE.countdownHint, `${countdown}${ENV.lang === 'zh' ? '秒后自动进入' : ' seconds to auto-enter'}`);
|
|
||||||
|
safeUpdateText(DOM_CACHE.countdownHint, CONTENT.hints.countdownHint.replace('{second}', countdown + ''));
|
||||||
CAMERA_STATE.countdownInterval = setInterval(() => {
|
CAMERA_STATE.countdownInterval = setInterval(() => {
|
||||||
countdown--;
|
countdown--;
|
||||||
if (countdown > 0) {
|
if (countdown > 0) {
|
||||||
safeUpdateText(DOM_CACHE.countdownHint, `${countdown}${ENV.lang === 'zh' ? '秒后自动进入' : ' seconds to auto-enter'}`);
|
safeUpdateText(DOM_CACHE.countdownHint, CONTENT.hints.countdownHint.replace('{second}', countdown + ''));
|
||||||
} else {
|
} else {
|
||||||
clearInterval(CAMERA_STATE.countdownInterval);
|
clearInterval(CAMERA_STATE.countdownInterval);
|
||||||
enterAnimationMode(); // 确保调用进入动画模式
|
enterAnimationMode(); // 确保调用进入动画模式
|
||||||
|
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user