|
| 1 | +<script setup lang="ts"> |
| 2 | +import { sponsors as staticSponsors } from '../../../sponsors/data'; |
| 3 | +import { VPButton } from 'vitepress/theme'; |
| 4 | +
|
| 5 | +type Sponsor = { name: string; url: string; logo: string | null }; |
| 6 | +const sponsors: Record<'platinum' | 'gold' | 'silver' | 'bronze', Sponsor[]> = staticSponsors; |
| 7 | +
|
| 8 | +const titleMap: Record<string, string> = { |
| 9 | + platinum: 'Platinum', |
| 10 | + gold: 'Gold', |
| 11 | + silver: 'Silver', |
| 12 | + bronze: 'Bronze', |
| 13 | +}; |
| 14 | +</script> |
| 15 | + |
| 16 | +<template> |
| 17 | + <section id="sponsors" class="sponsors"> |
| 18 | + <h2 class="sponsors__title">Sponsors</h2> |
| 19 | + <p class="sponsors__tagline">Seed4J is planted 🌱 by the community, grown with the support of amazing sponsors.</p> |
| 20 | + |
| 21 | + <div v-for="(list, tier) in sponsors" :key="tier" class="sponsors__tier" :class="tier"> |
| 22 | + <template v-if="Array.isArray(list) && list.length"> |
| 23 | + <h3 class="sponsors__tier-title">{{ titleMap[tier] ?? tier }} sponsors</h3> |
| 24 | + <div class="sponsors__grid"> |
| 25 | + <a v-for="s in list" :key="s.name" :href="s.url" target="_blank" rel="noopener" class="sponsors__card" :class="tier"> |
| 26 | + <template v-if="s.logo"> |
| 27 | + <img :src="s.logo" :alt="s.name" /> |
| 28 | + </template> |
| 29 | + <template v-else> |
| 30 | + <div class="sponsors__name">{{ s.name }}</div> |
| 31 | + </template> |
| 32 | + </a> |
| 33 | + </div> |
| 34 | + </template> |
| 35 | + </div> |
| 36 | + |
| 37 | + <div class="sponsors__tier backers"> |
| 38 | + <h3 class="sponsors__tier-title">Backers</h3> |
| 39 | + <div class="sponsors__grid"> |
| 40 | + <a href="https://opencollective.com/seed4j/" target="_blank" rel="noopener"> |
| 41 | + <img src="https://opencollective.com/seed4j/tiers/backers.svg?button=false" alt="Backers" /> |
| 42 | + </a> |
| 43 | + </div> |
| 44 | + </div> |
| 45 | + |
| 46 | + <div class="sponsors__cta"> |
| 47 | + <VPButton theme="alt" text="💚 Sponsor Seed4J" href="https://opencollective.com/seed4j" rel="noopener" target="_blank" /> |
| 48 | + </div> |
| 49 | + </section> |
| 50 | +</template> |
| 51 | + |
| 52 | +<style scoped> |
| 53 | +.sponsors { |
| 54 | + margin-top: 2rem; |
| 55 | +} |
| 56 | +.sponsors__title { |
| 57 | + font-size: 1.8rem; |
| 58 | + margin-bottom: 0.25rem; |
| 59 | +} |
| 60 | +.sponsors__tagline { |
| 61 | + opacity: 0.8; |
| 62 | + margin-bottom: 1rem; |
| 63 | +} |
| 64 | +
|
| 65 | +.sponsors__tier { |
| 66 | + margin-top: 1.5rem; |
| 67 | +} |
| 68 | +.sponsors__tier-title { |
| 69 | + font-size: 1.2rem; |
| 70 | + margin: 0.5rem 0; |
| 71 | +} |
| 72 | +.sponsors__grid { |
| 73 | + display: grid; |
| 74 | + gap: 16px; |
| 75 | + grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); |
| 76 | + align-items: center; |
| 77 | +} |
| 78 | +
|
| 79 | +.sponsors__card img { |
| 80 | + max-width: 100%; |
| 81 | + width: auto; |
| 82 | + height: auto; |
| 83 | + object-fit: contain; |
| 84 | +} |
| 85 | +.sponsors__card.platinum img { |
| 86 | + max-height: 300px; |
| 87 | +} |
| 88 | +.sponsors__card.gold img { |
| 89 | + max-height: 150px; |
| 90 | +} |
| 91 | +.sponsors__card.silver img { |
| 92 | + max-height: 100px; |
| 93 | +} |
| 94 | +.sponsors__card.bronze img { |
| 95 | + max-height: 48px; |
| 96 | +} |
| 97 | +
|
| 98 | +.sponsors__card { |
| 99 | + background: var(--vp-c-bg-soft); |
| 100 | + border-radius: 12px; |
| 101 | + padding: 12px; |
| 102 | + display: flex; |
| 103 | + justify-content: center; |
| 104 | + align-items: center; |
| 105 | + transition: opacity 0.2s ease; |
| 106 | +} |
| 107 | +.sponsors__card:hover { |
| 108 | + opacity: 0.9; |
| 109 | +} |
| 110 | +
|
| 111 | +.sponsors__name { |
| 112 | + font-size: 1rem; |
| 113 | + font-weight: bold; |
| 114 | + text-align: center; |
| 115 | + padding: 12px; |
| 116 | + color: var(--vp-c-text); |
| 117 | +} |
| 118 | +
|
| 119 | +.sponsors__cta { |
| 120 | + margin-top: 1.5rem; |
| 121 | + display: flex; |
| 122 | + justify-content: center; |
| 123 | +} |
| 124 | +
|
| 125 | +.sponsors__cta :deep(a) { |
| 126 | + text-decoration: none !important; |
| 127 | +} |
| 128 | +</style> |
0 commit comments