diff --git a/about.html b/about.html index bff3813..ac92b68 100644 --- a/about.html +++ b/about.html @@ -301,7 +301,7 @@ - + diff --git a/css/artalk.css b/css/artalk.css index 192041c..0212fd8 100644 --- a/css/artalk.css +++ b/css/artalk.css @@ -450,6 +450,12 @@ height: 28px !important; object-fit: cover; /* 修复移动端头像拉伸问题 */ } + .atk-comment>.atk-avatar img { + object-fit: cover; + object-position: center; + width: 28px !important; + height: 28px !important; + } .atk-meta { font-size: 12px !important; diff --git a/js/about.js b/js/about.js index 4433cff..d8caa9c 100644 --- a/js/about.js +++ b/js/about.js @@ -1133,22 +1133,22 @@ class UIManager { const shouldRemainPaused = this.shouldMusicRemainPaused(); // 如果不应该保持暂停状态,则尝试播放 if (!shouldRemainPaused) { - this.audio.autoplay = true; + let userInteracted = true; + this.audio.play().catch(() => { + // 静默处理播放失败 + userInteracted = false; + }); // 添加用户交互检查,避免浏览器阻止自动播放 const attemptAutoplay = () => { // 检查是否已有用户交互 - if (this.userInteracted) { - this.audio.play().catch(() => { - // 静默处理播放失败 - console.error('Failed to play audio.'); - }); - } else { + if (this.userInteracted === false) { // 添加一次性用户交互监听器 const enableAudio = () => { this.userInteracted = true; - this.audio.play().catch(() => { - console.error('Failed to play audio.'); - }); + setTimeout(() => { + this.audio.play().catch(() => { + }); + }, 1000); document.removeEventListener('click', enableAudio); document.removeEventListener('touchstart', enableAudio); document.removeEventListener('keydown', enableAudio);