apply prettier tailwind plugin to reorder classes.

This commit is contained in:
fiatjaf
2023-10-28 13:24:57 -03:00
parent 1c36a379fd
commit 4df0620502
11 changed files with 173 additions and 163 deletions

View File

@@ -1,3 +1,5 @@
export PATH := "./node_modules/.bin:" + env_var('PATH')
dev:
TAILWIND_DEBUG=true go run .

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html class="theme--default text-lg sm:text-xl font-light print:text-base">
<!doctype html>
<html class="theme--default text-lg font-light print:text-base sm:text-xl">
<meta charset="UTF-8" />
<head>
<title>{{.Title}}</title>
@@ -7,41 +7,42 @@
{{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">
<body
class="mb-16 bg-white text-gray-600 dark:bg-neutral-800 dark:text-neutral-50 print:text-black"
>
{{template "top" .}}
<div
class="block sm:flex sm:justify-center sm:items-center mx-auto px-4 sm:px-0"
class="mx-auto block px-4 sm:flex sm:items-center sm:justify-center sm:px-0"
>
<div
class="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"
class="flex w-full max-w-screen-2xl justify-between gap-10 overflow-visible px-4 print:w-full sm:w-9/12 lg:gap-48vw"
>
<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="relative top-auto flex basis-1/4 items-center self-start sm:sticky sm:top-8 sm:mt-8 sm:items-start"
>
<div class="text-2xl">{{.Title}}</div>
</div>
<div class="break-words w-full sm:w-1/2 print:w-full break-all">
<div class="leading-5 mb-6">
<div class="w-full break-words break-all print:w-full sm:w-1/2">
<div class="mb-6 leading-5">
<h1 class="text-xl">{{.Title}}</h1>
</div>
<div class="leading-5 mb-6">
<div class="mb-6 leading-5">
{{range $element := .Data }}
<a href="/{{$.PathPrefix}}{{$element}}">
<div>{{$element}}</div>
<a class="block" href="/{{$.PathPrefix}}{{$element}}">
{{$element}}
</a>
{{end}}
</div>
<div class="flex justify-between">
{{if not (eq .PrevPage 0)}}
<a href="/{{.PaginationUrl}}/{{.PrevPage}}"
><< Prev page</a
>
{{end}} {{if not (eq .NextPage 0)}}
<a href="/{{.PaginationUrl}}/{{.NextPage}}"
>Next page >></a
>
{{if not (eq .PrevPage 0)}}
<a href="/{{.PaginationUrl}}/{{.PrevPage}}">&lt;&lt; Prev page</a>
{{end}} {{if not (eq .NextPage 0)}}
<a href="/{{.PaginationUrl}}/{{.NextPage}}">Next page &gt;&gt;</a>
</div>
{{end}}
</div>
</div>

View File

@@ -1,5 +1,5 @@
<aside
class="fixed sm:sticky w-full sm:w-auto transition-all duration-500 left-0 sm:left-auto top-auto sm:top-8 bottom-0 sm:bottom-auto self-start basis-3/12 mt-4 print:hidden"
class="fixed bottom-0 left-0 top-auto mt-4 w-full basis-3/12 self-start transition-all duration-500 print:hidden sm:sticky sm:bottom-auto sm:left-auto sm:top-8 sm:w-auto"
_="on click
toggle .hidden on #open
toggle .hidden on #close
@@ -7,7 +7,7 @@
toggle .hidden on <.client:not(:first-child) />"
>
<div
class="text-sm text-center mb-4 absolute top-0 right-0 sm:relative w-10 sm:w-auto h-10 sm:h-auto"
class="absolute right-0 top-0 mb-4 h-10 w-10 text-center text-sm sm:relative sm:h-auto sm:w-auto"
>
<span class="hidden sm:block">Open in</span>
<span id="open" class="inline sm:hidden">
@@ -17,7 +17,7 @@
height="20"
fill="currentColor"
viewBox="0 0 20 20"
class="w-1/2 h-1/2 block m-auto mt-[28%]"
class="m-auto mt-[28%] block h-1/2 w-1/2"
>
<path
fill="#fafafa"
@@ -34,7 +34,7 @@
height="16"
fill="currentColor"
viewBox="0 0 31 16"
class="w-1/2 h-1/2 block m-auto mt-[28%]"
class="m-auto mt-[28%] block h-1/2 w-1/2"
>
<path
fill="#fafafa"
@@ -55,15 +55,17 @@
>
{{range .Clients}}
<div
class="client | hidden sm:mb-3 sm:flex items-center bg-zinc-700 first-of-type:bg-strongpink first-of-type:rounded-t-lg sm:rounded-lg sm:first-of-type:rounded-lg hover:bg-zinc-800 border-b first-of-type:border-0 sm:border-0 border-zinc-800"
class="client | hidden items-center border-b border-zinc-800 bg-zinc-700 first-of-type:rounded-t-lg first-of-type:border-0 first-of-type:bg-strongpink hover:bg-zinc-800 sm:mb-3 sm:flex sm:rounded-lg sm:border-0 sm:first-of-type:rounded-lg"
_="on load get localStorage['nj:{{.ID}}'] or 0 then set @count to it then set @title to `used ${it} times`
on click increment localStorage['nj:{{.ID}}']"
>
<a
class="block sm:inline basis-full leading-4 text-left sm:text-center text-[17px] text-white no-underline px-3 py-3 sm:py-1.5 sm:py-1.5 font-normal sm:font-light"
class="block basis-full px-3 py-3 text-left text-[17px] font-normal leading-4 text-white no-underline sm:inline sm:py-1.5 sm:py-1.5 sm:text-center sm:font-light"
href="{{.URL}}"
>
<span class="inline text-white sm:hidden basis-1/5 ml-1.5">Open in</span>
<span class="ml-1.5 inline basis-1/5 text-white sm:hidden"
>Open in</span
>
{{.Name}}
</a>
</div>

View File

@@ -1,10 +1,10 @@
<!-- always visible details -->
<div
class="h-1.5 mb-6 -ml-4 sm:-ml-2.5 bg-zinc-100 dark:bg-zinc-700 w-1/3"
class="-ml-4 mb-6 h-1.5 w-1/3 bg-zinc-100 dark:bg-zinc-700 sm:-ml-2.5"
></div>
{{ if not (eq "" .Npub) }}
<div class="leading-5 mb-6">
<div class="mb-6 leading-5">
<div class="text-sm text-strongpink">Author Public Key</div>
{{.Npub}}
</div>
@@ -13,7 +13,7 @@
<!---->
{{ if not (eq 0 (len .SeenOn)) }}
<div class="leading-5 mb-6">
<div class="mb-6 leading-5">
<div class="text-sm text-strongpink">Seen on</div>
{{ range .SeenOn }}<a href="/r/{{.}}">{{.}}</a>
{{ end }}
@@ -45,24 +45,24 @@
/>
<label
for="advanced-switch"
class="bg-gray-300 dark:bg-zinc-800 -indent-96 cursor-pointer w-9 h-5 inline-block relative mr-2 rounded-full after:content-[&quot;&quot;] after:absolute after:w-4 after:h-4 after:transition after:rounded-2xl after:inset-0.5 after:bg-zinc-50 dark:after:bg-gray-700"
class="after:content-[&quot;&quot;] relative mr-2 inline-block h-5 w-9 cursor-pointer rounded-full bg-gray-300 -indent-96 after:absolute after:inset-0.5 after:h-4 after:w-4 after:rounded-2xl after:bg-zinc-50 after:transition dark:bg-zinc-800 dark:after:bg-gray-700"
>&nbsp;</label
>
<label
for="advanced-switch"
class="cursor-pointer leading-4 text-sm pb-0.5 border-b pb-0.5 border-b-gray-300"
class="cursor-pointer border-b border-b-gray-300 pb-0.5 pb-0.5 text-sm leading-4"
>Show more details</label
>
</div>
{{ end }}
<div id="hidden-fields" class="{{if .HideDetails}}hidden{{end}}">
<div class="leading-5 mb-6">
<div class="mb-6 leading-5">
<div class="text-sm text-strongpink">Published at</div>
{{.CreatedAt}}
</div>
<div class="leading-5 mb-6">
<div class="mb-6 leading-5">
<div class="text-sm text-strongpink">Kind type</div>
{{.Kind}} {{ if not (eq .KindNIP "")}} -
<a href="https://github.com/nostr-protocol/nips/blob/master/{{.KindNIP}}.md"
@@ -72,7 +72,7 @@
</div>
{{ if not (eq "" .Nevent) }}
<div class="leading-5 mb-6">
<div class="mb-6 leading-5">
<div class="text-sm text-strongpink">Address Code</div>
<div>{{.Nevent}}</div>
</div>
@@ -80,19 +80,19 @@
<!---->
<div class="leading-5 mb-6 px-4 pb-4 -mx-4 bg-gray-100 dark:bg-gray-700">
<div class="-mx-4 mb-6 bg-gray-100 px-4 pb-4 leading-5 dark:bg-gray-700">
<div
class="px-4 py-1 -mx-4 text-gray-100 dark:text-gray-400 bg-gray-300 dark:bg-gray-800"
class="-mx-4 bg-gray-300 px-4 py-1 text-gray-100 dark:bg-gray-800 dark:text-gray-400"
>
Event JSON
</div>
<div class="break-all font-mono whitespace-pre-wrap text-sm mt-4">
<div class="mt-4 whitespace-pre-wrap break-all font-mono text-sm">
{{- .EventJSON}}
</div>
</div>
{{ if not (eq "" .Nprofile) }}
<div class="leading-5 mb-6">
<div class="mb-6 leading-5">
<div class="text-sm text-strongpink">Author Profile Code</div>
{{.Nprofile}}
</div>

View File

@@ -1,11 +1,11 @@
<div
class="fixed overflow-hidden -z-10 inset-y-64 -inset-x-24 bg-gray-50 dark:bg-neutral-900 w-[200%] h-full -rotate-12 print:hidden"
class="fixed -inset-x-24 inset-y-64 -z-10 h-full w-[200%] -rotate-12 overflow-hidden bg-gray-50 dark:bg-neutral-900 print:hidden"
></div>
<footer class="mb-4 mt-6 text-gray-400 text-sm text-center">
<footer class="mb-4 mt-6 text-center text-sm text-gray-400">
powered by
<a class="underline text-gray-400" href="/">njump</a> & open-sourced on
<a class="underline text-gray-400" href="https://github.com/fiatjaf/njump"
<a class="text-gray-400 underline" href="/">njump</a> & open-sourced on
<a class="text-gray-400 underline" href="https://github.com/fiatjaf/njump"
>github</a
>
</footer>

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html class="theme--default font-light">
<meta charset="UTF-8" />
<head>
@@ -9,20 +9,20 @@
</head>
<body
class="mb-16 print:text-black text-gray-600 dark:text-neutral-50 bg-white dark:bg-neutral-800"
class="mb-16 bg-white text-gray-600 dark:bg-neutral-800 dark:text-neutral-50 print:text-black"
>
{{template "top" .}}
<div
class="block sm:flex sm:justify-center sm:items-center mx-auto px-4 sm:px-0 mt-8"
class="mx-auto mt-8 block px-4 sm:flex sm:items-center sm:justify-center sm:px-0"
>
<div
class="flex w-full sm:w-3/5 px-4 justify-between overflow-visible gap-10 lg:gap-48vw max-w-screen-2xl print:w-full"
class="flex w-full max-w-screen-2xl justify-between gap-10 overflow-visible px-4 print:w-full sm:w-3/5 lg:gap-48vw"
>
<div>
<h2 class="text-strongpink text-2xl">What is njump?</h2>
<h2 class="text-2xl text-strongpink">What is njump?</h2>
<p class="leading-5 my-3">
<p class="my-3 leading-5">
<i>njump</i> is a HTTP
<a class="underline" href="https://github.com/nostr-protocol/nostr"
>Nostr</a
@@ -33,7 +33,7 @@
resource outside the Nostr world, where the
<code>nostr:</code> schema is not (yet) working.
</p>
<p class="leading-5 my-3">
<p class="my-3 leading-5">
<i>njump</i> currently lives under {{ .Host }}, you can reach it
appending a Nostr
<a
@@ -43,11 +43,11 @@
>
entity (<code>npub</code>, <code>nevent</code>, <code>naddr</code>,
etc) after the domain:
<span class="rounded px-1 bg-lavender dark:bg-garnet"
<span class="rounded bg-lavender px-1 dark:bg-garnet"
>{{ .Host }}/&lt;nip-19-entity&gt;</span
>.
</p>
<p class="leading-5 my-3">
<p class="my-3 leading-5">
For example, here's
<a
href="/npub180cvv07tjdrrgpa0j7j7tmnyl2yr6yr7l8j4s3evf6u64th6gkwsyjh6w6"
@@ -68,34 +68,34 @@
>.
</p>
<h2 class="text-strongpink text-xl">
<h2 class="text-xl text-strongpink">
Try it now, jump to some Nostr content
</h2>
<div
class="my-3 mb-8 p-4 pb-3 sm:p-6 sm:pb-4 rounded-lg bg-zinc-100 dark:bg-neutral-800"
class="my-3 mb-8 rounded-lg bg-zinc-100 p-4 pb-3 dark:bg-neutral-800 sm:p-6 sm:pb-4"
>
<form
_="on submit halt the event's default then go to url `/${event.target.code.value}`"
>
<div
class="flex items-center flex-wrap sm:flex-nowrap justify-center sm:justify-normal"
class="flex flex-wrap items-center justify-center sm:flex-nowrap sm:justify-normal"
>
<div class="text-xl mb-1.5 sm:mb-0">{{ .Host }}/</div>
<div class="mb-1.5 text-xl sm:mb-0">{{ .Host }}/</div>
<input
name="code"
placeholder="paste a npub / nprofile / nevent / ..."
autofocus
class="basis-full sm:basis-11/12 w-full text-base p-2 ml-0 sm:ml-1 border-0 rounded-lg sm:rounded-s-lg focus:outline-0 bg-white text-gray-700 dark:bg-zinc-900 dark:text-neutral-50 placeholder:text-gray-300 dark:placeholder:text-gray-400"
class="ml-0 w-full basis-full rounded-lg border-0 bg-white p-2 text-base text-gray-700 placeholder:text-gray-300 focus:outline-0 dark:bg-zinc-900 dark:text-neutral-50 dark:placeholder:text-gray-400 sm:ml-1 sm:basis-11/12 sm:rounded-s-lg"
/>
<button
class="uppercase basis-full sm:basis-2/12 w-full text-base p-2 rounded-lg sm:rounded-s-lg text-white ml-0 sm:-ml-4 border-0 bg-strongpink"
class="ml-0 w-full basis-full rounded-lg border-0 bg-strongpink p-2 text-base uppercase text-white sm:-ml-4 sm:basis-2/12 sm:rounded-s-lg"
>
View
</button>
</div>
</form>
<div class="mt-3 sm:mt-1 text-sm text-center sm:text-left">
<div class="mt-3 text-center text-sm sm:mt-1 sm:text-left">
or pick
<a
class="underline"
@@ -106,13 +106,13 @@
</div>
</div>
<p class="leading-5 my-3">
<p class="my-3 leading-5">
There are several reasons to choose <i>njump</i> when sharing Nostr
content outside of Nostr:
</p>
<h2 class="text-strongpink text-2xl mt-7">Clean, fast and solid</h2>
<p class="leading-5 my-3">
<h2 class="mt-7 text-2xl text-strongpink">Clean, fast and solid</h2>
<p class="my-3 leading-5">
Pages by <i>njump</i> are extremely lightweight and fast to load
because there isn't any client side javascript involved; they are
minimalistic with the right attention to typography, focusing the
@@ -122,13 +122,13 @@
onboard new users!
</p>
<h2 class="text-strongpink text-2xl mt-7">Good preview</h2>
<p class="leading-5 my-3">
<h2 class="mt-7 text-2xl text-strongpink">Good preview</h2>
<p class="my-3 leading-5">
<i>njump</i> renders everything on the server-side, so it is able to
generate useful rich previews that work on Telegram, Discord,
Twitter and other places.
</p>
<p class="leading-5 my-3">
<p class="my-3 leading-5">
When opening the URL directly in a browser, visitors will find
referenced content like images, video and links to referenced Nostr
events displayed in a simple but effective way. It shows the note
@@ -136,15 +136,15 @@
for printing or exporting to PDF.
</p>
<h2 class="text-strongpink text-2xl mt-7">Cooperative (jump-out)</h2>
<p class="leading-5 my-3">
<h2 class="mt-7 text-2xl text-strongpink">Cooperative (jump-out)</h2>
<p class="my-3 leading-5">
<i>njump</i> is not interested capturing users at all, on the
contrary it invites them to "jump" to the Nostr resource by picking
from a list of web clients or with a <code>nostr:</code> for native
clients. It even remembers the most used one for each visitor and
puts it on the top for fast clicking or tap.
</p>
<p class="leading-5 my-3">
<p class="my-3 leading-5">
<a
class="underline"
href="https://github.com/nostr-protocol/nips/blob/master/89.md"
@@ -153,8 +153,10 @@
support coming!
</p>
<h2 class="text-strongpink text-2xl mt-7">Search friendly (jump-in)</h2>
<p class="leading-5 my-3">
<h2 class="mt-7 text-2xl text-strongpink">
Search friendly (jump-in)
</h2>
<p class="my-3 leading-5">
This is crucial: <i>njump</i> pages are static so search engines can
index them, this means that <i>njump</i> can help others to discover
great content on Nostr, jump in and join us! <i>njump</i> is the
@@ -163,8 +165,8 @@
you also help Nostr flourish.
</p>
<h2 class="text-strongpink text-2xl mt-7">Share NIP-05 profiles</h2>
<p class="leading-5 my-3">
<h2 class="mt-7 text-2xl text-strongpink">Share NIP-05 profiles</h2>
<p class="my-3 leading-5">
Now you can share your own profile with a pretty
<a
class="underline"
@@ -172,7 +174,7 @@
>NIP-05</a
>
inspired permalink:
<span class="rounded px-1 bg-lavender dark:bg-garnet"
<span class="rounded bg-lavender px-1 dark:bg-garnet"
>{{ .Host }}/&lt;nip-5&gt;</span
>, for example:
<a class="underline" href="/nvk.org">https://{{ .Host }}/nvk.org</a>
@@ -181,15 +183,15 @@
>https://{{ .Host }}/mike@mikedilger.com</a
>.
</p>
<p class="leading-5 my-3">
<p class="my-3 leading-5">
A profile shows the basic metadata infos, the used "outbox" relays
and the last notes.
</p>
<h2 class="text-strongpink text-2xl mt-7">
<h2 class="mt-7 text-2xl text-strongpink">
Share on Twitter and Telegram
</h2>
<p class="leading-5 my-3">
<p class="my-3 leading-5">
Now you can quickly and effortlessly share Nostr notes on Twitter
and Telegram, and maybe on many other "social platforms": just drop
a link, and njump will render the note text using the preview image
@@ -198,17 +200,17 @@
in-app!
</p>
<h2 class="text-strongpink text-2xl mt-7">Relays view</h2>
<p class="leading-5 my-3">
<h2 class="mt-7 text-2xl text-strongpink">Relays view</h2>
<p class="my-3 leading-5">
You can have a view of the last content posted to a relay using
<span class="rounded px-1 bg-lavender dark:bg-garnet"
<span class="rounded bg-lavender px-1 dark:bg-garnet"
>{{ .Host }}/r/&lt;relay-host&gt;</span
>, for example:
<a class="underline" href="/r/nostr.wine"
>https://{{ .Host }}/r/nostr.wine</a
>
</p>
<p class="leading-5 my-3">
<p class="my-3 leading-5">
Some basic infos (<a
href="https://github.com/nostr-protocol/nips/blob/master/11.md"
>NIP-11</a
@@ -217,8 +219,8 @@
to join a relay.
</p>
<h2 class="text-strongpink text-2xl mt-7">Inspector tool</h2>
<p class="leading-5 my-3">
<h2 class="mt-7 text-2xl text-strongpink">Inspector tool</h2>
<p class="my-3 leading-5">
You know, we are all programmers, including our moms, so for every
<i>njump</i> page you can toggle the "Show more details" switch and
inspect the full event JSON. Without installing other tools (like

View File

@@ -51,33 +51,33 @@
</head>
<body
class="mb-16 print:text-black text-gray-600 dark:text-neutral-50 bg-white dark:bg-neutral-800"
class="mb-16 bg-white text-gray-600 dark:bg-neutral-800 dark:text-neutral-50 print:text-black"
>
{{template "top" .}}
<div class="sm:flex sm:justify-center sm:items-center mx-auto px-4 sm:px-0">
<div class="mx-auto px-4 sm:flex sm:items-center sm:justify-center 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"
class="w-full max-w-screen-2xl justify-between gap-10 overflow-visible px-4 print:w-full sm:flex sm:w-9/12 lg:gap-48vw"
>
<div class="break-words w-full sm:w-9/12 print:w-full">
<header class="max-w-full mb-4">
<a class="flex items-center flex-wrap" href="/{{.Npub}}">
<div class="w-full break-words print:w-full sm:w-9/12">
<header class="mb-4 max-w-full">
<a class="flex flex-wrap items-center" href="/{{.Npub}}">
<div
class="mr-2 sm:mr-4 basis-1/6 print:basis-1-12 max-w-full imgclip overflow-hidden"
class="print:basis-1-12 imgclip mr-2 max-w-full basis-1/6 overflow-hidden sm:mr-4"
>
<img class="block w-full h-auto" src="{{.Metadata.Picture}}" />
<img class="block h-auto w-full" src="{{.Metadata.Picture}}" />
</div>
<div class="block sm:grow print:text-base">
<div class="block print:text-base sm:grow">
<div class="text-sm sm:text-2xl">
{{.Metadata.Name}}
<!---->
{{if not (eq .Metadata.Name .Metadata.DisplayName)}}
<span class="text-sm sm:text-xl text-stone-400"
<span class="text-sm text-stone-400 sm:text-xl"
>{{.Metadata.DisplayName}}</span
>
{{end}}
</div>
<div class="text-sm sm:text-base text-stone-400">
<div class="text-sm text-stone-400 sm:text-base">
{{.NpubShort}}
</div>
</div>
@@ -93,11 +93,11 @@
</div>
<div
class="h-1.5 mb-6 -ml-4 sm:-ml-2.5 bg-zinc-100 dark:bg-zinc-700 w-1/3"
class="-ml-4 mb-6 h-1.5 w-1/3 bg-zinc-100 dark:bg-zinc-700 sm:-ml-2.5"
></div>
<article
class="leading-5 mb-6 prose dark:prose-invert sm:prose-a:text-justify prose-headings:font-light prose-blockquote:mx-0 prose-blockquote:my-8 prose-blockquote:pl-4 prose-blockquote:pr-0 prose-blockquote:py-2 prose-blockquote:border-l-05rem prose-blockquote:border-solid prose-blockquote:border-l-gray-100 dark:prose-blockquote:border-l-zinc-800 prose-p:m-0 prose-p:mb-2 prose-cite:text-sm prose-ul:m-0 prose-ul:p-0 prose-ul:pl-4 prose-ol:m-0 prose-ol:p-0 prose-ol:pl-4 prose-li:mb-2 prose"
class="prose dark:prose-invert sm:prose-a:text-justify prose-headings:font-light prose-blockquote:mx-0 prose-blockquote:my-8 prose-blockquote:pl-4 prose-blockquote:pr-0 prose-blockquote:py-2 prose-blockquote:border-l-05rem prose-blockquote:border-solid prose-blockquote:border-l-gray-100 dark:prose-blockquote:border-l-zinc-800 prose-p:m-0 prose-p:mb-2 prose-cite:text-sm prose-ul:m-0 prose-ul:p-0 prose-ul:pl-4 prose-ol:m-0 prose-ol:p-0 prose-ol:pl-4 prose-li:mb-2 prose mb-6 leading-5"
>
{{ if (not (eq "" .Subject))}}
<h1 class="text-2xl">{{.Subject}}</h1>
@@ -113,7 +113,7 @@
{{template "details" .DetailsPartial}}
<div
class="h-1.5 mb-6 -ml-4 sm:-ml-2.5 bg-zinc-100 dark:bg-zinc-700 w-1/3"
class="-ml-4 mb-6 h-1.5 w-1/3 bg-zinc-100 dark:bg-zinc-700 sm:-ml-2.5"
></div>
</div>

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html class="theme--default text-lg sm:text-xl font-light print:text-base">
<!doctype html>
<html class="theme--default text-lg font-light print:text-base sm:text-xl">
<meta charset="UTF-8" />
<head>
{{ if .IsParameterizedReplaceable }}
@@ -13,25 +13,25 @@
</head>
<body
class="mb-16 print:text-black text-gray-600 dark:text-neutral-50 bg-white dark:bg-neutral-800"
class="mb-16 bg-white text-gray-600 dark:bg-neutral-800 dark:text-neutral-50 print:text-black"
>
{{template "top" .}}
<div
class="block sm:flex sm:justify-center sm:items-center mx-auto px-4 sm:px-0"
class="mx-auto block px-4 sm:flex sm:items-center sm:justify-center sm:px-0"
>
<div
class="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"
class="flex w-full max-w-screen-2xl justify-between gap-10 overflow-visible px-4 print:w-full sm:w-9/12 lg:gap-48vw"
>
<div class="break-words w-full sm:w-9/12 print:w-full">
<div class="w-full break-words print:w-full sm:w-9/12">
<header class="">
<div class="text-2xl mb-4">{{.KindDescription}}</div>
<div class="mb-4 text-2xl">{{.KindDescription}}</div>
</header>
{{template "details" .DetailsPartial}}
<div
class="h-1.5 mb-6 -ml-4 sm:-ml-2.5 bg-zinc-100 dark:bg-zinc-700 w-1/3"
class="-ml-4 mb-6 h-1.5 w-1/3 bg-zinc-100 dark:bg-zinc-700 sm:-ml-2.5"
></div>
</div>
</div>

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html class="theme--default text-lg sm:text-xl font-light print:text-base">
<!doctype html>
<html class="theme--default text-lg font-light print:text-base sm:text-xl">
<meta charset="UTF-8" />
<head>
<title>{{.Metadata.Name}} / {{.Metadata.DisplayName}} is on nostr</title>
@@ -29,19 +29,19 @@
</head>
<body
class="mb-16 print:text-black text-gray-600 dark:text-neutral-50 bg-white dark:bg-neutral-800"
class="mb-16 bg-white text-gray-600 dark:bg-neutral-800 dark:text-neutral-50 print:text-black"
>
{{template "top" .}}
<div class="sm:flex sm:justify-center sm:items-center mx-auto px-4 sm:px-0">
<div class="mx-auto px-4 sm:flex sm:items-center sm:justify-center sm:px-0">
<div
class="w-full sm:flex sm:w-9/12 sm:px-4 justify-between overflow-visible gap-10 lg:gap-48vw max-w-screen-2xl print:w-full"
class="w-full max-w-screen-2xl justify-between gap-10 overflow-visible print:w-full sm:flex sm:w-9/12 sm:px-4 lg:gap-48vw"
>
<header
class="flex sm:block items-center sm:items-start relative sm:sticky self-start basis-1/4 sm:mt-8 top-auto sm:top-8"
class="relative top-auto flex basis-1/4 items-center self-start sm:sticky sm:top-8 sm:mt-8 sm:block sm:items-start"
>
<div
class="text-left basis-[64%] overflow-hidden hidden items-center"
class="hidden basis-[64%] items-center overflow-hidden text-left"
_="on load or scroll from window or resize from window get #profile_name then measure its top, height then if top is less than height / -2 or height is 0 remove .hidden otherwise add .hidden"
>
<div class="mb-3 sm:text-center">
@@ -54,14 +54,14 @@
</div>
</div>
<div
class="max-w-[40%] sm:max-w-full imgclip overflow-hidden basis-2/5 sm:basis-auto"
class="imgclip max-w-[40%] basis-2/5 overflow-hidden sm:max-w-full sm:basis-auto"
>
<img class="block w-full h-auto" src="{{.Metadata.Picture}}" />
<img class="block h-auto w-full" src="{{.Metadata.Picture}}" />
</div>
</header>
<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">
<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="profile_name" class="text-2xl">{{.Metadata.Name}}</div>
{{if not (eq .Metadata.Name .Metadata.DisplayName)}}
@@ -72,47 +72,47 @@
</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"
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="leading-5 mb-6">
<div class="mb-6 leading-5">
<a
class="border-b-2 pb-0.5 border-b-gray-300 hover:text-strongpink"
class="border-b-2 border-b-gray-300 pb-0.5 hover:text-strongpink"
href="{{.NormalizedAuthorWebsiteURL}}"
>{{.Metadata.Website}}</a
>
</div>
<div
class="leading-5 mb-6 prose dark:prose-invert sm:prose-a:text-justify prose-headings:font-light"
class="prose dark:prose-invert sm:prose-a:text-justify prose-headings:font-light mb-6 leading-5"
>
{{.RenderedAuthorAboutText}}
</div>
<div
class="h-1.5 mb-6 -ml-4 sm:-ml-2.5 bg-zinc-100 dark:bg-zinc-700 w-1/3"
class="-ml-4 mb-6 h-1.5 w-1/3 bg-zinc-100 dark:bg-zinc-700 sm:-ml-2.5"
></div>
<div class="leading-5 mb-6">
<div class="mb-6 leading-5">
<div class="text-sm text-strongpink">Public Key</div>
{{.Npub}}
</div>
<div class="leading-5 mb-6">
<div class="mb-6 leading-5">
<div class="text-sm text-strongpink">NIP-05 Address</div>
{{.Metadata.NIP05}}
</div>
<div class="leading-5 mb-6">
<div class="mb-6 leading-5">
<div class="text-sm text-strongpink">NIP-57 Address</div>
{{.Metadata.LUD16}}
</div>
<div class="leading-5 mb-6">
<div class="mb-6 leading-5">
<div class="text-sm text-strongpink">Profile Code</div>
{{.Nprofile}}
</div>
{{ if not (eq 0 (len .AuthorRelays)) }}
<div class="leading-5 mb-6">
<div class="mb-6 leading-5">
<div class="text-sm text-strongpink">Publishing to</div>
{{range $index, $element := .AuthorRelays}}
<a
href="/r/{{$element}}"
class="inline-block max-w-full border mr-1 mt-2 px-2 py-0.5 rounded-lg border-slate-300 hover:text-white hover:bg-strongpink hover:border hover:border-solid hover:border-strongpink"
class="mr-1 mt-2 inline-block max-w-full rounded-lg border border-slate-300 px-2 py-0.5 hover:border hover:border-solid hover:border-strongpink hover:bg-strongpink hover:text-white"
>{{$element}}</a
>
{{end}}
@@ -127,27 +127,27 @@
{{if not (eq 0 (len .LastNotes))}}
<div
class="h-1.5 mb-6 -ml-4 sm:-ml-2.5 bg-zinc-100 dark:bg-zinc-700 w-1/3"
class="-ml-4 mb-6 h-1.5 w-1/3 bg-zinc-100 dark:bg-zinc-700 sm:-ml-2.5"
></div>
<nav class="leading-5 mb-6">
<h2 class="text-strongpink text-2xl">Last Notes</h2>
<nav class="mb-6 leading-5">
<h2 class="text-2xl text-strongpink">Last Notes</h2>
{{range $i, $ee := .LastNotes}}
<a
class="block no-underline my-8 hover:pl-4 hover:-ml-6 hover:border-solid hover:border-l-05rem hover:border-l-gray-100 dark:hover:border-l-zinc-700"
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="flex flex-row flex-wrap -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"
class="-ml-2.5 mb-1.5 flex flex-row flex-wrap 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>
{{if $ee.IsReply}}
<div class="text-sm ml-2 text-gray-300 dark:text-gray-400">
<div class="ml-2 text-sm text-gray-300 dark:text-gray-400">
- reply
</div>
{{end}}
</div>
<div
class="basis-full max-h-40 overflow-hidden mt-0.5 hover:text-strongpink"
class="mt-0.5 max-h-40 basis-full overflow-hidden hover:text-strongpink"
_="on load if my scrollHeight > my offsetHeight add .gradient"
>
{{$ee.Preview}}
@@ -158,7 +158,7 @@
{{end}}
<div
class="h-1.5 mb-6 -ml-4 sm:-ml-2.5 bg-zinc-100 dark:bg-zinc-700 w-1/3"
class="-ml-4 mb-6 h-1.5 w-1/3 bg-zinc-100 dark:bg-zinc-700 sm:-ml-2.5"
></div>
</div>

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html class="theme--default text-lg sm:text-xl font-light print:text-base">
<!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>
@@ -26,43 +26,43 @@
</head>
<body
class="mb-16 print:text-black text-gray-600 dark:text-neutral-50 bg-white dark:bg-neutral-800"
class="mb-16 bg-white text-gray-600 dark:bg-neutral-800 dark:text-neutral-50 print:text-black"
>
{{template "top" .}}
<div class="sm:flex sm:justify-center sm:items-center mx-auto px-4 sm:px-0">
<div class="mx-auto px-4 sm:flex sm:items-center sm:justify-center 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"
class="w-full max-w-screen-2xl justify-between gap-10 overflow-visible px-4 print:w-full sm:flex sm:w-9/12 lg:gap-48vw"
>
<div
class="flex items-center sm:items-start relative sm:sticky self-start basis-1/4 sm:mt-8 top-auto sm:top-8"
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="text-left basis-2/3 overflow-hidden hidden flex items-center text-2xl sm:break-all"
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="max-w-full imgclip overflow-hidden basis-2/5 sm:basis-auto"
class="imgclip max-w-full basis-2/5 overflow-hidden sm:basis-auto"
>
<img class="block w-full h-auto" src="{{.Info.Icon}}" />
<img class="block h-auto w-full" 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">
<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="h-1.5 mb-6 -ml-4 sm:-ml-2.5 bg-zinc-100 dark:bg-zinc-700 w-1/2"
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="leading-5 mb-6">
<div class="mb-6 leading-5">
<a
class="border-b-2 pb-0.5 border-b-gray-300 hover:text-strongpink"
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://')
@@ -71,60 +71,60 @@
>
</div>
<div
class="leading-5 mb-6 prose dark:prose-invert sm:prose-a:text-justify prose-headings:font-light"
class="prose dark:prose-invert sm:prose-a:text-justify prose-headings:font-light mb-6 leading-5"
>
{{.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"
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="leading-5 mb-6">
<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="leading-5 mb-6">
<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="h-1.5 mb-6 -ml-4 sm:-ml-2.5 bg-zinc-100 dark:bg-zinc-700 w-1/3"
class="-ml-4 mb-6 h-1.5 w-1/3 bg-zinc-100 dark:bg-zinc-700 sm:-ml-2.5"
></div>
<div class="leading-5 mb-6">
<h2 class="text-strongpink text-2xl">Last Notes</h2>
<div class="mb-6 leading-5">
<h2 class="text-2xl text-strongpink">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"
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="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"
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="text-xs ml-2 text-gray-300 dark:text-gray-400">
<div class="ml-2 text-xs text-gray-300 dark:text-gray-400">
- reply
</div>
{{end}}
<div class="text-xs ml-auto text-zinc-700 dark:text-neutral-50">
<div class="ml-auto text-xs 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"
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="basis-full max-h-40 overflow-hidden mt-0.5 hover:text-strongpink"
class="mt-0.5 max-h-40 basis-full overflow-hidden hover:text-strongpink"
_="on load if my scrollHeight >= my offsetHeight add .gradient"
>
{{$ee.Preview}}

View File

@@ -1,9 +1,12 @@
<header class="text-sm sm:text-base sm:flex items-center p-4 print:block">
<a href="https://nostr.com" class="print:hidden text-md text-right basis-1/6" target="_blank"
<header class="items-center p-4 text-sm print:block sm:flex sm:text-base">
<a
href="https://nostr.com"
class="text-md basis-1/6 text-right print:hidden"
target="_blank"
>What is <span class="text-strongpink">Nostr</span>?</a
>
<div
class="relative sm:fixed float-right sm:float-none w-4 h-4 cursor-pointer rounded-full sm:right-4 sm:top-4 text-gray-100 dark:text-gray-700 print:hidden;"
class="print:hidden; relative float-right h-4 w-4 cursor-pointer rounded-full text-gray-100 dark:text-gray-700 sm:fixed sm:right-4 sm:top-4 sm:float-none"
_="on click tell <html /> toggle between .theme--dark and .theme--default then get your @class then get it[0].split('--')[1].split(' ')[0] then set localStorage.theme to it
on load tell <html /> get localStorage.theme then if it is 'dark' add .theme--dark then remove .theme--default else if it is not 'default' then get window.matchMedia('(prefers-color-scheme: dark)').matches then if it is true add .theme--dark then remove .theme--default end"
>