mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-24 14:06:16 -04:00
Added sw
This commit is contained in:
parent
cdfe6a4978
commit
934670b2a7
11 changed files with 84 additions and 3 deletions
|
@ -17,6 +17,7 @@ import {putBallsAtPuck, resetBalls} from "./resetBalls";
|
|||
import {makeEmptyPerksMap, sumOfKeys} from "./game_utils";
|
||||
import {baseCombo, decreaseCombo, resetCombo} from "./combo";
|
||||
|
||||
import './sw_loader'
|
||||
|
||||
const gameCanvas = document.getElementById("game") as HTMLCanvasElement;
|
||||
const ctx = gameCanvas.getContext("2d", {
|
||||
|
@ -2382,6 +2383,7 @@ async function openSettingsPanel() {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
actions.push({
|
||||
text: "Sandbox mode",
|
||||
help:
|
||||
|
|
|
@ -46,7 +46,7 @@ export const options = {
|
|||
disabled() {
|
||||
return window.location.search.includes("isInWebView=true");
|
||||
},
|
||||
},
|
||||
}
|
||||
} as const satisfies { [k: string]: OptionDef };
|
||||
|
||||
export type OptionDef = {
|
||||
|
|
4
src/sw_loader.ts
Normal file
4
src/sw_loader.ts
Normal file
|
@ -0,0 +1,4 @@
|
|||
if ("serviceWorker" in navigator &&
|
||||
window.location.search.includes("isPWA=true")) {
|
||||
navigator.serviceWorker.register("sw-b71.js");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue