From 9dd318313325e0d8925e6259db48709886e143c2 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Thu, 16 Apr 2026 22:38:28 -0700 Subject: fix: disable scrolling on typing game screen --- src/app/game/page.styles.ts | 10 +++++++++- src/app/game/page.tsx | 48 ++++++++++++++++++++++++++------------------- 2 files changed, 37 insertions(+), 21 deletions(-) diff --git a/src/app/game/page.styles.ts b/src/app/game/page.styles.ts index fdb743e..a1c6cc8 100644 --- a/src/app/game/page.styles.ts +++ b/src/app/game/page.styles.ts @@ -1,4 +1,4 @@ -import styled, { keyframes, css } from "styled-components"; +import styled, { keyframes, css, createGlobalStyle } from "styled-components"; /* ----- ANIMATIONS ----- */ @@ -40,6 +40,14 @@ export const glowAnim = keyframes` 100% { box-shadow: 0 0 4px 0px rgba(124, 58, 237, 0.4); } `; +export const GameGlobalStyle = createGlobalStyle` + html, + body { + height: 100%; + overflow: hidden; + } +`; + /* ----- LAYOUT ----- */ export const GameRoot = styled.div` diff --git a/src/app/game/page.tsx b/src/app/game/page.tsx index fa5f6b1..02ea319 100644 --- a/src/app/game/page.tsx +++ b/src/app/game/page.tsx @@ -17,6 +17,7 @@ import { toast, ToastContainer } from "react-toastify"; import "react-toastify/dist/ReactToastify.css"; import { GameRoot, + GameGlobalStyle, GameNavbar, GameContent, HUD, @@ -90,6 +91,10 @@ function GameInner() { const searchParams = useSearchParams(); const router = useRouter(); + useEffect(() => { + window.scrollTo({ top: 0, left: 0, behavior: "auto" }); + }, []); + const audioRef = useRef(null); const videoRef = useRef(null); const gameStartTimeRef = useRef(0); @@ -860,25 +865,28 @@ function GameInner() { export default function GamePage() { return ( - -
- Loading... -
- - } - > - -
+ <> + + +
+ Loading... +
+ + } + > + +
+ ); } -- cgit v1.2.3