Animate the Nostr metadata loading state with a relay constellation
CI / Test (pull_request) Successful in 1m19s

Replace the empty placeholder in the Nostr settings loading state with the relay constellation illustration, cropped to trim its own top/bottom whitespace.
This commit is contained in:
raucao committed 2026-11-28 14:46:45 +04:00
1 parent 70faa4f329
commit c1838d1b9f
2 files changed
+48 -2

No files matched your search

+2 -2
View File
@@ -55,8 +55,8 @@
data-nostr-metadata-url-value="<%= nostr_metadata_settings_path %>"
data-action="nostr:publish->nostr-metadata#refresh">
<div data-nostr-metadata-target="loading"
class="flex flex-col items-center justify-center py-16">
<div class="mb-4 h-12 w-12"></div>
class="flex flex-col items-center justify-center pt-0 pb-0">
<%= image_tag "/img/illustrations/relay_constellation.svg", class: "mb-6 h-48 w-auto", alt: "" %>
<h3>Just a moment...</h3>
<p data-nostr-metadata-target="status"
class="text-gray-500 animate-pulse">Loading</p>
@@ -0,0 +1,46 @@
<svg xmlns="http://www.w3.org/2000/svg" width="200" height="118" viewBox="0 10 200 118">
<style>
.query { stroke-dasharray: 13 100; stroke-dashoffset: 16; opacity: 0; animation: constellation-query 3.6s linear infinite; }
.reply { stroke-dasharray: 18 100; stroke-dashoffset: 21; opacity: 0; animation: constellation-reply 3.6s linear infinite; }
.relay-halo { transform-box: fill-box; transform-origin: center; animation: constellation-relay 3.6s ease-out infinite; }
@keyframes constellation-query {
0% { opacity: 0; stroke-dashoffset: 16; }
6% { opacity: 1; }
31% { opacity: 1; stroke-dashoffset: -100; }
33%, 100% { opacity: 0; stroke-dashoffset: -116; }
}
@keyframes constellation-reply {
0%, 34% { opacity: 0; stroke-dashoffset: 21; }
41% { opacity: 1; }
71% { opacity: 1; stroke-dashoffset: -100; }
73%, 100% { opacity: 0; stroke-dashoffset: -121; }
}
@keyframes constellation-relay {
0%, 24%, 55%, 100% { opacity: 0; transform: scale(.6); }
33% { opacity: .9; transform: scale(1); }
50% { opacity: 0; transform: scale(1.55); }
}
@media (prefers-reduced-motion: reduce) {
.query, .reply, .relay-halo { animation: none; }
}
</style>
<g fill="none" stroke-linecap="round" stroke-linejoin="round">
<ellipse cx="100" cy="68" rx="84" ry="47" transform="rotate(-15 100 68)" stroke="#eee9f8" stroke-dasharray="2 5"/>
<path d="M28 86 51 37 132 21 171 53 153 106 74 117Z M51 37 74 117 M132 21 153 106 M28 86 153 106" stroke="#e0d6f2" stroke-width="1.15"/>
<path d="M100 68 51 37 M100 68 171 53 M100 68 74 117" stroke="#c9b6e9" stroke-width="1.5"/>
<path class="query" d="M100 68 51 37" pathLength="100" stroke="#8750ce" stroke-width="2.6"/>
<path class="query" d="M100 68 171 53" pathLength="100" stroke="#8750ce" stroke-width="2.6" style="animation-delay:.16s"/>
<path class="query" d="M100 68 74 117" pathLength="100" stroke="#8750ce" stroke-width="2.6" style="animation-delay:.32s"/>
<path class="reply" d="M171 53 100 68" pathLength="100" stroke="#159a8c" stroke-width="3.2"/>
<circle class="relay-halo" cx="171" cy="53" r="9" stroke="#159a8c" opacity="0"/>
</g>
<g fill="#fff" stroke="#ae96d3" stroke-width="1.65">
<circle cx="28" cy="86" r="4.5"/><circle cx="51" cy="37" r="5.5"/>
<circle cx="132" cy="21" r="4.5"/><circle cx="153" cy="106" r="5"/>
<circle cx="74" cy="117" r="5"/>
</g>
<circle cx="171" cy="53" r="5.5" fill="#e0f8f3" stroke="#159a8c" stroke-width="1.65"/>
<circle cx="100" cy="68" r="22" fill="#f1e9fc"/>
<circle cx="100" cy="68" r="17.5" fill="#7844ba"/>
<path d="M99 67 a4.4 4.4 0 1 0 -6.2 0 a4.4 4.4 0 0 0 6.2 0L106 74m-1.9-2 2.2-2.2m-4.3.1 2.1-2.1" fill="none" stroke="#fff" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB