|
| 1 | +<script setup lang="ts"> |
| 2 | +import { VPButton, VPHomeSponsors } from 'vitepress/theme'; |
| 3 | +import { onMounted, onUnmounted, ref } from 'vue'; |
| 4 | +import { sponsors } from '../../data/sponsors/sponsors'; |
| 5 | +
|
| 6 | +const backersImageWidth = ref(310); |
| 7 | +
|
| 8 | +const updateBackersWidth = () => { |
| 9 | + if (window.innerWidth >= 768) { |
| 10 | + backersImageWidth.value = 760; |
| 11 | + } else { |
| 12 | + backersImageWidth.value = 310; |
| 13 | + } |
| 14 | +}; |
| 15 | +
|
| 16 | +onMounted(() => { |
| 17 | + updateBackersWidth(); |
| 18 | + window.addEventListener('resize', updateBackersWidth); |
| 19 | +}); |
| 20 | +
|
| 21 | +onUnmounted(() => { |
| 22 | + window.removeEventListener('resize', updateBackersWidth); |
| 23 | +}); |
| 24 | +</script> |
| 25 | + |
| 26 | +<template> |
| 27 | + <div class="content"> |
| 28 | + <div class="content-container"> |
| 29 | + <main class="main"> |
| 30 | + <VPHomeSponsors |
| 31 | + v-if="sponsors" |
| 32 | + message="Seed4J is planted 🌱 by the community, grown with the support of amazing sponsors." |
| 33 | + :data="sponsors" |
| 34 | + /> |
| 35 | + <div class="vp-backer"> |
| 36 | + <div class="container"> |
| 37 | + <section class="vp-backer-section"> |
| 38 | + <h3 class="vp-backer-tier">Backers</h3> |
| 39 | + <div class="vp-backer-grid-item"> |
| 40 | + <object |
| 41 | + :data="`https://opencollective.com/seed4j/tiers/backers.svg?avatarHeight=40&width=${backersImageWidth}&button=false`" |
| 42 | + type="image/svg+xml" |
| 43 | + class="backers-svg" |
| 44 | + aria-label="Backers" |
| 45 | + > |
| 46 | + Backers |
| 47 | + </object> |
| 48 | + </div> |
| 49 | + </section> |
| 50 | + </div> |
| 51 | + </div> |
| 52 | + <div class="action"> |
| 53 | + <VPButton theme="sponsor" :text="`💚 Sponsor Seed4J`" :href="`https://opencollective.com/seed4j`" /> |
| 54 | + </div> |
| 55 | + </main> |
| 56 | + </div> |
| 57 | + </div> |
| 58 | +</template> |
| 59 | + |
| 60 | +<style scoped> |
| 61 | +.VPHomeSponsors { |
| 62 | + margin: 96px 0 0 0; |
| 63 | +} |
| 64 | +
|
| 65 | +:deep(.vp-sponsor) { |
| 66 | + border-radius: 16px 16px 0 0 !important; |
| 67 | +} |
| 68 | +
|
| 69 | +:deep(.vp-sponsor-grid-image) { |
| 70 | + max-width: 100%; |
| 71 | + filter: none !important; |
| 72 | + transition: filter 0.25s; |
| 73 | + border-radius: 50%; |
| 74 | +} |
| 75 | +
|
| 76 | +:deep(.dark .vp-sponsor-grid-image) { |
| 77 | + filter: none !important; |
| 78 | +} |
| 79 | +
|
| 80 | +:deep(.dark .vp-sponsor-grid-item:hover) { |
| 81 | + background-color: var(--vp-c-bg-soft) !important; |
| 82 | +} |
| 83 | +
|
| 84 | +
|
| 85 | +:deep(.vp-sponsor-grid.xmini .vp-sponsor-grid-image) { |
| 86 | + max-width: 64px; |
| 87 | + max-height: 35px !important; |
| 88 | +} |
| 89 | +
|
| 90 | +:deep(.vp-sponsor-grid.mini .vp-sponsor-grid-image) { |
| 91 | + max-width: 96px; |
| 92 | + max-height: 40px !important; |
| 93 | +} |
| 94 | +
|
| 95 | +:deep(.vp-sponsor-grid.small .vp-sponsor-grid-image) { |
| 96 | + max-width: 96px; |
| 97 | + max-height: 45px !important; |
| 98 | +} |
| 99 | +
|
| 100 | +:deep(.vp-sponsor-grid.medium .vp-sponsor-grid-image) { |
| 101 | + max-width: 120px; |
| 102 | + max-height: 50px !important; |
| 103 | +} |
| 104 | +
|
| 105 | +:deep(.vp-sponsor-grid.big .vp-sponsor-grid-image) { |
| 106 | + max-width: 192px; |
| 107 | + max-height: 60px !important; |
| 108 | +} |
| 109 | +
|
| 110 | +.vp-backer { |
| 111 | + padding: 0 24px; |
| 112 | +} |
| 113 | +
|
| 114 | +@media (min-width: 768px) { |
| 115 | + .vp-backer { |
| 116 | + padding: 0 48px; |
| 117 | + } |
| 118 | +} |
| 119 | +
|
| 120 | +@media (min-width: 960px) { |
| 121 | + .vp-backer { |
| 122 | + padding: 0 64px; |
| 123 | + } |
| 124 | +} |
| 125 | +
|
| 126 | +.container { |
| 127 | + margin: 0 auto; |
| 128 | + max-width: 1152px; |
| 129 | +} |
| 130 | +
|
| 131 | +.vp-backer-section { |
| 132 | + padding: 4px 0 0 0; |
| 133 | + border-radius: 0 0 16px 16px; |
| 134 | + overflow: hidden; |
| 135 | +} |
| 136 | +
|
| 137 | +.vp-backer-tier { |
| 138 | + padding: 13px 0 11px; |
| 139 | + font-size: 14px; |
| 140 | + margin: 0 0 4px !important; |
| 141 | + text-align: center; |
| 142 | + letter-spacing: 1px !important; |
| 143 | + line-height: 24px; |
| 144 | + width: 100%; |
| 145 | + font-weight: 600; |
| 146 | + color: var(--vp-c-text-2); |
| 147 | + background-color: var(--vp-c-bg-soft); |
| 148 | +} |
| 149 | +
|
| 150 | +.vp-backer-grid-item { |
| 151 | + padding: 10px; |
| 152 | + background-color: var(--vp-c-bg-soft); |
| 153 | + transition: background-color 0.25s; |
| 154 | +} |
| 155 | +
|
| 156 | +.backers-svg { |
| 157 | + background-color: var(--vp-c-bg-soft); |
| 158 | +} |
| 159 | +
|
| 160 | +.action { |
| 161 | + display: flex; |
| 162 | + justify-content: center; |
| 163 | + gap: 1rem; |
| 164 | + margin-top: 30px; |
| 165 | +} |
| 166 | +</style> |
0 commit comments