mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-28 01:39:29 +08:00
showing patreon list in about
This commit is contained in:
parent
98c2ab5c69
commit
41dc4b52f8
5 changed files with 44 additions and 0 deletions
|
|
@ -446,6 +446,22 @@ exports.requestTest = functions.https.onRequest((request, response) => {
|
|||
response.status(200).send({ data: "test" });
|
||||
});
|
||||
|
||||
exports.getPatreons = functions.https.onRequest(async (request, response) => {
|
||||
response.set("Access-Control-Allow-Origin", "*");
|
||||
response.set("Access-Control-Allow-Headers", "*");
|
||||
response.set("Access-Control-Allow-Credentials", "true");
|
||||
|
||||
let patreon = await db.collection("patreon").orderBy("value", "desc").get();
|
||||
let ret = [];
|
||||
patreon.docs.forEach((pdoc) => {
|
||||
ret.push(pdoc.data().name);
|
||||
});
|
||||
|
||||
// console.log(ret);
|
||||
|
||||
response.status(200).send({ data: ret });
|
||||
});
|
||||
|
||||
async function incrementTestCounter(uid) {
|
||||
let userDoc = await db.collection("users").doc(uid).get();
|
||||
let userData = userDoc.data();
|
||||
|
|
|
|||
|
|
@ -1670,6 +1670,14 @@ key {
|
|||
display: grid;
|
||||
gap: 0.5rem;
|
||||
|
||||
.supporters {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr;
|
||||
justify-items: center;
|
||||
gap: 0.25rem;
|
||||
color: var(--text-color);
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 1rem;
|
||||
line-height: 1rem;
|
||||
|
|
|
|||
|
|
@ -1333,7 +1333,13 @@
|
|||
adding themes and more.
|
||||
</p>
|
||||
</div>
|
||||
<div class="section">
|
||||
<h1>supporters</h1>
|
||||
<div class="supporters">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="page pageSettings hidden">
|
||||
<div class="tip">
|
||||
tip: You can also change all these settings quickly using the
|
||||
|
|
|
|||
|
|
@ -169,6 +169,19 @@ function getReleasesFromGitHub() {
|
|||
);
|
||||
}
|
||||
|
||||
function getPatreonNames() {
|
||||
let namesel = $(".pageAbout .section .supporters");
|
||||
firebase
|
||||
.functions()
|
||||
.httpsCallable("getPatreons")()
|
||||
.then((data) => {
|
||||
let names = data.data;
|
||||
names.forEach((name) => {
|
||||
namesel.prepend(`<div>${name}</div>`);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function getLastChar(word) {
|
||||
return word.charAt(word.length - 1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3804,6 +3804,7 @@ $(document).keydown((event) => {
|
|||
|
||||
loadConfigFromCookie();
|
||||
getReleasesFromGitHub();
|
||||
getPatreonNames();
|
||||
|
||||
if (firebase.app().options.projectId === "monkey-type-dev-67af4") {
|
||||
$("#top .logo .bottom").text("monkey-dev");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue