{% load any_js i18n %}
{% include_css "Roboto400" %}
<div id="logo-container">
  <img
    src="{% url "logo" %}"
    alt="{{ SITE_PREFERENCES.general__title }} – Logo"
    id="logo"
    width="600"
  >
  <noscript>
    {% blocktrans %}
      This webbrowser doesn't support JavaScript, or its execution is blocked. Please use another browser to continue.
    {% endblocktrans %}
  </noscript>
{% if need_maintenance_response %}
  <p>
    {% blocktrans %}
      The maintenance mode is currently enabled. Please try again later.
    {% endblocktrans %}
  </p>
{% endif %}
</div>

{% if not need_maintenance_response %}
<div class="lds-ellipsis">
  <div></div>
  <div></div>
  <div></div>
  <div></div>
</div>
{% endif %}

<style>
  #logo {
    width: 100%;
    max-height: inherit;
  }

  #logo-container {
    width: min(80vw, 600px);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    max-height: calc(100vh - 10vh - calc(2 * min(85px, 15vh)));
  }

  noscript, p {
    font-family: Roboto, sans-serif;
    font-weight: 400;
  }

  .lds-ellipsis {
    display: inline-block;
    position: absolute;
    bottom: 5vh;
    left: 50%;
    transform: translate(-50%);
    aspect-ratio: 1;
    height: min(15vh, 85px);
  }

  .lds-ellipsis div {
    position: absolute;
    top: 41.25%;
    width: 16.25%;
    height: 16.25%;
    border-radius: 50%;
    aspect-ratio: 1;
    background: {{ SITE_PREFERENCES.theme__primary }};
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
  }

  .lds-ellipsis div:nth-child(1) {
    left: 10%;
    animation: lds-ellipsis1 0.6s infinite;
  }

  .lds-ellipsis div:nth-child(2) {
    left: 10%;
    animation: lds-ellipsis2 0.6s infinite;
  }

  .lds-ellipsis div:nth-child(3) {
    left: 40%;
    animation: lds-ellipsis2 0.6s infinite;
  }

  .lds-ellipsis div:nth-child(4) {
    left: 70%;
    animation: lds-ellipsis3 0.6s infinite;
  }

  @keyframes lds-ellipsis1 {
    0% {
      transform: scale(0);
    }
    100% {
      transform: scale(1);
    }
  }

  @keyframes lds-ellipsis3 {
    0% {
      transform: scale(1);
    }
    100% {
      transform: scale(0);
    }
  }

  @keyframes lds-ellipsis2 {
    0% {
      transform: translate(0, 0);
    }
    100% {
      transform: translate(calc(0.3 * min(15vh, 85px)), 0);
    }
  }

</style>
