Skip to content

Commit 0ba0c2c

Browse files
authored
Merge pull request #217 from vim-jp/feature/2025/improve-companies-sponsors-view
スポンサーロゴのガタつきを抑制
2 parents f5df944 + c4632d6 commit 0ba0c2c

File tree

2 files changed

+40
-28
lines changed

2 files changed

+40
-28
lines changed

2025/src/components/Sponsors/Companies.astro

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -77,22 +77,26 @@ const getGridClasses = (rank: string, count: number) => {
7777
---
7878

7979
<Heading>企業スポンサー</Heading>
80-
{
81-
rankOrder.map(
82-
(rank) =>
83-
sponsorsByRank[rank] && (
84-
<>
85-
<h4 class="mb-6 text-center text-2xl font-bold text-gray-800">
86-
{rankNameMap[rank]}
87-
</h4>
88-
<div
89-
class={getGridClasses(rank, sponsorsByRank[rank].length).join(" ")}
90-
>
91-
{sponsorsByRank[rank].sort().map((sponsor) => (
92-
<Company {sponsor} />
93-
))}
94-
</div>
95-
</>
96-
),
97-
)
98-
}
80+
<div class="container mx-auto px-4">
81+
{
82+
rankOrder.map(
83+
(rank) =>
84+
sponsorsByRank[rank] && (
85+
<>
86+
<h4 class="mb-6 text-center text-2xl font-bold text-gray-800">
87+
{rankNameMap[rank]}
88+
</h4>
89+
<div
90+
class={getGridClasses(rank, sponsorsByRank[rank].length).join(
91+
" ",
92+
)}
93+
>
94+
{sponsorsByRank[rank].sort().map((sponsor) => (
95+
<Company {sponsor} />
96+
))}
97+
</div>
98+
</>
99+
),
100+
)
101+
}
102+
</div>

2025/src/components/Sponsors/Company.astro

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,29 +31,37 @@ if (images[imagePath]) {
3131
// ランクごとのスタイル設定
3232
const rankStyles = {
3333
platinum: {
34-
container: "mb-4 flex items-center justify-center",
35-
image: "h-28 w-auto object-contain md:h-36 lg:h-40",
34+
container:
35+
"h-72 mb-4 flex items-center justify-center bg-white p-6 rounded-lg border border-gray-100",
36+
image: "w-full h-full object-contain",
3637
},
3738
gold: {
38-
container: "mb-3 flex items-center justify-center",
39-
image: "h-20 w-auto object-contain md:h-24 lg:h-28",
39+
container:
40+
"h-52 mb-3 flex items-center justify-center bg-white p-6 rounded-lg border border-gray-100",
41+
image: "w-full h-full object-contain",
4042
},
4143
silver: {
42-
container: "mb-2 flex items-center justify-center",
43-
image: "h-14 w-auto object-contain md:h-16 lg:h-20",
44+
container:
45+
"h-32 mb-2 flex items-center justify-center bg-white p-6 rounded-lg border border-gray-100",
46+
image: "w-full h-full object-contain",
4447
},
4548
bronze: {
46-
container: "mb-2 flex items-center justify-center",
47-
image: "h-12 w-auto object-contain md:h-14 lg:h-16",
49+
container:
50+
"h-22 mb-2 flex items-center justify-center bg-white p-6 rounded-lg border border-gray-100",
51+
image: "w-full h-full object-contain",
4852
},
4953
};
5054
5155
const currentStyle = rankStyles[rank];
56+
57+
if (name === "NodeX 株式会社") {
58+
currentStyle.container = currentStyle.container.replace("p-6", "p-1");
59+
}
5260
---
5361

5462
<a
5563
href={url}
56-
class="relative block w-full max-w-xs"
64+
class="relative block w-full"
5765
target="_blank"
5866
rel="noopener noreferrer"
5967
>

0 commit comments

Comments
 (0)