From 4302c1a7e8a2828f45cc34a7acbb339128684111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20R=C3=A5dberg?= Date: Mon, 18 Sep 2023 22:18:00 +0200 Subject: [PATCH 1/2] add button to go back to start if render fails --- src/App.tsx | 12 ++++++++++++ src/Components/Counters/Counters.tsx | 8 -------- src/Components/Views/Play.tsx | 2 ++ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index dd560ea..847b8a5 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -26,6 +26,8 @@ const StartWrapper = styled.div` `; const PlayWrapper = styled.div` + position: relative; + z-index: 0; max-width: fit-content; max-height: fit-content; @media (orientation: portrait) { @@ -39,6 +41,13 @@ const removeLocalStorage = async () => { localStorage.removeItem('playing'); }; +const EmergencyResetButton = styled.button` + position: absolute; + right: 0; + bottom: 0; + z-index: -1; +`; + const App = () => { const analytics = useAnalytics(); const savedPlayers = localStorage.getItem('players'); @@ -105,6 +114,9 @@ const App = () => { goToStart={goToStart} wakeLock={wakeLock} /> + + Go To Start + ) : ( diff --git a/src/Components/Counters/Counters.tsx b/src/Components/Counters/Counters.tsx index 853163f..fd31baa 100644 --- a/src/Components/Counters/Counters.tsx +++ b/src/Components/Counters/Counters.tsx @@ -28,14 +28,6 @@ export const GridItemContainer = styled.div<{ grid-area: ${(props) => props.$gridArea}; `; -export const SettingsButtonContainer = styled.div` - position: fixed; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - z-index: 9; -`; - type CountersProps = { players: Player[]; onPlayerChange: (updatedPlayer: Player) => void; diff --git a/src/Components/Views/Play.tsx b/src/Components/Views/Play.tsx index bc8b185..7830872 100644 --- a/src/Components/Views/Play.tsx +++ b/src/Components/Views/Play.tsx @@ -4,6 +4,8 @@ import { Player } from '../../Types/Player'; import { WakeLock } from '../../Types/WakeLock'; const MainWrapper = styled.div` + width: 100vmax; + height: 100vmin; width: 100dvmax; height: 100dvmin; overflow: hidden; From f61d94ad3b3000b0f969cf0cf4623a15393cd7a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20R=C3=A5dberg?= Date: Mon, 18 Sep 2023 22:31:59 +0200 Subject: [PATCH 2/2] fix emergency button --- src/App.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 847b8a5..0222f6f 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -42,10 +42,13 @@ const removeLocalStorage = async () => { }; const EmergencyResetButton = styled.button` + width: 100vmax; + height: 100vmin; + font-size: 4vmax; position: absolute; - right: 0; - bottom: 0; + top: 0; z-index: -1; + background-color: #4e6815; `; const App = () => { @@ -115,7 +118,10 @@ const App = () => { wakeLock={wakeLock} /> - Go To Start +

If you can see this, something is wrong.

+

Press screen to go to start.

+
+

If the issue persists, please inform me.

) : (