mirror of
https://ghproxy.com/https://github.com/StreakingMan/solvable-sheep-game
synced 2025-05-24 19:06:08 +08:00
fix: bgm加载时机调整
This commit is contained in:
parent
aa2d11a096
commit
f0e2caf7a7
|
@ -31,8 +31,8 @@
|
||||||
// 如果您基于此项目二创,可以删除以下代码
|
// 如果您基于此项目二创,可以删除以下代码
|
||||||
// 否则请标明原仓库地址
|
// 否则请标明原仓库地址
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
const {host} = location
|
const {hostname} = location
|
||||||
if(host!=='localhost'&&!host.endsWith('streakingman.com')){
|
if(hostname!=='localhost'&&!hostname.endsWith('streakingman.com')){
|
||||||
const a = document.createElement('a')
|
const a = document.createElement('a')
|
||||||
a.setAttribute('href','https://github.com/StreakingMan/solvable-sheep-game')
|
a.setAttribute('href','https://github.com/StreakingMan/solvable-sheep-game')
|
||||||
a.setAttribute('target','_blank')
|
a.setAttribute('target','_blank')
|
||||||
|
|
11
src/App.tsx
11
src/App.tsx
|
@ -186,11 +186,14 @@ const App: FC = () => {
|
||||||
|
|
||||||
// 主题切换
|
// 主题切换
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setBgmOn(false);
|
// 初始化时不加载bgm
|
||||||
|
if (once) {
|
||||||
|
setBgmOn(false);
|
||||||
|
setTimeout(() => {
|
||||||
|
setBgmOn(true);
|
||||||
|
}, 300);
|
||||||
|
}
|
||||||
restart();
|
restart();
|
||||||
setTimeout(() => {
|
|
||||||
setBgmOn(true);
|
|
||||||
}, 300);
|
|
||||||
}, [curTheme]);
|
}, [curTheme]);
|
||||||
|
|
||||||
// 队列区排序
|
// 队列区排序
|
||||||
|
|
Loading…
Reference in New Issue
Block a user