Skip to content

Commit 607e343

Browse files
committed
Add source links to showcases with GitHub logo
1 parent 571fbb3 commit 607e343

2 files changed

Lines changed: 49 additions & 29 deletions

File tree

src/lib/components/Showcase.svelte

Lines changed: 42 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
description: string;
55
url: string;
66
screenshot: string;
7+
source?: string;
78
}
89
9-
let { title, description, url, screenshot }: Props = $props();
10+
let { title, description, url, screenshot, source }: Props = $props();
1011
</script>
1112

12-
<div class="overflow-hidden rounded-xl border border-slate-100 bg-white shadow-[0_5px_20px_#0001]">
13+
<div class="overflow-hidden flex flex-col rounded-xl border border-slate-100 bg-white shadow-[0_5px_20px_#0001]">
1314
<div class="relative flex h-10 items-center justify-between border-b border-slate-100 px-4">
1415
<div class="flex items-center space-x-2">
1516
<div class="h-3 w-3 rounded-full bg-slate-200"></div>
@@ -30,29 +31,44 @@
3031
<img src={screenshot} alt={title} class="h-full w-full object-cover object-top" />
3132
</div>
3233

33-
<div class="border-t border-slate-100 p-4">
34-
<p class="mb-3 text-sm text-slate-600">{description}</p>
35-
<a
36-
href={url}
37-
target="_blank"
38-
rel="noopener noreferrer"
39-
class="inline-flex items-center gap-2 text-sm font-medium text-blue-500 transition-colors hover:text-blue-600"
40-
>
41-
View Live
42-
<svg
43-
xmlns="http://www.w3.org/2000/svg"
44-
fill="none"
45-
viewBox="0 0 24 24"
46-
stroke-width="1.5"
47-
stroke="currentColor"
48-
class="h-4 w-4"
49-
>
50-
<path
51-
stroke-linecap="round"
52-
stroke-linejoin="round"
53-
d="M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"
54-
/>
55-
</svg>
56-
</a>
34+
<div class="border-t border-slate-100 p-4 flex-1">
35+
<div class=" justify-between flex flex-col h-full">
36+
<p class="mb-3 text-sm text-slate-600">{description}</p>
37+
<div class="flex items-center justify-between">
38+
<a
39+
href={url}
40+
target="_blank"
41+
rel="noopener noreferrer"
42+
class="inline-flex items-center gap-2 text-sm font-medium text-blue-500 transition-colors hover:text-blue-600"
43+
>
44+
View Live
45+
<svg
46+
xmlns="http://www.w3.org/2000/svg"
47+
fill="none"
48+
viewBox="0 0 24 24"
49+
stroke-width="1.5"
50+
stroke="currentColor"
51+
class="h-4 w-4"
52+
>
53+
<path
54+
stroke-linecap="round"
55+
stroke-linejoin="round"
56+
d="M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"
57+
/>
58+
</svg>
59+
</a>
60+
{#if source}
61+
<a
62+
href={source}
63+
target="_blank"
64+
rel="noopener noreferrer"
65+
class="inline-flex items-center gap-2 text-sm font-medium text-slate-500 transition-colors hover:text-slate-700"
66+
>
67+
Source
68+
<img src="/github.svg" alt="github" class="h-4 w-4" />
69+
</a>
70+
{/if}
71+
</div>
72+
</div>
5773
</div>
5874
</div>

src/routes/+page.svelte

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@
1414
title: 'time.workers.rocks',
1515
description: 'Application with SSR-rendered clocks. Clock hands are positioned at load time.',
1616
url: 'https://time.workers.rocks',
17-
screenshot: 'https://cdn.optimage.cloud/jSskR2oYmZSZ/512/time.webp'
17+
screenshot: 'https://cdn.optimage.cloud/jSskR2oYmZSZ/512/time.webp',
18+
source: 'https://github.com/max-lt/world-time-app'
1819
},
1920
{
2021
title: 'httpbin.workers.rocks',
2122
description: 'A replica of the famous httpbin tool for testing HTTP requests.',
2223
url: 'https://httpbin.workers.rocks',
23-
screenshot: 'https://cdn.optimage.cloud/jSskR2oYmZSZ/512/httpbin.webp'
24+
screenshot: 'https://cdn.optimage.cloud/jSskR2oYmZSZ/512/httpbin.webp',
25+
source: 'https://github.com/max-lt/httpbin'
2426
},
2527
{
2628
title: 'qr-code.workers.rocks',
@@ -38,7 +40,8 @@
3840
title: 'rock-paper-scissors.workers.rocks',
3941
description: 'Provably fair Rock Paper Scissors game',
4042
url: 'https://rock-paper-scissors.workers.rocks',
41-
screenshot: 'https://cdn.optimage.cloud/jSskR2oYmZSZ/512/rock-paper-scissors.webp'
43+
screenshot: 'https://cdn.optimage.cloud/jSskR2oYmZSZ/512/rock-paper-scissors.webp',
44+
source: 'https://github.com/max-lt/rock-paper-scissors'
4245
},
4346
{
4447
title: 'ip-info.workers.rocks',
@@ -149,6 +152,7 @@
149152
description={showcase.description}
150153
url={showcase.url}
151154
screenshot={showcase.screenshot}
155+
source={showcase.source}
152156
/>
153157
{/each}
154158
</div>

0 commit comments

Comments
 (0)