Files
njump/templates/relay.html

151 lines
5.7 KiB
HTML

<!doctype html>
<html class="theme--default text-lg font-light print:text-base sm:text-xl">
<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 name="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 name="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 bg-white text-gray-600 dark:bg-neutral-900 dark:text-neutral-50 print:text-black"
>
{{template "top" .}}
<div class="mx-auto px-4 sm:flex sm:items-center sm:justify-center sm:px-0">
<div
class="w-full max-w-screen-2xl justify-between gap-10 overflow-visible px-4 print:w-full sm:flex md:w-10/12 lg:w-9/12 lg:gap-48vw"
>
<div
class="relative top-auto flex basis-1/4 items-center self-start sm:sticky sm:top-8 sm:mt-8 sm:items-start"
>
<div
class="flex hidden basis-2/3 items-center overflow-hidden text-left 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="imgclip max-w-full basis-2/5 overflow-hidden sm:basis-auto"
>
<img class="block h-auto w-full" src="{{.Info.Icon}}" />
</div>
</div>
<div class="w-full break-words print:w-full sm:w-1/2">
<header class="mb-6 hidden leading-5 sm:flex sm:items-center">
<h1>
<div id="relay_name" class="text-2xl">{{.Info.Name}}</div>
</h1>
</header>
<div
class="-ml-4 mb-6 h-1.5 w-1/2 bg-zinc-100 dark:bg-zinc-700 sm:-ml-2.5"
></div>
<div class="mb-6 leading-5">
<a
class="border-b-2 border-b-gray-300 pb-0.5 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="prose mb-6 leading-5 dark:prose-invert prose-headings:font-light sm:prose-a:text-justify"
dir="auto"
>
{{.Info.Description}}
</div>
<div
class="-ml-4 mb-6 h-1.5 w-1/2 bg-zinc-100 dark:bg-zinc-700 sm:-ml-2.5"
></div>
{{ if not (eq "" .Info.PubKey) }}
<div class="mb-6 leading-5">
<div class="text-sm text-strongpink">Public Key</div>
{{.Info.PubKey}}
</div>
{{ end }}
<!---->
{{ if not (eq "" .Info.Contact) }}
<div class="mb-6 leading-5">
<div class="text-sm text-strongpink">Contact</div>
<a href="{{.Info.Contact}}">{{.Info.Contact}}</a>
</div>
{{ end }}
<div
class="-ml-4 mb-6 h-1.5 w-1/3 bg-zinc-100 dark:bg-zinc-700 sm:-ml-2.5"
></div>
<aside>
<div class="mb-6 leading-5">
<h2 class="text-2xl text-strongpink">Last Notes</h2>
{{range $i, $ee := .LastNotes}}
<a
class="my-8 block no-underline hover:-ml-6 hover:border-l-05rem hover:border-solid hover:border-l-gray-100 hover:pl-4 dark:hover:border-l-zinc-700"
href="/{{$ee.Nevent}}"
>
<div
class="-ml-2.5 mb-1.5 flex flex-row border-b-4 border-solid border-b-gray-100 pb-1 pl-2.5 dark:border-b-neutral-800"
>
<div class="text-sm text-strongpink">
{{$ee.CreatedAtStr}}
</div>
<br />
{{if $ee.IsReply}}
<div class="ml-2 text-xs text-gray-300 dark:text-gray-400">
- reply
</div>
{{end}}
<div
class="ml-auto text-xs text-zinc-700 dark:text-neutral-50"
>
by
<span
class="rounded bg-lavender px-1 hover:bg-strongpink hover:text-white dark:bg-garnet dark:hover:bg-strongpink"
href="/{{$ee.Npub}}"
>{{$ee.NpubShort}}</span
>
</div>
</div>
<div
class="mt-0.5 max-h-40 basis-full overflow-hidden hover:text-strongpink"
_="on load if my scrollHeight > my offsetHeight add .gradient"
dir="auto"
>
{{$ee.Preview}}
</div>
</a>
{{end}}
</div>
</aside>
</div>
{{template "clients" .ClientsPartial}}
</div>
</div>
{{template "footer" .}}
</body>
</html>