Skip to content

Commit ab776a3

Browse files
authored
feat(website): use animated logo on all pages and matching favicon (#19)
* feat(website): use animated logo on all pages and matching favicon Extract the animated synapse logo from Nav into a shared Logo.astro component, swap the homepage's static dot mark for it, and align favicon.svg with the same geometry, animation, and signal palette. * fix(website): address PR review feedback on Logo component and favicon - Generate unique gradient id per Logo instance to avoid duplicate DOM ids - Add #61EBFA/#6FE4BF fallbacks to CSS variable colors - Align favicon stroke-width (1.6) and add stroke-linecap="round" to Logo
1 parent 285d210 commit ab776a3

4 files changed

Lines changed: 34 additions & 23 deletions

File tree

‎website/public/favicon.svg‎

Lines changed: 8 additions & 5 deletions
Loading
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
interface Props {
3+
size?: number;
4+
}
5+
6+
const { size = 28 } = Astro.props;
7+
const gradientId = `synapse-g-${crypto.randomUUID()}`;
8+
---
9+
<svg viewBox="0 0 32 32" width={size} height={size} aria-hidden="true">
10+
<defs>
11+
<linearGradient id={gradientId} x1="0" x2="1" y1="0" y2="1">
12+
<stop offset="0" stop-color="var(--signal-a, #61EBFA)" />
13+
<stop offset="1" stop-color="var(--signal-b, #6FE4BF)" />
14+
</linearGradient>
15+
</defs>
16+
<circle cx="8" cy="16" r="3.5" fill="var(--signal-a, #61EBFA)" />
17+
<circle cx="24" cy="16" r="3.5" fill="var(--signal-b, #6FE4BF)" />
18+
<path d="M8 16 Q 16 6 24 16" stroke={`url(#${gradientId})`} stroke-width="1.6" fill="none" stroke-linecap="round">
19+
<animate attributeName="d" dur="2.4s" repeatCount="indefinite"
20+
values="M8 16 Q 16 6 24 16; M8 16 Q 16 26 24 16; M8 16 Q 16 6 24 16" />
21+
</path>
22+
</svg>

‎website/src/components/layout/Nav.astro‎

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,13 @@
11
---
22
import ThemeToggle from './ThemeToggle.astro';
3+
import Logo from './Logo.astro';
34
import Search from '~/components/react/Search.tsx';
45
const path = Astro.url.pathname;
56
const isActive = (p: string) => path === p || (p !== '/' && path.startsWith(p));
67
---
78
<nav class="syn-nav" aria-label="Primary">
89
<a href="/" class="syn-nav__brand" aria-label="Synapse home">
9-
<svg viewBox="0 0 32 32" width="28" height="28" aria-hidden="true">
10-
<defs>
11-
<linearGradient id="synapse-g" x1="0" x2="1" y1="0" y2="1">
12-
<stop offset="0" stop-color="var(--signal-a)" />
13-
<stop offset="1" stop-color="var(--signal-b)" />
14-
</linearGradient>
15-
</defs>
16-
<circle cx="8" cy="16" r="3.5" fill="var(--signal-a)" />
17-
<circle cx="24" cy="16" r="3.5" fill="var(--signal-b)" />
18-
<path d="M8 16 Q 16 6 24 16" stroke="url(#synapse-g)" stroke-width="1.6" fill="none">
19-
<animate attributeName="d" dur="2.4s" repeatCount="indefinite"
20-
values="M8 16 Q 16 6 24 16; M8 16 Q 16 26 24 16; M8 16 Q 16 6 24 16" />
21-
</path>
22-
</svg>
10+
<Logo />
2311
<span>Synapse</span>
2412
</a>
2513
<ul class="syn-nav__links" role="list">

‎website/src/pages/index.astro‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
import BaseLayout from '~/components/layout/BaseLayout.astro';
3+
import Logo from '~/components/layout/Logo.astro';
34
45
import { highlightJava } from '@/lib/highlight';
56
import { QUICKSTART_CODE, PUBSUB_CODE, HARDWARE_CODE } from '@/lib/code-samples';
@@ -159,10 +160,7 @@ const footerCols = [
159160
>
160161
<div class="mx-auto flex h-16 max-w-6xl items-center justify-between px-6">
161162
<a href="/" class="flex items-center gap-2.5">
162-
<span class="relative flex size-8 items-center justify-center rounded-lg bg-primary/15">
163-
<span class="absolute size-2.5 rounded-full bg-primary shadow-[0_0_12px_var(--glow-soft)]"></span>
164-
<span class="absolute size-5 rounded-full border border-primary/40"></span>
165-
</span>
163+
<Logo size={28} />
166164
<span class="font-display text-lg font-semibold tracking-tight">Synapse</span>
167165
<span
168166
class="ml-1 rounded-full border border-primary/40 bg-primary/10 px-2.5 py-0.5 font-mono text-[10px] font-medium text-primary shadow-[0_0_14px_-2px_var(--glow-soft)]"

0 commit comments

Comments
 (0)