Skip to content

Commit a45fc95

Browse files
authored
chore: improve sponsor list responsive (#1485)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Sponsor display component migrated from table-based to CSS grid layout for improved responsive design. * Sponsor sizing calculation updated to support dynamic column counts per tier. * **Documentation** * Sponsor showcase visuals enhanced across package READMEs with larger avatar images and refreshed entries. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 8812be1 commit a45fc95

50 files changed

Lines changed: 1807 additions & 1874 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

β€ŽREADME.mdβ€Ž

Lines changed: 36 additions & 38 deletions

β€Žapps/content/.vitepress/theme/components/FullSponsors.vueβ€Ž

Lines changed: 74 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ const tierGroups = computed(() => {
2828
return tierLevels.map((level) => {
2929
const tierSponsors = grouped.get(level)!
3030
const rank = tierLevels.indexOf(level)
31-
const sizes = [220, 170, 120, 88, 76, 54]
32-
const imageSize = sizes[Math.min(rank, sizes.length - 1)] ?? 100
31+
const columns = [3, 4, 5, 6, 7, 8]
32+
const cols = columns[Math.min(rank, columns.length - 1)] ?? 6
3333
3434
return {
3535
level,
3636
title: tierSponsors[0]?.tierTitle ?? `Tier ${level}`,
3737
sponsors: tierSponsors,
38-
imageSize,
38+
cols,
3939
}
4040
})
4141
})
@@ -55,57 +55,52 @@ const tierGroups = computed(() => {
5555
<h3 class="tier-title">
5656
{{ tier.title }}
5757
</h3>
58-
<table class="tier-table">
59-
<tr v-for="(row, rowIndex) in Math.ceil(tier.sponsors.length / 6)" :key="rowIndex">
60-
<td
61-
v-for="sponsor in tier.sponsors.slice(rowIndex * 6, rowIndex * 6 + 6)"
62-
:key="sponsor.login"
63-
align="center"
58+
<div class="tier-grid" :style="{ '--cols': tier.cols }">
59+
<div
60+
v-for="sponsor in tier.sponsors"
61+
:key="sponsor.login"
62+
class="tier-grid-item"
63+
>
64+
<a
65+
:href="sponsor.link"
66+
target="_blank"
67+
rel="noopener"
68+
:title="sponsor.name || sponsor.login"
69+
class="sponsor-link"
6470
>
65-
<a
66-
:href="sponsor.link"
67-
target="_blank"
68-
rel="noopener"
69-
:title="sponsor.name || sponsor.login"
70-
class="sponsor-link"
71+
<img
72+
:src="sponsor.avatar"
73+
:alt="sponsor.name || sponsor.login"
74+
loading="lazy"
7175
>
72-
<img
73-
:src="sponsor.avatar"
74-
:alt="sponsor.name || sponsor.login"
75-
:width="tier.imageSize"
76-
loading="lazy"
77-
>
78-
<br>
79-
<span class="sponsor-name">{{ sponsor.name || sponsor.login }}</span>
80-
</a>
81-
</td>
82-
</tr>
83-
</table>
76+
<span class="sponsor-name">{{ sponsor.name || sponsor.login }}</span>
77+
</a>
78+
</div>
79+
</div>
8480
</div>
8581

8682
<div v-if="pastSponsors.length > 0" class="tier-section">
8783
<h3 class="tier-title">
8884
Past Sponsors
8985
</h3>
90-
<p class="past-sponsors">
86+
<div class="past-sponsors">
9187
<a
9288
v-for="sponsor in pastSponsors"
9389
:key="sponsor.login"
9490
:href="sponsor.link"
9591
target="_blank"
9692
rel="noopener"
9793
:title="sponsor.name || sponsor.login"
94+
class="past-sponsor-link"
9895
>
9996
<img
10097
:src="sponsor.avatar"
10198
:alt="sponsor.name || sponsor.login"
102-
width="32"
103-
height="32"
10499
class="past-sponsor-avatar"
105100
loading="lazy"
106101
>
107102
</a>
108-
</p>
103+
</div>
109104
</div>
110105
</div>
111106
</template>
@@ -151,20 +146,41 @@ const tierGroups = computed(() => {
151146
.tier-title {
152147
font-size: 18px;
153148
font-weight: 600;
149+
margin-top: 16px;
154150
margin-bottom: 8px;
155151
color: var(--vp-c-text-1);
156152
}
157153
158-
.tier-table {
159-
border-collapse: collapse;
160-
margin-left: auto;
161-
margin-right: auto;
154+
.tier-grid {
155+
display: grid;
156+
grid-template-columns: repeat(min(var(--cols, 6), 2), 1fr);
162157
}
163158
164-
.tier-table td {
159+
.tier-grid-item {
160+
display: flex;
161+
justify-content: center;
162+
align-items: start;
165163
padding: 12px;
166-
vertical-align: top;
167164
text-align: center;
165+
border: 1px solid var(--vp-c-divider);
166+
margin: -1px 0 0 -1px;
167+
}
168+
169+
.tier-grid-item img {
170+
width: 100%;
171+
height: auto;
172+
}
173+
174+
@media (min-width: 640px) {
175+
.tier-grid {
176+
grid-template-columns: repeat(min(var(--cols, 6), 3), 1fr);
177+
}
178+
}
179+
180+
@media (min-width: 768px) {
181+
.tier-grid {
182+
grid-template-columns: repeat(var(--cols, 6), 1fr);
183+
}
168184
}
169185
170186
.sponsor-link {
@@ -184,17 +200,34 @@ const tierGroups = computed(() => {
184200
}
185201
186202
.past-sponsors {
187-
display: flex;
188-
flex-wrap: wrap;
203+
display: grid;
204+
grid-template-columns: repeat(8, 1fr);
189205
gap: 8px;
190206
}
191207
192-
.past-sponsor-avatar {
208+
.past-sponsor-link {
193209
opacity: 0.7;
194210
transition: opacity 0.2s;
195211
}
196212
197-
.past-sponsor-avatar:hover {
213+
.past-sponsor-link:hover {
198214
opacity: 1;
199215
}
216+
217+
.past-sponsor-avatar {
218+
width: 100%;
219+
height: auto;
220+
}
221+
222+
@media (min-width: 640px) {
223+
.past-sponsors {
224+
grid-template-columns: repeat(12, 1fr);
225+
}
226+
}
227+
228+
@media (min-width: 768px) {
229+
.past-sponsors {
230+
grid-template-columns: repeat(18, 1fr);
231+
}
232+
}
200233
</style>

β€Žpackages/ai-sdk/README.mdβ€Ž

Lines changed: 36 additions & 38 deletions

β€Žpackages/arktype/README.mdβ€Ž

Lines changed: 36 additions & 38 deletions

β€Žpackages/client/README.mdβ€Ž

Lines changed: 36 additions & 38 deletions

β€Žpackages/contract/README.mdβ€Ž

Lines changed: 36 additions & 38 deletions

β€Žpackages/durable-iterator/README.mdβ€Ž

Lines changed: 36 additions & 38 deletions

β€Žpackages/hey-api/README.mdβ€Ž

Lines changed: 36 additions & 38 deletions

β€Žpackages/interop/README.mdβ€Ž

Lines changed: 36 additions & 38 deletions

β€Žpackages/json-schema/README.mdβ€Ž

Lines changed: 36 additions & 38 deletions

0 commit comments

Comments
Β (0)