Skip to content

Commit 112ca70

Browse files
maskedsyntaxclaude
andcommitted
feat: add Product Hunt review pill to navbar for higher visibility
Surface the Product Hunt review CTA in the fixed navbar (next to Star on GitHub) as an on-brand pill, plus a full-width entry in the mobile menu, so it's visible without scrolling to the footer. Centralize the review URL in links.ts and reuse it in the footer badge. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 76ec26e commit 112ca70

3 files changed

Lines changed: 85 additions & 2 deletions

File tree

website/src/lib/components/Navbar.svelte

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33
import { goto } from '$app/navigation';
44
import { theme } from '$lib/stores/theme';
55
import { githubStats, links } from '$lib/data/links';
6+
import { logEvent } from '$lib/utils/analytics';
67
import ContentContainer from './ContentContainer.svelte';
8+
import BrandIcon from './BrandIcon.svelte';
79
import { Download, Menu, X, Sun, Moon, Star, ChevronDown } from 'lucide-svelte';
10+
import { siProducthunt } from 'simple-icons';
811
912
let {
1013
onNavigate
@@ -29,6 +32,10 @@
2932
mobileMenuOpen = false;
3033
}
3134
35+
function trackProductHunt() {
36+
logEvent('product_hunt_review_click', { source: 'navbar' });
37+
}
38+
3239
$effect(() => {
3340
const onScroll = () => {
3441
scrolled = window.scrollY > 8;
@@ -125,6 +132,16 @@
125132
<Moon size={20} />
126133
{/if}
127134
</button>
135+
<a
136+
class="ph-btn"
137+
href={links.productHuntReview}
138+
target="_blank"
139+
rel="noopener noreferrer"
140+
onclick={trackProductHunt}
141+
>
142+
<BrandIcon icon={siProducthunt} size={16} color="currentColor" />
143+
<span>Review</span>
144+
</a>
128145
<a class="github-btn" href={links.github} target="_blank" rel="noopener noreferrer">
129146
<Star size={16} />
130147
<span>Star on GitHub</span>
@@ -203,6 +220,19 @@
203220
{starCountLabel}
204221
</span>
205222
</a>
223+
<a
224+
class="ph-btn mobile-ph"
225+
href={links.productHuntReview}
226+
target="_blank"
227+
rel="noopener noreferrer"
228+
onclick={() => {
229+
trackProductHunt();
230+
closeMobile();
231+
}}
232+
>
233+
<BrandIcon icon={siProducthunt} size={16} color="currentColor" />
234+
<span>Review on Product Hunt</span>
235+
</a>
206236
</div>
207237
</div>
208238
{/if}
@@ -369,6 +399,27 @@
369399
border-color: color-mix(in srgb, var(--border) 70%, var(--accent) 30%);
370400
}
371401
402+
.ph-btn {
403+
display: inline-flex;
404+
align-items: center;
405+
gap: 8px;
406+
padding: 9px 14px;
407+
border-radius: 8px;
408+
font-size: 14px;
409+
font-weight: 600;
410+
line-height: 1;
411+
color: color-mix(in srgb, var(--text) 82%, transparent);
412+
background: var(--surface-alt);
413+
border: 1px solid var(--border);
414+
transition: background 0.2s, color 0.2s, border-color 0.2s;
415+
}
416+
417+
.ph-btn:hover {
418+
color: var(--accent);
419+
background: color-mix(in srgb, var(--surface-alt) 90%, var(--accent) 10%);
420+
border-color: color-mix(in srgb, var(--border) 70%, var(--accent) 30%);
421+
}
422+
372423
.star-count {
373424
display: inline-flex;
374425
align-items: center;
@@ -492,7 +543,8 @@
492543
}
493544
494545
.mobile-download,
495-
.mobile-github {
546+
.mobile-github,
547+
.mobile-ph {
496548
width: 100%;
497549
justify-content: center;
498550
}
@@ -501,6 +553,10 @@
501553
margin-top: 0;
502554
}
503555
556+
.mobile-ph {
557+
margin-top: 0;
558+
}
559+
504560
.mobile-download {
505561
margin-top: 0;
506562
}

website/src/lib/data/links.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ export const links = {
1313
issues: 'https://github.com/maskedsyntax/patterns/issues',
1414
license: 'https://github.com/maskedsyntax/patterns/blob/master/LICENSE',
1515
maskedsyntax: 'https://maskedsyntax.com/',
16-
site: 'https://patternsocd.com/'
16+
site: 'https://patternsocd.com/',
17+
productHuntReview:
18+
'https://www.producthunt.com/products/patterns-ocd-erp-journal/reviews/new?utm_source=badge-product_review&utm_medium=badge&utm_source=badge-patterns-ocd-erp-journal'
1719
} as const;
1820

1921
export const githubStats = {

website/src/lib/sections/Footer.svelte

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,21 @@
3636
<img src="/assets/logo.png" alt="" width="28" height="28" />
3737
<span>Patterns</span>
3838
<p>Clarity for the mind through<br />structured reflection.</p>
39+
<a
40+
class="ph-badge"
41+
href={links.productHuntReview}
42+
target="_blank"
43+
rel="noopener noreferrer"
44+
onclick={() => trackClick('product_hunt_review')}
45+
>
46+
<img
47+
src="https://api.producthunt.com/widgets/embed-image/v1/product_review.svg?product_id=1265014&theme=neutral"
48+
alt="Patterns - Track urges, mood & exposure | Product Hunt"
49+
width="250"
50+
height="54"
51+
loading="lazy"
52+
/>
53+
</a>
3954
</div>
4055
<div class="link-groups">
4156
<nav class="links" aria-label="Resources">
@@ -104,6 +119,16 @@
104119
color: var(--text-secondary);
105120
}
106121
122+
.ph-badge {
123+
margin-top: 4px;
124+
display: inline-flex;
125+
line-height: 0;
126+
}
127+
128+
.ph-badge img {
129+
border-radius: 0;
130+
}
131+
107132
.link-groups {
108133
display: flex;
109134
flex-wrap: wrap;

0 commit comments

Comments
 (0)