Skip to content

Commit 4826b12

Browse files
fix: badge colors, certificate-image font timeout, stamp overflow
- Badge URL updated to flat-square grey/red style with 🪦 emoji - Certificate-image font fetch wrapped in AbortSignal.timeout(3000) - Stamp moved to outer div to prevent overflow:hidden clipping - README badge example updated to match new style Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 0405799 commit 4826b12

4 files changed

Lines changed: 28 additions & 33 deletions

File tree

README.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,13 @@ Paste a public GitHub URL. Get a shareable **Certificate of Death** — algorith
1616

1717
Got a dead repo? Add the badge to your README:
1818

19-
[![commitmentissues](https://img.shields.io/badge/%E2%9A%B0%20commitmentissues-declared%20dead-cc0000?style=for-the-badge&labelColor=1a0f06)](https://commitmentissues.dev)
19+
[![🪦 declared dead](https://img.shields.io/badge/%F0%9F%AA%A6%20declared%20dead-commitmentissues.dev-cc0000?style=flat-square)](https://commitmentissues.dev)
2020

2121
```markdown
22-
[![commitmentissues](https://img.shields.io/badge/%E2%9A%B0%20commitmentissues-declared%20dead-cc0000?style=for-the-badge&labelColor=1a0f06)](https://commitmentissues.dev/?repo=YOUR_OWNER/YOUR_REPO)
22+
[![🪦 declared dead](https://img.shields.io/badge/%F0%9F%AA%A6%20declared%20dead-commitmentissues.dev-cc0000?style=flat-square)](https://commitmentissues.dev/?repo=YOUR_OWNER/YOUR_REPO)
2323
```
2424

25-
Or embed the full certificate image:
26-
27-
```markdown
28-
[![Certificate of Death](https://commitmentissues.dev/api/certificate-image/YOUR_OWNER/YOUR_REPO)](https://commitmentissues.dev/?repo=YOUR_OWNER/YOUR_REPO)
29-
```
30-
31-
Both are generated automatically on the certificate page — just hit **Copy** after analyzing your repo.
25+
The badge and full certificate embed markdown are generated automatically on the certificate page — just hit **Copy** after analyzing your repo.
3226

3327
## Screenshots
3428

src/app/api/certificate-image/[owner]/[repo]/route.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ async function loadFont(family: string, weight: number): Promise<ArrayBuffer | n
2323
try {
2424
const css = await fetch(
2525
`https://fonts.googleapis.com/css2?family=${family.replace(/\s+/g, '+')}:wght@${weight}&display=swap`,
26-
{ headers: { 'User-Agent': 'Mozilla/5.0 Chrome/120' } }
26+
{ headers: { 'User-Agent': 'Mozilla/5.0 Chrome/120' }, signal: AbortSignal.timeout(3000) }
2727
).then(r => r.text())
2828
const m = css.match(/url\((https:\/\/fonts\.gstatic\.com[^)]+)\)\s+format\(['"]woff2['"]\)/)
2929
if (!m) return null
30-
return fetch(m[1]).then(r => r.arrayBuffer())
30+
return fetch(m[1], { signal: AbortSignal.timeout(3000) }).then(r => r.arrayBuffer())
3131
} catch {
3232
return null
3333
}

src/components/CertificateCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -581,12 +581,12 @@ export default function CertificateCard({ cert, onReset }: Props) {
581581
{(() => {
582582
const fullName = cert.repoData.fullName
583583
const repoUrl = `https://commitmentissues.dev/?repo=${encodeURIComponent(fullName)}`
584-
const shieldsUrl = `https://img.shields.io/badge/${encodeURIComponent('⚰ commitmentissues')}-${encodeURIComponent('declared dead')}-cc0000?style=for-the-badge&labelColor=1a0f06`
584+
const shieldsUrl = `https://img.shields.io/badge/%F0%9F%AA%A6%20declared%20dead-commitmentissues.dev-cc0000?style=flat-square`
585585
const badgeMd = `[![commitmentissues](${shieldsUrl})](${repoUrl})`
586586
const certImageUrl = `https://commitmentissues.dev/api/certificate-image/${fullName}`
587587
const certMd = `[![${cert.repoData.name} — Certificate of Death](${certImageUrl})](${repoUrl})`
588588

589-
const shieldsPreviewUrl = `https://img.shields.io/badge/${encodeURIComponent('⚰ commitmentissues')}-${encodeURIComponent('declared dead')}-cc0000?style=for-the-badge&labelColor=1a0f06`
589+
const shieldsPreviewUrl = `https://img.shields.io/badge/%F0%9F%AA%A6%20declared%20dead-commitmentissues.dev-cc0000?style=flat-square`
590590

591591
const CopyIcon = ({ done }: { done: boolean }) => done
592592
? <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round"><polyline points="20 6 9 17 4 12"/></svg>

src/components/CertificateFixed.tsx

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,27 @@ const CertificateFixed = forwardRef<HTMLDivElement, Props>(
8787
>
8888
{PAPER_TEXTURE_SVG}
8989

90+
{showStamp && (
91+
<div
92+
ref={stampRef}
93+
className="stamp-animate"
94+
style={{
95+
position: 'absolute',
96+
bottom: '28px',
97+
left: '50%',
98+
transform: 'translateX(-50%)',
99+
pointerEvents: 'none',
100+
userSelect: 'none',
101+
zIndex: 10,
102+
}}
103+
>
104+
<div style={{ border: '5px solid rgba(139,26,26,0.72)', borderRadius: '4px', padding: '10px 28px', background: 'rgba(139,26,26,0.04)' }}>
105+
<span style={{ fontFamily: MONO, fontSize: '13px', fontWeight: 700, letterSpacing: '0.14em', textTransform: 'uppercase', color: 'rgba(139,26,26,0.75)', display: 'block', textAlign: 'center', whiteSpace: 'nowrap' }}>
106+
Issued by commitmentissues.dev
107+
</span>
108+
</div>
109+
</div>
110+
)}
90111

91112
<div
92113
style={{
@@ -179,26 +200,6 @@ const CertificateFixed = forwardRef<HTMLDivElement, Props>(
179200
</p>
180201
</div>
181202

182-
{showStamp && (
183-
<div
184-
ref={stampRef}
185-
className="stamp-animate"
186-
style={{
187-
marginTop: 'auto',
188-
display: 'flex',
189-
justifyContent: 'center',
190-
paddingBottom: '8px',
191-
pointerEvents: 'none',
192-
userSelect: 'none',
193-
}}
194-
>
195-
<div style={{ border: '5px solid rgba(139,26,26,0.72)', borderRadius: '4px', padding: '10px 28px', background: 'rgba(139,26,26,0.04)' }}>
196-
<span style={{ fontFamily: MONO, fontSize: '13px', fontWeight: 700, letterSpacing: '0.14em', textTransform: 'uppercase', color: 'rgba(139,26,26,0.75)', display: 'block', textAlign: 'center', whiteSpace: 'nowrap' }}>
197-
Issued by commitmentissues.dev
198-
</span>
199-
</div>
200-
</div>
201-
)}
202203

203204
</div>
204205
</div>

0 commit comments

Comments
 (0)