diff --git a/apps/client/src/app.tsx b/apps/client/src/app.tsx index 1702176..2e36f59 100644 --- a/apps/client/src/app.tsx +++ b/apps/client/src/app.tsx @@ -6,15 +6,26 @@ import { LobbyScene } from "./scenes/lobby/LobbyScene"; import { GameScene } from "./scenes/game/GameScene"; import { ResultScene } from "./scenes/result/ResultScene"; +import { LandscapeOnlyGate } from "./components/LandscapeOnlyGate"; import { appConsts } from "@repo/shared"; export default function App() { - const { scenePhase, room, myId, gameResult, joinErrorMessage, isJoining, requestJoin } = useAppFlow(); + const { + scenePhase, + room, + myId, + gameResult, + joinErrorMessage, + isJoining, + requestJoin, + } = useAppFlow(); + + let scene = ; // タイトル画面分岐 if (scenePhase === appConsts.ScenePhase.TITLE) { - return ( + scene = ( ); } - + // ロビー画面分岐 if (scenePhase === appConsts.ScenePhase.LOBBY) { - return socketManager.lobby.startGame()} />; + scene = ( + socketManager.lobby.startGame()} + /> + ); } // 結果画面分岐 if (scenePhase === appConsts.ScenePhase.RESULT) { - return ; + scene = ; } - // プレイ画面分岐 - return ; -} \ No newline at end of file + return {scene}; +} diff --git a/apps/client/src/components/LandscapeOnlyGate.tsx b/apps/client/src/components/LandscapeOnlyGate.tsx new file mode 100644 index 0000000..7d85d94 --- /dev/null +++ b/apps/client/src/components/LandscapeOnlyGate.tsx @@ -0,0 +1,56 @@ +import type { ReactNode } from "react"; + +type Props = { + children: ReactNode; +}; + +export const LandscapeOnlyGate = ({ children }: Props) => { + return ( + <> + + +
+
+

画面を横向きにしてください

+

Please rotate your device to landscape mode.

+
+ +
{children}
+
+ + ); +}; diff --git a/apps/client/src/main.tsx b/apps/client/src/main.tsx index 5e89748..7a3dd04 100644 --- a/apps/client/src/main.tsx +++ b/apps/client/src/main.tsx @@ -1,11 +1,11 @@ -import React from 'react' -import ReactDOM from 'react-dom/client' -import App from './app' -import './index.css' +import React from "react"; +import ReactDOM from "react-dom/client"; +import App from "./app"; +import "./index.css"; // React ルートマウント処理 -ReactDOM.createRoot(document.getElementById('app')!).render( +ReactDOM.createRoot(document.getElementById("app")!).render( , -) \ No newline at end of file +); diff --git a/apps/client/src/scenes/lobby/LobbyScene.tsx b/apps/client/src/scenes/lobby/LobbyScene.tsx index 1956dbe..22977e2 100644 --- a/apps/client/src/scenes/lobby/LobbyScene.tsx +++ b/apps/client/src/scenes/lobby/LobbyScene.tsx @@ -19,28 +19,6 @@ * { box-sizing: border-box; } - .portrait-blocker { - display: none; - position: fixed; - top: 0; left: 0; width: 100vw; height: 100dvh; - background: #111; - color: white; - z-index: 9999; - justify-content: center; - align-items: center; - flex-direction: column; - font-size: 1.5rem; - text-align: center; - padding: 20px; - } - @media screen and (orientation: portrait) { - .portrait-blocker { - display: flex; - } - .lobby-container { - display: none !important; - } - } /* スクロールバーの見た目をスマホ・PCでスッキリさせる */ ::-webkit-scrollbar { width: 8px; @@ -51,15 +29,6 @@ } `} -
-
🔄
-

- このゲームは横画面専用です。 -
- スマホを横向きにしてください。 -

-
- {/* 🌟🌟 追加:背景のWebPアニメーション 🌟🌟 */}
- {/* 縦画面時のブロック画面 */} -
-

画面を横向きにしてください

-

Please rotate your device to landscape mode.

-
- {/* 画面全体を覆う背景コンテナ */}