Merge pull request #949 from kellenmace/bugfix/background-image-parentheses

Fix a bug preventing the use of background image URLs that contain parentheses
This commit is contained in:
Ethan O'Brien 2025-02-10 08:47:21 -06:00 committed by GitHub
commit 06e597edf8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -274,7 +274,7 @@ class EmulatorJS {
if (typeof this.config.backgroundImg === "string") {
this.game.classList.add("ejs_game_background");
if (this.config.backgroundBlur) this.game.classList.add("ejs_game_background_blur");
this.game.setAttribute("style", "--ejs-background-image: url("+this.config.backgroundImg+"); --ejs-background-color: "+this.config.backgroundColor+";");
this.game.setAttribute("style", `--ejs-background-image: url("${this.config.backgroundImg}"); --ejs-background-color: ${this.config.backgroundColor};`);
this.on("start", () => {
this.game.classList.remove("ejs_game_background");
if (this.config.backgroundBlur) this.game.classList.remove("ejs_game_background_blur");