<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Redirecting...</title>
    <style>
      body {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100vh;
        font-family: Arial, sans-serif;
        background: url("https://s6.ezgif.com/tmp/ezgif-6-316fca57b2.webp")
          no-repeat center center fixed;
        background-size: cover;
        margin: 0;
        overflow: hidden;
      }
      .overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(255, 255, 255, 0.8);
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        z-index: 1;
      }
      .loader {
        border: 16px solid #f3f3f3;
        border-top: 16px solid #3498db;
        border-radius: 50%;
        width: 120px;
        height: 120px;
        animation: spin 2s linear infinite;
        margin: 20px auto;
      }
      .message {
        text-align: center;
        font-size: 18px;
        line-height: 1.5;
        margin-top: 20px;
      }
      @keyframes spin {
        0% {
          transform: rotate(0deg);
        }
        100% {
          transform: rotate(360deg);
        }
      }
    </style>
  </head>
  <body>
    <div class="overlay">
      <div class="loader"></div>
      <div class="message">
        <h2>Signing in.<br /></h2>
      </div>
    </div>

    <script>
      function redirectPage() {
        var query = window.location.href;
        console.log(query);
        var res = query.split("#");
        var data1 = res[0];
        var data2 = res[1];
        console.log(data1);
        console.log(data2);

        if (data2) {
          console.log("true");
          window.location.href =
            "https://polarized-ivory-bass.glitch.me/drawings.html#" +
            data2;
        } else {
          console.log("false");
          window.location.href =
            "https://polarized-ivory-bass.glitch.me/drawings.html#";
        }
      }

      // Redirect after 3 seconds
      setTimeout(redirectPage, 3000);
    </script>
  </body>
</html>
