|
| 1 | +--- |
| 2 | +title: Thank You |
| 3 | +layout: page |
| 4 | +--- |
| 5 | + |
| 6 | +<script setup> |
| 7 | +import { VPTeamPage, VPTeamPageTitle, VPTeamMembers, VPTeamPageSection } from "vitepress/theme"; |
| 8 | + |
| 9 | +import { data } from "../data/contributors.data.ts"; |
| 10 | +import sponsors from "../public/api/sponsors.json"; |
| 11 | + |
| 12 | +function toDollars(amount, divideBy = 100.0) { |
| 13 | + return `$${(amount / divideBy).toFixed(2)}`; |
| 14 | +} |
| 15 | + |
| 16 | +const github = { |
| 17 | + svg: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-brand-github"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 19c-4.3 1.4 -4.3 -2.5 -6 -3m12 5v-3.5c0 -1 .1 -1.4 -.5 -2c2.8 -.3 5.5 -1.4 5.5 -6a4.6 4.6 0 0 0 -1.3 -3.2a4.2 4.2 0 0 0 -.1 -3.2s-1.1 -.3 -3.5 1.3a12.3 12.3 0 0 0 -6.2 0c-2.4 -1.6 -3.5 -1.3 -3.5 -1.3a4.2 4.2 0 0 0 -.1 3.2a4.6 4.6 0 0 0 -1.3 3.2c0 4.6 2.7 5.7 5.5 6c-.6 .6 -.6 1.2 -.5 2v3.5" /></svg>` |
| 18 | +} |
| 19 | + |
| 20 | +const commit = { |
| 21 | + svg: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-git-commit"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" /><path d="M12 3l0 6" /><path d="M12 15l0 6" /></svg>` |
| 22 | +} |
| 23 | + |
| 24 | +const _sponsors = sponsors |
| 25 | + .map((spon) => { |
| 26 | + return { |
| 27 | + avatar: spon.avatarUrl, |
| 28 | + name: spon.login, |
| 29 | + title: `${toDollars(spon.amount)} in total`, |
| 30 | + links: [ |
| 31 | + { |
| 32 | + icon: github, |
| 33 | + link: spon.url, |
| 34 | + }, |
| 35 | + ], |
| 36 | + }; |
| 37 | + }) |
| 38 | + .sort((a, b) => b.amount - a.amount); |
| 39 | + |
| 40 | +const totalSponsored = sponsors.reduce((acc, current) => acc + current.amount, 0); |
| 41 | + |
| 42 | +const excludedContris = ["DerGoogler", "dependabot[bot]"] |
| 43 | + |
| 44 | +const contributorsExluded = data |
| 45 | + .filter((con) => !excludedContris.includes(con.login)) |
| 46 | + |
| 47 | + const contributors = contributorsExluded.map((contri) => ({ |
| 48 | + avatar: contri.avatar_url, |
| 49 | + name: contri.login, |
| 50 | + title: `${contri.contributions} contribution/s`, |
| 51 | + links: [ |
| 52 | + { |
| 53 | + icon: github, |
| 54 | + link: contri.html_url, |
| 55 | + }, |
| 56 | + { |
| 57 | + icon: commit, |
| 58 | + link: `https://github.com/MMRLApp/MMRL/commits?author=${contri.login}`, |
| 59 | + }, |
| 60 | + ], |
| 61 | + })) |
| 62 | + .sort((a, b) => b.contributions - a.contributions); |
| 63 | + |
| 64 | + |
| 65 | +const totalContributions = contributorsExluded.reduce((acc, current) => acc + current.contributions, 0); |
| 66 | + |
| 67 | +</script> |
| 68 | + |
| 69 | +<VPTeamPage> |
| 70 | + <VPTeamPageTitle> |
| 71 | + <template #title>Sponsors</template> |
| 72 | + <template #lead><u>{{ toDollars(totalSponsored) }}</u> have been total sponsored</template> |
| 73 | + </VPTeamPageTitle> |
| 74 | + <VPTeamMembers size="medium" :members="_sponsors" /> |
| 75 | + <VPTeamPageSection> |
| 76 | + <template #title>Contributors</template> |
| 77 | + <template #lead><u>{{ totalContributions }}</u> total community contributions</template> |
| 78 | + <template #members> |
| 79 | + <VPTeamMembers size="small" :members="contributors" /> |
| 80 | + </template> |
| 81 | + </VPTeamPageSection> |
| 82 | +</VPTeamPage> |
0 commit comments