From d36de00d9f27b97f4f1dea083638789bc7c752b8 Mon Sep 17 00:00:00 2001 From: PaulloClara Date: Wed, 13 Mar 2024 15:35:44 -0300 Subject: [PATCH] fix: ajusta boas praticas --- scripts.js | 6 +++++- styles/banner.css | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts.js b/scripts.js index 8fd9c2f..06c2465 100644 --- a/scripts.js +++ b/scripts.js @@ -62,8 +62,12 @@ function runBackgroundSoundScript() { } } -function switchBackgroundSoundByTheme(theme) { +async function switchBackgroundSoundByTheme(theme) { try { + if ((await navigator.getAutoplayPolicy('mediaelement')) !== 'allowed') { + return + } + const backgroundSoundEl = document.querySelector('#pc-background-sound') backgroundSoundEl.pause() const currentSound = theme === 'day' ? 'sounds/hollow-knight.mp3' : 'sounds/radiance.mp3' diff --git a/styles/banner.css b/styles/banner.css index 9e5be41..20118b8 100644 --- a/styles/banner.css +++ b/styles/banner.css @@ -37,7 +37,7 @@ font-size: 1.2em; line-height: 1.4em; text-align: justify; - transition: all 0.5s; + /* transition: all 0.5s; */ } .pc-banner-background {