login.pt 10.8 KB
<!DOCTYPE html>
<html lang="en" tal:define="home request.home;">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <link
      rel="icon"
      type="image/svg+xml"
      href="${home}/static/landing/favicon.svg"
    />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="${home}/static/landing/css/style.css" />
    <!-- <title>Masuk - Pajak Online - Kota Tangerang Selatan</title> -->
    <title tal:content="request.title" />
  </head>

  <body
    class="font-urbanist m-0 min-h-screen min-w-[320px] bg-[#ffffff] text-lg text-[#213547]"
  >
    <section class="flex min-h-screen items-center justify-center bg-gray-50">
      <!-- login container -->
      <div
        class="flex max-w-3xl items-center rounded-2xl bg-gray-100 p-2 shadow-lg"
      >
        <!-- form -->
        <div class="px-6 py-5 md:w-1/2 md:px-8">
          <a href="/"
            ><img
              src="${home}/static/landing/img/logo-text.png"
              alt="logo"
              class="mb-10 flex h-12"
          /></a>
          <h2 class="text-2xl font-bold text-[#002D74]">Masuk</h2>
          <p class="mt-4 text-sm text-[#002D74]">
            Silahkan masuk dengan username dan password akun Anda.
          </p>

          <form
            id="deform"
            method="POST"
            enctype="multipart/form-data"
            accept-charset="utf-8"
            class="flex flex-col gap-4"
          >
            <input type="hidden" name="_charset_" />
            <input type="hidden" name="__formid__" value="deform" />

            <div tal:condition="request.session.peek_flash()">
              <div
                class="bg-green-200 text-green-800 px-4 py-3 rounded relative"
                tal:repeat="message request.session.pop_flash()"
              >
                <i class="fa fa-fw fa-lg fa-check-circle"></i>&nbsp;${message}
              </div>
            </div>
            <div tal:condition="request.session.peek_flash('error')">
              <div
                class="bg-red-200 text-red-800 px-4 py-3 rounded relative"
                tal:repeat="message request.session.pop_flash('error')"
              >
                <i class="fa fa-fw fa-lg fa-times-circle"></i>&nbsp;${message}
              </div>
            </div>

            <input
              class="mt-8 rounded-sm border p-2 text-base"
              type="text"
              name="username"
              id="username"
              placeholder="Username"
            />
            <div class="relative">
              <input
                class="w-full rounded-md border p-2 text-base"
                type="password"
                name="password"
                placeholder="Password"
                id="password"
              />
              <div>
                <svg
                  xmlns="http://www.w3.org/2000/svg"
                  width="16"
                  height="16"
                  fill="gray"
                  class="bi bi-eye absolute top-1/2 right-3 -translate-y-1/2 cursor-pointer"
                  viewBox="0 0 16 16"
                  id="show_password"
                  onclick="javascript:changeInputType()"
                >
                  <path
                    d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"
                  />
                  <path
                    d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"
                  />
                </svg>
              </div>
              <div>
                <svg
                  viewBox="0 0 24 24"
                  width="16"
                  height="16"
                  xmlns="http://www.w3.org/2000/svg"
                  class="hidden bi bi-eye-close absolute top-1/2 right-3 -translate-y-1/2 cursor-pointer"
                  id="hide_password"
                  onclick="javascript:changeInputType()"
                >
                  <g id="SVGRepo_bgCarrier" stroke-width="0"></g>
                  <g
                    id="SVGRepo_tracerCarrier"
                    stroke-linecap="round"
                    stroke-linejoin="round"
                  ></g>
                  <g id="SVGRepo_iconCarrier">
                    <path
                      stroke="#666666"
                      stroke-linecap="round"
                      stroke-linejoin="round"
                      stroke-width="2"
                      d="M3 10a13.358 13.358 0 0 0 3 2.685M21 10a13.358 13.358 0 0 1-3 2.685m-8 1.624L9.5 16.5m.5-2.19a10.59 10.59 0 0 0 4 0m-4 0a11.275 11.275 0 0 1-4-1.625m8 1.624.5 2.191m-.5-2.19a11.275 11.275 0 0 0 4-1.625m0 0 1.5 1.815M6 12.685 4.5 14.5"
                    ></path>
                  </g>
                </svg>
              </div>
            </div>
            <section tal:condition="'captcha' in form">
              <div tal:define="field form['captcha']">
                ${structure:field.serialize()}
              </div>
            </section>

            <section tal:condition="'csrf_token' in form">
              <div tal:define="field form['csrf_token']" style="display: none">
                ${structure:field.serialize()}
              </div>
            </section>
            <button
              type="submit"
              id="login-btn"
              name="login"
              class="button rounded-md bg-[#002D74] py-2 text-white duration-300 hover:scale-105"
            >
              Masuk
            </button>
            <section>
              <input
                id="provider_name"
                type="hidden"
                name="provider_name"
                class="form-control"
              />
              <input
                id="id_token"
                type="hidden"
                name="id_token"
                class="form-control"
              />
              <input type="hidden" name="next" value="${home}" />
            </section>
          </form>

          <div class="mt-6 grid grid-cols-3 items-center text-gray-400">
            <hr class="border-gray-400" />
            <p class="text-center text-sm">ATAU</p>
            <hr class="border-gray-400" />
          </div>

          <button
            class="mt-5 flex w-full items-center justify-center rounded-md border bg-white py-2 text-sm text-[#002D74] duration-300 hover:scale-105"
          >
            <svg
              class="mr-3"
              xmlns="http://www.w3.org/2000/svg"
              viewBox="0 0 48 48"
              width="25px"
            >
              <path
                fill="#FFC107"
                d="M43.611,20.083H42V20H24v8h11.303c-1.649,4.657-6.08,8-11.303,8c-6.627,0-12-5.373-12-12c0-6.627,5.373-12,12-12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C12.955,4,4,12.955,4,24c0,11.045,8.955,20,20,20c11.045,0,20-8.955,20-20C44,22.659,43.862,21.35,43.611,20.083z"
              />
              <path
                fill="#FF3D00"
                d="M6.306,14.691l6.571,4.819C14.655,15.108,18.961,12,24,12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C16.318,4,9.656,8.337,6.306,14.691z"
              />
              <path
                fill="#4CAF50"
                d="M24,44c5.166,0,9.86-1.977,13.409-5.192l-6.19-5.238C29.211,35.091,26.715,36,24,36c-5.202,0-9.619-3.317-11.283-7.946l-6.522,5.025C9.505,39.556,16.227,44,24,44z"
              />
              <path
                fill="#1976D2"
                d="M43.611,20.083H42V20H24v8h11.303c-0.792,2.237-2.231,4.166-4.087,5.571c0.001-0.001,0.002-0.001,0.003-0.002l6.19,5.238C36.971,39.205,44,34,44,24C44,22.659,43.862,21.35,43.611,20.083z"
              />
            </svg>
            Masuk dengan akun Google
          </button>

          <div
            class="mt-5 flex items-center justify-between border-b border-[#002D74] py-4 text-sm text-[#002D74]"
          >
            <p>Lupa password?</p>
            <a
              href="${home}/reset-password"
              class="rounded-full border bg-white px-5 py-1 duration-300 hover:scale-110"
              >Reset Password</a
            >
          </div>

          <div
            class="mt-3 flex items-center justify-between text-sm text-[#002D74]"
          >
            <p>Belum punya akun?</p>
            <a
              href="${home}/register"
              class="rounded-full border bg-white px-5 py-1 duration-300 hover:scale-110"
            >
              Daftar
            </a>
          </div>
        </div>

        <!-- image -->
        <div
          class="hidden w-1/2 items-center justify-center rounded-2xl bg-radial-[at_75%_25%] from-[#0184b0] to-[#faaf18] to-75% md:block"
        >
          <img
            class="rounded-2xl"
            src="${home}/static/landing/img/login-hero.png"
          />
        </div>
      </div>
    </section>

    <script
      type="text/javascript"
      src="${home}/deform_static/scripts/jquery-2.0.3.min.js"
    ></script>
    <script
      type="text/javascript"
      src="${home}/deform_static/scripts/bootstrap.min.js"
    ></script>
    <script
      type="text/javascript"
      src="${home}/deform_static/scripts/deform.js"
    ></script>
    <script
      tal:condition="request.google_signin_client_id"
      src="https://accounts.google.com/gsi/client"
      async
      defer
    ></script>

    <script tal:condition="request.google_signin_client_id">
      window.onload = function (e) {
        const value = document.cookie;
        const parts = value.split(`g_state=`);
        if (parts.length === 2) {
          document.cookie = document.cookie + ";max-age=0";
        }
      };

      function onSignIn(googleUser) {
        document.getElementById("provider_name").value = "google";
        document.getElementById("id_token").value = JSON.stringify(googleUser);
        document.getElementById("deform").submit();
      }

      const form = document.querySelector("form");

      form.addEventListener("keydown", (event) => {
        if (event.key === "Enter") {
          event.preventDefault();
          form.submit();
        }
      });
    </script>
    <script>
      function changeInputType() {
        const inputElement = document.getElementById("password");
        if (inputElement.type === "password") {
          inputElement.type = "text";
          document.getElementById("hide_password").classList.remove("hidden");
          document.getElementById("show_password").classList.add("hidden");
        } else {
          inputElement.type = "password";
          document.getElementById("hide_password").classList.add("hidden");
          document.getElementById("show_password").classList.remove("hidden");
        }
      }
    </script>
  </body>
</html>