diff --git a/apps/client/src/scenes/title/TitleScene.tsx b/apps/client/src/scenes/title/TitleScene.tsx index 6e1d928..5e571ac 100644 --- a/apps/client/src/scenes/title/TitleScene.tsx +++ b/apps/client/src/scenes/title/TitleScene.tsx @@ -12,6 +12,9 @@ }; export const TitleScene = ({ onJoin, joinErrorMessage, isJoining }: Props) => { + // 🌟 追加:「TAP TO START」が押されてフォームを表示する状態かどうか + const [showForm, setShowForm] = useState(false); + // プレイヤー名入力値 const [playerName, setPlayerName] = useState(""); // ルームID入力値 @@ -29,7 +32,6 @@ return ( <> - {/* 🌟 ロビー画面と同じ、横画面専用の警告と全体設定 */} {/* 縦画面時のブロック画面 */} @@ -60,115 +67,143 @@

Please rotate your device to landscape mode.

- {/* 🌟 画面全体を覆う背景コンテナ */} + {/* 画面全体を覆う背景コンテナ */}
{ + if (!showForm) setShowForm(true); }} > - {/* 🌟 入力フォーム&ボタンのコンテナ */} -
+ {/* 🌟 条件分岐:showForm が false なら「TAP TO START」、true ならフォームを表示 */} + {!showForm ? ( +
+ - TAP TO START - +
+ ) : (
- setPlayerName(e.target.value)} - style={{ - padding: "12px", - fontSize: "clamp(1rem, 3vw, 1.2rem)", - borderRadius: "5px", - border: "none", - width: "100%", - fontFamily: "monospace", - }} - /> - setRoomIdInput(e.target.value)} - style={{ - padding: "12px", - fontSize: "clamp(1rem, 3vw, 1.2rem)", - borderRadius: "5px", - border: "none", - width: "100%", - fontFamily: "monospace", - }} - /> -
- - {/* エラーメッセージ */} - {joinErrorMessage && (
- {joinErrorMessage} + setPlayerName(e.target.value)} + style={{ + padding: "12px", + fontSize: "clamp(1rem, 3vw, 1.2rem)", + borderRadius: "5px", + border: "none", + width: "100%", + fontFamily: "monospace", + }} + /> + setRoomIdInput(e.target.value)} + style={{ + padding: "12px", + fontSize: "clamp(1rem, 3vw, 1.2rem)", + borderRadius: "5px", + border: "none", + width: "100%", + fontFamily: "monospace", + }} + />
- )} - {/* 参加ボタン */} - -
+ {/* エラーメッセージ */} + {joinErrorMessage && ( +
+ {joinErrorMessage} +
+ )} + + {/* 参加ボタン */} + +
+ )} + + {/* React内でインラインのkeyframes(fadeIn)を追加するためのハック */} + ); };