Skip to content

Commit

Permalink
support setting color of "loading" text in run.html (#9738)
Browse files Browse the repository at this point in the history
  • Loading branch information
eanders-ms authored Oct 23, 2023
1 parent 36af12e commit b102d16
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions kiosk/src/Components/PlayingGame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default function PlayingGame() {
single: 1,
fullscreen: 1,
autofocus: 1,
loadingColor: "white",
// If we have the built game cached, we will send it to the
// simulator once it loads. The `server` flag inhibits the
// simulator from trying to build it.
Expand Down
4 changes: 4 additions & 0 deletions webapp/public/run.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
var codeFromSrc = /code(?:[:=])([^&?]+)/i.exec(window.location.href);
var additionalSimParams = /simParams(?:[:=])([^&?]+)/i.exec(window.location.href)?.[1];
var sendBuilt = !!/sendBuilt(?:[:=])1/i.test(window.location.href);
var loadingColor = /[\&\?]loadingColor=(#[0-9A-Fa-f]{3}|#[0-9A-Fa-f]{6}|[A-Za-z]+)\b/i.test(window.location.href)?.[1];
var codeFromData = undefined;
var assetJsonFromData = undefined;
try {
Expand All @@ -134,6 +135,9 @@
}
var code = codeFromData || (codeFromSrc ? codeFromSrc[1] : undefined);

if (loading && loadingColor) {
loading.style.color = loadingColor;
}

if (additionalSimParams) {
additionalSimParams = decodeURIComponent(additionalSimParams);
Expand Down

0 comments on commit b102d16

Please sign in to comment.