atproto explorer pdsls.dev
atproto tool

add favicon in collection list

juli.ee 53708883 454daf8f

verified
+1 -1
index.html
···
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
-
<link rel="icon" href="/favicon.png" />
+
<link rel="icon" href="/favicon.ico" />
<meta property="og:title" content="PDSls" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://pdsls.dev" />
public/favicon.png public/favicon.ico
+1 -1
public/manifest.json
···
"theme_color": "#1f1f1f",
"icons": [
{
-
"src": "/favicon.png",
+
"src": "/favicon.ico",
"type": "image/png",
"sizes": "512x512"
},
+1 -1
public/oauth-client-metadata.json
···
"client_id": "https://pdsls.dev/oauth-client-metadata.json",
"client_name": "PDSls",
"client_uri": "https://pdsls.dev",
-
"logo_uri": "https://pdsls.dev/favicon.png",
+
"logo_uri": "https://pdsls.dev/favicon.ico",
"redirect_uris": ["https://pdsls.dev/"],
"scope": "atproto transition:generic",
"grant_types": ["authorization_code", "refresh_token"],
+46 -18
src/views/repo.tsx
···
: true,
)}
>
-
{(authority) => (
-
<div class="dark:hover:bg-dark-200 flex flex-col rounded-lg p-1 hover:bg-neutral-200">
-
<For
-
each={nsids()?.[authority].nsids.filter((nsid) =>
-
filter() ? nsid.startsWith(filter()!.split(".").slice(2).join(".")) : true,
-
)}
-
>
-
{(nsid) => (
-
<A
-
href={`/at://${did}/${authority}.${nsid}`}
-
class="hover:underline active:underline"
+
{(authority) => {
+
const reversedDomain = authority.split(".").reverse().join(".");
+
const [faviconError, setFaviconError] = createSignal(false);
+
+
return (
+
<div class="dark:hover:bg-dark-200 flex items-start gap-2 rounded-lg p-1 hover:bg-neutral-200">
+
<div class="flex h-5 w-4 shrink-0 items-center justify-center">
+
<Show
+
when={!faviconError()}
+
fallback={
+
<span class="iconify lucide--globe size-4 text-neutral-400 dark:text-neutral-500" />
+
}
>
-
<span>{authority}</span>
-
<span class="text-neutral-500 dark:text-neutral-400">.{nsid}</span>
-
</A>
-
)}
-
</For>
-
</div>
-
)}
+
<img
+
src={
+
reversedDomain === "bsky.app" ?
+
"https://web-cdn.bsky.app/static/apple-touch-icon.png"
+
: `https://${reversedDomain}/favicon.ico`
+
}
+
alt={`${reversedDomain} favicon`}
+
class="h-4 w-4"
+
onError={() => setFaviconError(true)}
+
/>
+
</Show>
+
</div>
+
<div class="flex flex-1 flex-col">
+
<For
+
each={nsids()?.[authority].nsids.filter((nsid) =>
+
filter() ?
+
nsid.startsWith(filter()!.split(".").slice(2).join("."))
+
: true,
+
)}
+
>
+
{(nsid) => (
+
<A
+
href={`/at://${did}/${authority}.${nsid}`}
+
class="hover:underline active:underline"
+
>
+
<span>{authority}</span>
+
<span class="text-neutral-500 dark:text-neutral-400">.{nsid}</span>
+
</A>
+
)}
+
</For>
+
</div>
+
</div>
+
);
+
}}
</For>
</div>
</Show>