Newer
Older
2025-shino / index.html
<!DOCTYPE html>
<html lang="ja">
<head>
  <meta charset="UTF-8">
  <title>グループ&ユーザー設定</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="style.css">
</head>

<body class="index-page">
  <div class="index-container">
    <h1>位置共有ログイン</h1>
    <p class="desc">地図で共有するグループ名とユーザー名を入力してください。</p>

    <input type="text" id="groupName" placeholder="グループ名(例:A組)">
    <input type="text" id="userName" placeholder="あなたの名前(例:さとう)">

    <button id="goMap">地図へ</button>
  </div>

  <script>
    document.getElementById("goMap").addEventListener("click", () => {
      const grp = document.getElementById("groupName").value.trim();
      const usr = document.getElementById("userName").value.trim();

      if (!grp || !usr) {
        alert("グループ名とユーザー名を入力してください");
        return;
      }

      location.href =
        `map4.html?group=${encodeURIComponent(grp)}&user=${encodeURIComponent(usr)}`;
    });
  </script>
</body>
</html>