Skip to content
This repository has been archived by the owner on Nov 2, 2024. It is now read-only.

Commit

Permalink
修复声音问题
Browse files Browse the repository at this point in the history
  • Loading branch information
latedreamdev committed Jun 9, 2024
1 parent a51d5c2 commit a7fe22e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
11 changes: 7 additions & 4 deletions dist/all.init.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@
*/
import cfg from "./oreuicfg.json" with {type:"json"};
import {info} from "./libs/info.js";

globalThis.oreui = {
main: oreui,
info: info,
path: cfg.path
}

import {sounds, playSound} from "./libs/sounds.js";
import {oreui} from "./libs/main.js";

globalThis.playSound = playSound, globalThis.sounds = sounds;

globalThis.oreui = {
main: oreui,
info: info
}

document.addEventListener("DOMContentLoaded", () => {
try {
Expand Down
8 changes: 4 additions & 4 deletions dist/libs/sounds.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export const sounds = {
click: new Audio("dist/sounds/release-7c974.ogg"),
hide: new Audio("dist/sounds/modal_hide-2341f.ogg"),
pop: new Audio("dist/sounds/snes_pop-7a6d3.ogg")
click: new Audio(oreui.path + "sounds/release-7c974.ogg"),
hide: new Audio(oreui.path + "sounds/modal_hide-2341f.ogg"),
pop: new Audio(oreui.path + "sounds/snes_pop-7a6d3.ogg")
}

export const playSound = sound => {
sound.play();
return sound;
}
}

0 comments on commit a7fe22e

Please sign in to comment.