feat: seperate sponsors and patrons

This commit is contained in:
ThatOneCalculator 2023-07-14 23:03:07 -07:00
parent ab700600d1
commit c99480529f
No known key found for this signature in database
GPG Key ID: 8703CACD01000000
5 changed files with 43 additions and 17 deletions

View File

@ -1228,6 +1228,7 @@ _aboutMisskey:
donateHost: "Donate to {host}"
morePatrons: "We also appreciate the support of many other helpers not listed here.
Thank you! 🥰"
sponsors: "Calckey sponsors"
patrons: "Calckey patrons"
patronsList: "Listed chronologically, not by donation size. Donate with the link above to get your name on here!"
_nsfw:

View File

@ -9,7 +9,7 @@ const _dirname = dirname(_filename);
export const meta = {
tags: ["meta"],
description: "Get list of Calckey patrons from Codeberg",
description: "Get Calckey patrons",
requireCredential: false,
requireCredentialPrivateMode: false,
@ -51,6 +51,8 @@ export default define(meta, paramDef, async (ps) => {
});
await redisClient.set("patrons", JSON.stringify(patrons), "EX", 3600);
}
return patrons["patrons"];
return {
patrons: patrons["patrons"],
sponsors: patrons["sponsors"],
};
});

View File

@ -127,6 +127,25 @@
></template
>
</FormSection>
<FormSection>
<template #label
><Mfm :text="`$[x2 $[jelly ❤] ${i18n.ts._aboutMisskey.sponsors}]`" />
</template
>
<MkSparkle>
<span
v-for="sponsor in sponsors"
:key="sponsor"
style="
margin-bottom: 0.5rem;
margin-right: 0.5rem;
font-size: 1.7rem;
"
>
<Mfm :text="`${sponsor}`" />
</span>
</MkSparkle>
</FormSection>
<FormSection>
<template #label
><Mfm text="$[jelly ❤]" />
@ -147,9 +166,7 @@
<Mfm :text="`${patron}`" />
</span>
</MkSparkle>
<template #caption>{{
i18n.ts._aboutMisskey.morePatrons
}}</template>
<p>{{ i18n.ts._aboutMisskey.morePatrons }}</p>
</FormSection>
</div>
</MkSpacer>
@ -172,11 +189,13 @@ import * as os from "@/os";
import { definePageMetadata } from "@/scripts/page-metadata";
let patrons = [];
try {
patrons = await os.api("patrons", { forceUpdate: true });
} catch {
console.error("Codeberg's down.");
}
let sponsors = [];
const patronsResp = await os.api("patrons", { forceUpdate: true });
patrons = patronsResp.patrons;
sponsors = patronsResp.sponsors;
patrons = patrons.filter((patron) => !sponsors.includes(patron));
let easterEggReady = false;
let easterEggEmojis = $ref([]);

View File

@ -461,11 +461,8 @@ const timeForThem = $computed(() => {
});
let patrons = [];
try {
patrons = await os.api("patrons");
} catch {
console.error("Codeberg's down.");
}
const patronsResp = await os.api("patrons");
patrons = patronsResp.patrons;
function parallaxLoop() {
parallaxAnimationId = window.requestAnimationFrame(parallaxLoop);

View File

@ -94,7 +94,14 @@
"@Space6host@calckey.social",
"@zakalwe@plasmatrap.com",
"@seasicksailor@calckey.social",
"@Hunkabilly@calckey.world",
"@geerue@calckey.social",
"@WXFanatic@m.ai6yr.org",
"@Hunkabilly@calckey.world"
],
"sponsors": [
"@atomicpoet@calckey.social",
"@unattributed@calckey.social",
"@jtbennett@noc.social",
"\nInterkosmos Link"
]
}