Skip to content

Commit fce2c0c

Browse files
committed
feat: スタッフをコンポーネントとして再定義
1 parent d03d21b commit fce2c0c

File tree

2 files changed

+49
-45
lines changed

2 files changed

+49
-45
lines changed

2025/src/components/Staff/StaffCard.astro

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
import GithubIcon from '@/assets/github-icon.png?url'
3-
import XIcon from '@/assets/x-icon.png?url'
4-
import BlueSkyIcon from '@/assets/bluesky.jpg?url'
2+
import GithubIcon from "@/assets/github-icon.png?url";
3+
import XIcon from "@/assets/x-icon.png?url";
4+
import BlueSkyIcon from "@/assets/bluesky.jpg?url";
55
type Props = {
66
name: string;
77
alsoKnownAs?: string;
@@ -30,58 +30,58 @@ const { name, alsoKnownAs, image, github, x, bluesky }: Props = Astro.props;
3030
/></span
3131
>
3232
</div>
33-
33+
3434
<div class="grid gap-0.5 text-center">
3535
<h3 class="text-sm font-semibold md:text-base">
3636
{name}
3737
</h3>
38-
39-
{alsoKnownAs &&
40-
<p class="text-xs text-gray-600">あるいは<b>{alsoKnownAs}</b></p>
38+
39+
{
40+
alsoKnownAs && (
41+
<p class="text-xs text-gray-600">
42+
あるいは<b>{alsoKnownAs}</b>
43+
</p>
44+
)
4145
}
4246
</div>
43-
44-
<div class="grid grid-flow-col auto-cols-max justify-center gap-2">
47+
48+
<div class="grid auto-cols-max grid-flow-col justify-center gap-2">
4549
<a
4650
href={github}
4751
target="_blank"
4852
rel="noopener noreferrer"
4953
class="grid place-items-center text-gray-600 transition-colors hover:text-emerald-600"
5054
>
51-
<img
52-
src={GithubIcon}
53-
alt="GitHub"
54-
class="h-4 w-4" />
55+
<img src={GithubIcon} alt="GitHub" class="h-4 w-4" />
5556
<span class="sr-only">GitHub</span>
5657
</a>
57-
58-
{x &&
59-
<a
60-
href={x}
61-
target="_blank"
62-
rel="noopener noreferrer"
63-
class="grid place-items-center text-gray-600 transition-colors hover:text-emerald-600"
64-
>
65-
<img
66-
src={XIcon}
67-
alt="X (Twitter)"
68-
class="h-4 w-4" />
69-
<span class="sr-only">X (Twitter)</span>
70-
</a>
58+
59+
{
60+
x && (
61+
<a
62+
href={x}
63+
target="_blank"
64+
rel="noopener noreferrer"
65+
class="grid place-items-center text-gray-600 transition-colors hover:text-emerald-600"
66+
>
67+
<img src={XIcon} alt="X (Twitter)" class="h-4 w-4" />
68+
<span class="sr-only">X (Twitter)</span>
69+
</a>
70+
)
7171
}
72-
73-
{bluesky &&
74-
<a
75-
href={bluesky}
76-
target="_blank"
77-
rel="noopener noreferrer"
78-
class="grid place-items-center text-gray-600 transition-colors hover:text-emerald-600">
79-
<img
80-
src={BlueSkyIcon}
81-
alt="Bluesky"
82-
class="h-4 w-4" />
83-
<span class="sr-only">Bluesky</span>
84-
</a>
72+
73+
{
74+
bluesky && (
75+
<a
76+
href={bluesky}
77+
target="_blank"
78+
rel="noopener noreferrer"
79+
class="grid place-items-center text-gray-600 transition-colors hover:text-emerald-600"
80+
>
81+
<img src={BlueSkyIcon} alt="Bluesky" class="h-4 w-4" />
82+
<span class="sr-only">Bluesky</span>
83+
</a>
84+
)
8585
}
8686
</div>
8787
</div>

2025/src/components/Staff/index.astro

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@
22
import StaffCard from "./StaffCard.astro";
33
---
44

5-
<section id="staff" class="bg-emerald-50 py-10 md:py-16">
5+
<section id="staff" class="bg-emerald-50 py-6 sm:py-8 md:py-12 lg:py-16">
66
<div class="container mx-auto px-4">
7-
<div class="mb-8 text-center">
8-
<h2 class="mb-3 text-2xl font-bold text-gray-900 md:text-3xl">
7+
<div class="mb-6 text-center sm:mb-8">
8+
<h2
9+
class="mb-2 text-xl font-bold text-gray-900 sm:mb-3 sm:text-2xl md:text-3xl"
10+
>
911
スタッフ
1012
</h2>
11-
<div class="mx-auto h-1 w-16 bg-emerald-500"></div>
13+
<div class="mx-auto h-1 w-12 bg-emerald-500 sm:w-16"></div>
1214
</div>
13-
<div class="grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-6">
15+
<div
16+
class="xs:grid-cols-2 grid grid-cols-1 gap-3 sm:grid-cols-3 sm:gap-4 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6"
17+
>
1418
<StaffCard
1519
name="Tatsuhiro Ujihisa"
1620
image="https://github.com/ujihisa.png"

0 commit comments

Comments
 (0)