From b102d16634f5ba8289bd4276ea8ecbf8dc622ec4 Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Mon, 23 Oct 2023 12:20:29 -0700 Subject: [PATCH] support setting color of "loading" text in run.html (#9738) --- kiosk/src/Components/PlayingGame.tsx | 1 + webapp/public/run.html | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/kiosk/src/Components/PlayingGame.tsx b/kiosk/src/Components/PlayingGame.tsx index 9472d976bb37..d6d868e74282 100644 --- a/kiosk/src/Components/PlayingGame.tsx +++ b/kiosk/src/Components/PlayingGame.tsx @@ -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. diff --git a/webapp/public/run.html b/webapp/public/run.html index 243589eebb45..6515827a7581 100644 --- a/webapp/public/run.html +++ b/webapp/public/run.html @@ -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 { @@ -134,6 +135,9 @@ } var code = codeFromData || (codeFromSrc ? codeFromSrc[1] : undefined); + if (loading && loadingColor) { + loading.style.color = loadingColor; + } if (additionalSimParams) { additionalSimParams = decodeURIComponent(additionalSimParams);