From 961f42e5977b33008999c63881b55d5df0450d1e Mon Sep 17 00:00:00 2001
From: memdmp <memdmp@estrogen.zone>
Date: Wed, 22 Jan 2025 21:43:41 +0100
Subject: feat: nice noscript canary page

---
 src/routes/canaries/+page.svelte | 41 ++++++++++++++++++++++++++++++----------
 1 file changed, 31 insertions(+), 10 deletions(-)

(limited to 'src/routes/canaries/+page.svelte')

diff --git a/src/routes/canaries/+page.svelte b/src/routes/canaries/+page.svelte
index 24e968a..1613831 100644
--- a/src/routes/canaries/+page.svelte
+++ b/src/routes/canaries/+page.svelte
@@ -13,18 +13,39 @@
 
 <div class="flex min-h-full min-w-full flex-col justify-between">
   <div>
-    {#await initKeystore}
-      {#if browser}
-        Preparing...
-      {:else}
-        Awaiting Browser
-        <noscript>
-          If you're using noscript, here are the raw canaries:
+    {#if !browser}
+      <noscript class="text-white min-w-full min-h-full">
+        You're using noscript; here are the raw canaries:<br />
+        <ul>
           {#each canaries as canary}
-            <a href={canary.url}>{canary.signer}'s canary for {canary.name}</a>
+            <li class="list-disc ml-4">
+              {canary.signer}'s canary for {canary.name} (<a
+                href={canary.url}
+                target="_blank"
+                download="{canary.signer}:{canary.name}.sig"
+                class="opacity-90 hover:underline text-blue-400 hover:text-blue-300"
+                >download</a
+              >,
+              <a
+                href={canary.url}
+                target="_blank"
+                class="opacity-90 hover:underline text-blue-400 hover:text-blue-300"
+                >open in newtab</a
+              >)
+            </li>
           {/each}
-        </noscript>
-      {/if}
+        </ul>
+        {@html `<style>.hidden-if-noscript{display:none !important;}</stylew>`}
+      </noscript>
+    {/if}
+    {#await initKeystore}
+      <div class="hidden-if-noscript">
+        {#if browser}
+          Preparing...
+        {:else}
+          Awaiting Browser
+        {/if}
+      </div>
     {:then _}
       <div class="canaries flex gap-4 flex-wrap max-w-full">
         {#each canaries as canary}
-- 
cgit v1.2.3

