From fde307dd91c6cbf3c0850270c1d41e137ab94118 Mon Sep 17 00:00:00 2001 From: The-EDev Date: Thu, 24 Mar 2022 03:53:47 +0300 Subject: [PATCH] added gh-sponsors to site --- docs/overrides/home.html | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/overrides/home.html b/docs/overrides/home.html index f84f1f696..6442633c8 100644 --- a/docs/overrides/home.html +++ b/docs/overrides/home.html @@ -419,6 +419,20 @@

The 1000 mile journey begins with a single step. } } } + + let ghx = await fetch("https://gh-sponsors-dsdpxxx9d-filiptronicek.vercel.app/sponsors/CrowCpp"); + let ghy = await fetch("https://gh-sponsors-dsdpxxx9d-filiptronicek.vercel.app/count/CrowCpp"); + let ghsponsors = await ghx.json(); + ghsponsors = ghsponsors.sponsors; + let ghx_count = await ghy.json(); + ghx_count = ghx_count.sponsors.count; + + if (ghx_count > ghsponsors.length) + { + let priv_count = ghx_count - ghsponsors.length; + ghsponsors.push({handle: priv_count = 1 ? "Private sponsor" : `${priv_count} Private sponsors`, avatar:null, profile:"https://github.com/CrowCpp"}); + } + text += "

Sponsors

"; for(var i = 0; i < sponsors.length; i++){let item = sponsors[i]; text += makeCard(item.name, item.image, item.profile, 10);} @@ -432,6 +446,9 @@

The 1000 mile journey begins with a single step. text += "


Donations

"; for(var i = 0; i < donations.length; i++){let item = donations[i]; text += makeCard(item.name, item.image, item.profile, 3.5);} + text += "

GitHub Sponsors

"; + for(var i = 0; i < ghsponsors.length; i++){let item = ghsponsors[i]; text += makeCard(item.handle, item.avatar, item.profile, 5);} + text += "
"; await getGHData(); text += "
";