11<script setup lang="ts">
2- const socialLinks = {
3- github: ' https://repo.npmx.dev' ,
4- discord: ' https://chat.npmx.dev' ,
5- bluesky: ' https://social.npmx.dev' ,
6- }
2+ const socialLinks = computed (() => [
3+ {
4+ id: ' github' ,
5+ href: ' https://repo.npmx.dev' ,
6+ icon: ' i-carbon:logo-github' ,
7+ titleKey: $t (' about.get_involved.contribute.title' ),
8+ descriptionKey: $t (' about.get_involved.contribute.description' ),
9+ ctaKey: $t (' about.get_involved.contribute.cta' ),
10+ },
11+ {
12+ id: ' discord' ,
13+ href: ' https://chat.npmx.dev' ,
14+ icon: ' i-carbon:chat' ,
15+ titleKey: $t (' about.get_involved.community.title' ),
16+ descriptionKey: $t (' about.get_involved.community.description' ),
17+ ctaKey: $t (' about.get_involved.community.cta' ),
18+ },
19+ {
20+ id: ' bluesky' ,
21+ href: ' https://social.npmx.dev' ,
22+ icon: ' i-simple-icons:bluesky' ,
23+ titleKey: $t (' about.get_involved.follow.title' ),
24+ descriptionKey: $t (' about.get_involved.follow.description' ),
25+ ctaKey: $t (' about.get_involved.follow.cta' ),
26+ },
27+ ])
728 </script >
829
930<template >
@@ -13,74 +34,31 @@ const socialLinks = {
1334 </h2 >
1435
1536 <div class =" grid gap-4 sm:grid-cols-3 sm:items-stretch sm:grid-rows-[auto,1fr,auto]" >
16- <a
17- :href =" socialLinks.github"
18- target =" _blank"
19- rel =" noopener noreferrer"
20- class =" group grid gap-3 p-4 rounded-lg bg-bg-subtle hover:bg-bg-elevated border border-border hover:border-border-hover transition-all duration-200 sm:grid-rows-subgrid sm:row-span-3"
37+ <div
38+ v-for =" link in socialLinks"
39+ :key =" link.id"
40+ class =" group relative grid gap-3 p-4 rounded-lg bg-bg-subtle hover:bg-bg-elevated border border-border hover:border-border-hover transition-all duration-200 sm:grid-rows-subgrid sm:row-span-3 focus-within:ring-2 focus-within:ring-accent/50"
2141 >
22- <div class =" flex gap-2" >
23- <span class =" i-carbon:logo-github shrink-0 mt-1 w-5 h-5 text-fg" aria-hidden =" true" />
42+ <h3 class =" z-1 flex gap-2" >
43+ <span : class =" link.icon " class = " shrink-0 mt-1 w-5 h-5 text-fg" aria-hidden =" true" />
2444 <span class =" font-medium text-fg" >
25- {{ $t('about.get_involved.contribute.title') }}
45+ {{ link.titleKey }}
2646 </span >
27- </div >
28- <p class =" text-sm text-fg-muted leading-relaxed" >
29- {{ $t('about.get_involved.contribute.description') }}
47+ </h3 >
48+ <p class =" z-1 text-sm text-fg-muted leading-relaxed" >
49+ {{ link.descriptionKey }}
3050 </p >
31- <span
32- class =" text-sm text-fg-muted group-hover:text-fg inline-flex items-center gap-1 mt-auto"
51+ <a
52+ :href =" link.href"
53+ target =" _blank"
54+ rel =" noopener noreferrer"
55+ class =" text-sm text-fg-muted group-hover:text-fg inline-flex items-center gap-1 mt-auto focus-visible:outline-none"
3356 >
34- {{ $t('about.get_involved.contribute.cta') }}
57+ {{ link.ctaKey }}
3558 <span class =" i-carbon:arrow-right rtl-flip w-3 h-3" aria-hidden =" true" />
36- </span >
37- </a >
38-
39- <a
40- :href =" socialLinks.discord"
41- target =" _blank"
42- rel =" noopener noreferrer"
43- class =" group grid gap-3 p-4 rounded-lg bg-bg-subtle hover:bg-bg-elevated border border-border hover:border-border-hover transition-all duration-200 sm:grid-rows-subgrid sm:row-span-3"
44- >
45- <div class =" flex gap-2" >
46- <span class =" i-carbon:chat shrink-0 mt-1 w-5 h-5 text-fg" aria-hidden =" true" />
47- <span class =" font-medium text-fg" >
48- {{ $t('about.get_involved.community.title') }}
49- </span >
50- </div >
51- <p class =" text-sm text-fg-muted leading-relaxed" >
52- {{ $t('about.get_involved.community.description') }}
53- </p >
54- <span
55- class =" text-sm text-fg-muted group-hover:text-fg inline-flex items-center gap-1 mt-auto"
56- >
57- {{ $t('about.get_involved.community.cta') }}
58- <span class =" i-carbon:arrow-right rtl-flip w-3 h-3" aria-hidden =" true" />
59- </span >
60- </a >
61-
62- <a
63- :href =" socialLinks.bluesky"
64- target =" _blank"
65- rel =" noopener noreferrer"
66- class =" group grid gap-3 p-4 rounded-lg bg-bg-subtle hover:bg-bg-elevated border border-border hover:border-border-hover transition-all duration-200 sm:grid-rows-subgrid sm:row-span-3"
67- >
68- <div class =" flex gap-2" >
69- <span class =" i-simple-icons:bluesky shrink-0 mt-1 w-5 h-5 text-fg" aria-hidden =" true" />
70- <span class =" font-medium text-fg" >
71- {{ $t('about.get_involved.follow.title') }}
72- </span >
73- </div >
74- <p class =" text-sm text-fg-muted leading-relaxed" >
75- {{ $t('about.get_involved.follow.description') }}
76- </p >
77- <span
78- class =" text-sm text-fg-muted group-hover:text-fg inline-flex items-center gap-1 mt-auto"
79- >
80- {{ $t('about.get_involved.follow.cta') }}
81- <span class =" i-carbon:arrow-right rtl-flip w-3 h-3" aria-hidden =" true" />
82- </span >
83- </a >
59+ <span class =" absolute z-0 inset-0" aria-hidden =" true" />
60+ </a >
61+ </div >
8462 </div >
8563 </div >
8664</template >
0 commit comments