Commit 70a1cc32a2
Unsigned
Layout: unified · split
docs/.vitepress/theme/components/HomeFeatures.vue +13 −3
| @@ -62,6 +62,16 @@ const grid = computed(() => { | ||
| 62 | 62 | return undefined |
| 63 | 63 | }) |
| 64 | 64 | |
| 65 | const panelGrid = computed(() => { | |
| 66 | if (columnMode.value === 'max') return 'grid-max' | |
| 67 | const n = props.cards.length | |
| 68 | if (n === 2) return 'grid-2' | |
| 69 | if (n === 3) return 'grid-3' | |
| 70 | if (n % 3 === 0) return 'grid-6' | |
| 71 | if (n > 3) return 'grid-4' | |
| 72 | return undefined | |
| 73 | }) | |
| 74 | ||
| 65 | 75 | const KNOWN_PREFIXES = /^(lucide|mdi|ic|mingcute|material-symbols|simple-icons|uil|octicon|logos|akar-icons|map|bi|streamline-logos|streamline-ultimate|streamline-sharp|iconoir)-/ |
| 66 | 76 | |
| 67 | 77 | function cardIcon(card: HomeCard) { |
| @@ -249,9 +259,9 @@ function onHandlePointerUp() { | ||
| 249 | 259 | <div class="card-sections"> |
| 250 | 260 | <!-- Homepage section (draggable) --> |
| 251 | 261 | <div class="section-label">Homepage</div> |
| 252 | <ul ref="cardListEl" class="card-list" :class="grid"> | |
| 262 | <ul ref="cardListEl" class="card-list" :class="panelGrid"> | |
| 253 | 263 | <li v-if="homepageSectionCards.length === 0" class="empty-box"> |
| 254 | <span class="empty-hint">No cards selected — add some from below</span> | |
| 264 | <span class="empty-hint">No cards have been selected</span> | |
| 255 | 265 | </li> |
| 256 | 266 | <li |
| 257 | 267 | v-for="card in homepageSectionCards" |
| @@ -289,7 +299,7 @@ function onHandlePointerUp() { | ||
| 289 | 299 | <!-- Other sections (Pages, Extensions, Other…) --> |
| 290 | 300 | <template v-for="section in otherSections" :key="section.label"> |
| 291 | 301 | <div class="section-label">{{ section.label }}</div> |
| 292 | <ul class="card-list" :class="grid"> | |
| 302 | <ul class="card-list" :class="panelGrid"> | |
| 293 | 303 | <li v-if="section.cards.length === 0" class="empty-box"> |
| 294 | 304 | <span class="empty-hint">All cards from this section have been selected</span> |
| 295 | 305 | </li> |