<!DOCTYPE html>
<html class="theme--default text-lg sm:text-xl font-light print:text-base">
  <meta charset="UTF-8" />
  <head>
    <title>Nostr Relay {{.Hostname}} - {{.Info.Name}}</title>
    <meta property="og:title" content="{{.Hostname}} - nostr relay" />
    <meta name="twitter:title" content="{{.Hostname}} - nostr relay" />
    <meta property="og:site_name" content="{{.Hostname}} - nostr relay" />
    {{ if not (eq "" .Info.Icon) }}
    <meta property="og:image" content="{{.Info.Icon}}" />
    <meta property="twitter:image" content="{{.Proxy}}{{.Info.Icon}}" />
    {{end}} {{ if not (eq "" .Info.Description) }}
    <meta property="og:description" content="{{.Info.Description}}" />
    <meta name="twitter:description" content="{{.Info.Description}}" />
    {{end}}
    <meta property="twitter:card" content="summary" />

    <link
      rel="sitemap"
      type="application/xml"
      title="Sitemap for {{.Hostname}}"
      href="/r/{{.Hostname}}.xml"
    />

    {{template "head_common" .HeadCommonPartial}}
  </head>

  <body
    class="mb-16 print:text-black text-gray-600 dark:text-neutral-50 bg-white dark:bg-neutral-800"
  >
    {{template "top" .}}

    <div class="sm:flex sm:justify-center sm:items-center mx-auto px-4 sm:px-0">
      <div
        class="sm:flex w-full sm:w-9/12 px-4 justify-between overflow-visible gap-10 lg:gap-48vw max-w-screen-2xl print:w-full"
      >
        <div
          class="flex items-center sm:items-start relative sm:sticky self-start basis-1/4 sm:mt-8 top-auto sm:top-8"
        >
          <div
            class="text-left basis-2/3 overflow-hidden hidden flex items-center text-2xl sm:break-all"
            _="on load or scroll from window or resize from window get #relay_name then measure its top, height then if top is less than height / -2 or height is 0 add .flex then remove .hidden otherwise remove .flex then add .hidden"
          >
            {{.Info.Name}}
          </div>
          <div
            class="max-w-full imgclip overflow-hidden basis-2/5 sm:basis-auto"
          >
            <img class="block w-full h-auto" src="{{.Info.Icon}}" />
          </div>
        </div>

        <div class="break-words w-full sm:w-1/2 print:w-full">
          <header class="leading-5 mb-6 hidden sm:flex sm:items-center">
            <h1>
              <div id="relay_name" class="text-2xl">{{.Info.Name}}</div>
            </h1>
          </header>

          <div
            class="h-1.5 mb-6 -ml-4 sm:-ml-2.5 bg-zinc-100 dark:bg-zinc-700 w-1/2"
          ></div>
          <div class="leading-5 mb-6">
            <a
              class="border-b-2 pb-0.5 border-b-gray-300 hover:text-strongpink"
              href="https://{{.Hostname}}"
              target="_blank"
              _="on mouseenter set my innerText to my.innerText.replace('wss://', 'https://')
                 on mouseleave set my innerText to my.innerText.replace('https://', 'wss://')"
              >wss://{{.Hostname}}</a
            >
          </div>
          <div
            class="leading-5 mb-6 prose dark:prose-invert sm:prose-a:text-justify prose-headings:font-light"
          >
            {{.Info.Description}}
          </div>
          <div
            class="h-1.5 mb-6 -ml-4 sm:-ml-2.5 bg-zinc-100 dark:bg-zinc-700 w-1/2"
          ></div>

          {{ if not (eq "" .Info.PubKey) }}
          <div class="leading-5 mb-6">
            <div class="text-sm text-strongpink">Public Key</div>
            {{.Info.PubKey}}
          </div>
          {{ end }}
          <!---->
          {{ if not (eq "" .Info.Contact) }}
          <div class="leading-5 mb-6">
            <div class="text-sm text-strongpink">Contact</div>
            <a href="{{.Info.Contact}}">{{.Info.Contact}}</a>
          </div>
          {{ end }}

          <div
            class="h-1.5 mb-6 -ml-4 sm:-ml-2.5 bg-zinc-100 dark:bg-zinc-700 w-1/3"
          ></div>

          <div class="leading-5 mb-6">
            <h2 class="text-strongpink text-2xl">Last Notes</h2>
            {{range $i, $ee := .LastNotes}}
            <a
              class="block no-underline my-8 hover:border-solid hover:pl-4 hover:-ml-6 hover:border-l-05rem hover:border-l-gray-100 dark:hover:border-l-zinc-700"
              href="/{{$ee.Nevent}}"
            >
              <div
                class="flex flex-row -ml-2.5 mb-1.5 pl-2.5 pb-1 border-solid border-b-4 border-b-gray-100 dark:border-b-neutral-800"
              >
                <div class="text-sm text-strongpink">{{$ee.CreatedAtStr}}</div>
                <br />
                {{if $ee.IsReply}}
                <div class="text-xs ml-2 text-gray-300 dark:text-gray-400">
                  - reply
                </div>
                {{end}}
                <div class="text-xs ml-auto text-zinc-700 dark:text-neutral-50">
                  by
                  <span
                    class="px-1 rounded bg-lavender dark:bg-garnet hover:bg-strongpink dark:hover:bg-strongpink hover:text-white"
                    href="/{{$ee.Npub}}"
                    >{{$ee.NpubShort}}</span
                  >
                </div>
              </div>
              <div
                class="basis-full max-h-40 overflow-hidden mt-0.5 hover:text-strongpink"
                _="on load if my scrollHeight >= my offsetHeight add .gradient"
              >
                {{$ee.Preview}}
              </div>
            </a>
            {{end}}
          </div>
        </div>

        {{template "clients" .ClientsPartial}}
      </div>
    </div>

    {{template "footer" .}}
  </body>
</html>
