Skip to content

Commit f153386

Browse files
authored
feat(share): LinkedIn share badge with social integration (#8)
* feat(share): added LinkedIn share badge with SVG certificate and social sharing - shareable SVG badge with score, name, and branding - SVG to PNG download via canvas API - LinkedIn share post and add-to-profile via URL schemes - copy-to-clipboard for pre-drafted LinkedIn post text * fix(share): improved LinkedIn badge UX and removed JSON export - redesigned badge SVG with gradient border frame, verification seal watermark, and tighter proportions (520x720) - LinkedIn share now pre-populates post text with all 6 ATS platforms and hashtags via feed intent URL - LinkedIn profile link (linkedin.com/in/sunny-patel-30b460204) included for attribution - download filename: "Name - ATS Screener Badge - Month Day Year.png" (cross-platform safe) - removed copy share text button and JSON export button from dashboard - removed unused copied state, copyShareText function, exportResults function
1 parent ae9fb87 commit f153386

File tree

2 files changed

+686
-36
lines changed

2 files changed

+686
-36
lines changed

src/lib/components/scoring/ScoreDashboard.svelte

Lines changed: 30 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import KeywordAnalysis from './KeywordAnalysis.svelte';
66
import WeakestAreas from './WeakestAreas.svelte';
77
import ResumeStats from './ResumeStats.svelte';
8+
import ShareBadge from './ShareBadge.svelte';
89
import type { Suggestion, StructuredSuggestion } from '$engine/scorer/types';
910
1011
// derived stats for the summary card header
@@ -14,6 +15,7 @@
1415
1516
// toggle between grid cards and detailed breakdown view
1617
let activeView = $state<'cards' | 'detailed'>('cards');
18+
let showShareBadge = $state(false);
1719
1820
// collapsible suggestion cards
1921
let expandedSuggestion = $state<number | null>(null);
@@ -49,25 +51,6 @@
4951
return suggestions.slice(0, 5);
5052
});
5153
52-
// exports results as a JSON file download
53-
function exportResults() {
54-
const data = {
55-
exportedAt: new Date().toISOString(),
56-
mode: scoresStore.mode,
57-
averageScore: avgScore,
58-
passingCount: passCount,
59-
totalSystems: totalCount,
60-
results: scoresStore.results
61-
};
62-
const blob = new Blob([JSON.stringify(data, null, 2)], { type: 'application/json' });
63-
const url = URL.createObjectURL(blob);
64-
const a = document.createElement('a');
65-
a.href = url;
66-
a.download = `ats-scores-${new Date().toISOString().slice(0, 10)}.json`;
67-
a.click();
68-
URL.revokeObjectURL(url);
69-
}
70-
7154
// color based on average score
7255
function getAvgColor(score: number): string {
7356
if (score >= 80) return '#22c55e';
@@ -281,21 +264,25 @@
281264
</button>
282265
</div>
283266

284-
<button class="export-btn" onclick={exportResults} title="Export results as JSON">
285-
<svg
286-
width="16"
287-
height="16"
288-
viewBox="0 0 24 24"
289-
fill="none"
290-
stroke="currentColor"
291-
stroke-width="2"
292-
>
293-
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
294-
<polyline points="7,10 12,15 17,10" />
295-
<line x1="12" y1="15" x2="12" y2="3" />
296-
</svg>
297-
Export
298-
</button>
267+
<div class="toolbar-actions">
268+
<button class="toolbar-btn" onclick={() => (showShareBadge = true)} title="Share score badge">
269+
<svg
270+
width="16"
271+
height="16"
272+
viewBox="0 0 24 24"
273+
fill="none"
274+
stroke="currentColor"
275+
stroke-width="2"
276+
>
277+
<circle cx="18" cy="5" r="3" />
278+
<circle cx="6" cy="12" r="3" />
279+
<circle cx="18" cy="19" r="3" />
280+
<line x1="8.59" y1="13.51" x2="15.42" y2="17.49" />
281+
<line x1="15.41" y1="6.51" x2="8.59" y2="10.49" />
282+
</svg>
283+
Share
284+
</button>
285+
</div>
299286
</div>
300287

301288
<!-- card view: 6 ATS score cards in a grid -->
@@ -423,6 +410,8 @@
423410
</div>
424411
{/if}
425412

413+
<ShareBadge bind:open={showShareBadge} />
414+
426415
<style>
427416
.dashboard {
428417
margin-top: 2rem;
@@ -669,7 +658,12 @@
669658
gap: 1rem;
670659
}
671660
672-
.export-btn {
661+
.toolbar-actions {
662+
display: flex;
663+
gap: 0.5rem;
664+
}
665+
666+
.toolbar-btn {
673667
display: inline-flex;
674668
align-items: center;
675669
gap: 0.4rem;
@@ -688,7 +682,7 @@
688682
background 0.2s ease;
689683
}
690684
691-
.export-btn:hover {
685+
.toolbar-btn:hover {
692686
border-color: rgba(6, 182, 212, 0.3);
693687
color: var(--accent-cyan);
694688
background: rgba(6, 182, 212, 0.05);

0 commit comments

Comments
 (0)