Only show the top supporters on hompage
Some checks failed
Deploy to GitHub Pages / build (push) Has been cancelled
Deploy to GitHub Pages / deploy (push) Has been cancelled

I no longer have time to maintain the full contributors list unfortunately
This commit is contained in:
Misode
2025-03-11 21:47:51 +01:00
parent b8c65edd83
commit 0138b54e0b
3 changed files with 123 additions and 1037 deletions

View File

@@ -1,5 +1,5 @@
import { useMemo } from 'preact/hooks'
import contributors from '../../contributors.json'
import supporters from '../../supporters.json'
import { Card, ChangelogEntry, Footer, GeneratorCard, Giscus, ToolCard, ToolGroup } from '../components/index.js'
import { WhatsNewTime } from '../components/whatsnew/WhatsNewTime.jsx'
import { useLocale, useTitle } from '../contexts/index.js'
@@ -7,7 +7,6 @@ import { useAsync } from '../hooks/useAsync.js'
import { useMediaQuery } from '../hooks/useMediaQuery.js'
import { fetchChangelogs, fetchVersions, fetchWhatsNew } from '../services/DataFetcher.js'
import { Store } from '../Store.js'
import { shuffle } from '../Utils.js'
const MIN_FAVORITES = 2
const MAX_FAVORITES = 5
@@ -153,32 +152,20 @@ function WhatsNew() {
}
function Contributors() {
const supporters = useMemo(() => {
return contributors.filter(c => c.types.includes('support') || c.types.includes('infrastructure'))
}, [])
const otherContributors = useMemo(() => {
return shuffle(contributors.filter(c => !supporters.includes(c)))
}, [])
return <div class="contributors">
<h3>Supporters</h3>
<ContributorsList list={supporters} large />
<h3>Contributors</h3>
<ContributorsList list={otherContributors} />
</div>
}
interface ContributorsListProps {
list: typeof contributors
list: typeof supporters
large?: boolean
}
function ContributorsList({ list, large }: ContributorsListProps) {
const { locale } = useLocale()
return <div class={`contributors-list ${large ? 'contributors-large' : ''}`}>
{list.map((c) =>
<a class="tooltipped tip-se" href={c.url} target="_blank" aria-label={`${c.name}\n${c.types.map(t => `${locale('contributor.' + t)}`).join('\n')}`}>
<a class="tooltipped tip-se" href={c.url} target="_blank" aria-label={c.name}>
<img width={large ? 48 : 32} height={large ? 48 : 32} src={c.avatar} alt={c.name} loading="lazy" />
</a>
)}

File diff suppressed because it is too large Load Diff

120
src/supporters.json Normal file
View File

@@ -0,0 +1,120 @@
[
{
"name": "catter1",
"avatar": "https://avatars.githubusercontent.com/u/63272345?v=4",
"url": "https://github.com/catter1"
},
{
"name": "EpyonProjects",
"avatar": "https://avatars.githubusercontent.com/u/66185010?s=60&v=4",
"url": "https://github.com/EpyonProjects"
},
{
"name": "TelepathicGrunt",
"avatar": "https://avatars.githubusercontent.com/u/40846040?v=4",
"url": "https://github.com/TelepathicGrunt"
},
{
"name": "tryashtar",
"avatar": "https://avatars.githubusercontent.com/u/26075577?s=60&v=4",
"url": "https://github.com/tryashtar"
},
{
"name": "Shadowclaimer",
"avatar": "https://avatars.githubusercontent.com/u/2214143?v=4",
"url": "https://github.com/Shadowclaimer"
},
{
"name": "alumina6767",
"avatar": "https://storage.ko-fi.com/cdn/useruploads/5ebdb30d-9fb6-4a80-b471-e606f1832344_78f4cbda-5ed9-4d76-8a59-3c6d10100357.png"
},
{
"name": "Kesuaheli",
"avatar": "https://avatars.githubusercontent.com/u/40177436?v=4",
"url": "https://github.com/Kesuaheli"
},
{
"name": "Aternos",
"avatar": "https://avatars.githubusercontent.com/u/10004025?s=200&v=4",
"url": "https://github.com/aternosorg"
},
{
"name": "tholleman",
"avatar": "https://storage.ko-fi.com/cdn/useruploads/post/615c6561-04c3-4ab6-91b6-72a447cf7c75_a524398f-ff67-4f8f-93d0-ac9d4a37624d.png"
},
{
"name": "contessa",
"avatar": "https://ko-fi.com/img/anon3.png"
},
{
"name": "AjaxGb",
"avatar": "https://avatars.githubusercontent.com/u/7976377?v=4",
"url": "https://github.com/AjaxGb"
},
{
"name": "Minh",
"avatar": "https://ko-fi.com/img/anon5.png?v=1"
},
{
"name": "Instantout",
"avatar": "https://ko-fi.com/img/anon4.png?v=1"
},
{
"name": "rx97",
"avatar": "https://storage.ko-fi.com/cdn/useruploads/78f6cf72-52e1-4953-99f5-dd38f55a9c6e.png",
"url": "https://github.com/RitikShah"
},
{
"name": "MyNameIsBhex",
"avatar": "https://storage.ko-fi.com/cdn/useruploads/post/e632119c-639e-4855-ad9a-1652cc7e1815_dd629262-2491-4327-9ea5-5d19ab7836c3.png",
"url": "https://ko-fi.com/mynameisbhex"
},
{
"name": "Zenith",
"avatar": "https://storage.ko-fi.com/cdn/useruploads/tiny_34059247-700e-4f6c-beef-67f1ac223d61.png",
"url": "https://ko-fi.com/zenithknight"
},
{
"name": "schwappo",
"avatar": "https://ko-fi.com/img/anon7.png?v=1"
},
{
"name": "flabbypants",
"avatar": "https://ko-fi.com/img/anon2.png"
},
{
"name": "casor14",
"avatar": "https://ko-fi.com/img/anon2.png?v=1"
},
{
"name": "ThijquintNL",
"avatar": "https://ko-fi.com/img/anon6.png"
},
{
"name": "oitsjustjose",
"avatar": "https://ko-fi.com/img/anon10.png"
},
{
"name": "kohara",
"avatar": "https://storage.ko-fi.com/cdn/useruploads/ead82adb-6108-45a7-81f7-fcf323966d3c_tiny.png",
"url": "https://ko-fi.com/kohara"
},
{
"name": "awesomesauce",
"avatar": "https://ko-fi.com/img/anon7.png?v=1"
},
{
"name": "Panossa",
"avatar": "https://ko-fi.com/img/anon5.png"
},
{
"name": "SPGoding",
"avatar": "https://avatars.githubusercontent.com/u/15277496?v=4",
"url": "https://github.com/SPGoding"
},
{
"name": "jacobsjo",
"avatar": "https://avatars.githubusercontent.com/u/10163794?v=4",
"url": "https://github.com/jacobsjo"
}
]