fix(audio): 修复音频自动播放问题

- 使用 requestAnimationFrame 包装音频播放逻辑
- 确保在用户交互后正确触发播放
- 保留原有的静默错误处理机制

style(artalk): 优化移动端评论样式

- 移除重复的 CSS 选择器定义
- 调整评论区域 padding 和字体大小
- 优化黑夜模式下评论背景透明度
- 修复移动端头像拉伸显示问题
- 移除夜间模式下不必要的边框和圆角
- 完全移除评论容器的边框和阴影样式
- 更新分页按钮的内边距和字体大小
- 修复移动端输入框背景色问题
This commit is contained in:
hehh
2025-11-30 15:25:56 +08:00
parent b179431aaa
commit bff0b529d2
2 changed files with 21 additions and 24 deletions

View File

@@ -45,7 +45,6 @@
/* Light theme styles */ /* Light theme styles */
.atk-main-editor { .atk-main-editor {
background: rgba(255, 255, 255, 0.85) !important;
backdrop-filter: blur(28px) saturate(180%) !important; backdrop-filter: blur(28px) saturate(180%) !important;
-webkit-backdrop-filter: blur(28px) saturate(180%) !important; -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
border: 1px solid rgba(108, 92, 231, 0.2) !important; border: 1px solid rgba(108, 92, 231, 0.2) !important;
@@ -748,9 +747,6 @@
[data-theme="night"] .atk-dropdown-wrap { [data-theme="night"] .atk-dropdown-wrap {
background: rgba(30, 30, 35, 0.95) !important; background: rgba(30, 30, 35, 0.95) !important;
border: 1px solid rgba(255, 255, 255, 0.15) !important;
border-radius: 20px !important;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
} }
[data-theme="night"] .atk-dropdown-item { [data-theme="night"] .atk-dropdown-item {

View File

@@ -1132,13 +1132,14 @@ class UIManager {
window.addEventListener('load', () => { window.addEventListener('load', () => {
// 检查是否在24小时内用户暂停过音乐 // 检查是否在24小时内用户暂停过音乐
const shouldRemainPaused = this.shouldMusicRemainPaused(); const shouldRemainPaused = this.shouldMusicRemainPaused();
// 如果不应该保持暂停状态,则尝试播放 // 如果不应该保持暂停状态,则尝试播放
if (!shouldRemainPaused) { if (!shouldRemainPaused) {
requestAnimationFrame(() => {
this.audio.play().catch(() => { this.audio.play().catch(() => {
// 静默处理播放失败 // 静默处理播放失败
console.error('Failed to play audio.'); console.error('Failed to play audio.');
}); });
});
} }
}); });
} }