automatically update fundraiser status
All checks were successful
/ build (push) Successful in 19s

This commit is contained in:
bain 2024-12-14 22:25:35 +01:00
parent dc5d9e06bc
commit ef7e7f03aa
Signed by: bain
GPG key ID: 31F0F25E3BED0B9B

View file

@ -12,9 +12,18 @@
<p style="font-size: clamp(1.25rem, 4vw, 1.5rem); line-height: 1.1">Teď potřebujeme vaší podporu</p>
<br />
<div class="text-right w-min mx-auto">
<div class="fundraiser-progress-bar w-full"></div>
<p>vybráno 4 500 Kč z 180 000 Kč</p>
<div id="progressBar" class="fundraiser-progress-bar w-full"></div>
<p id="amount">vybráno 4 500 Kč z 180 000 Kč</p>
</div>
<script>
(async function(){
const resp = await fetch('https://ha.nolog.cz/fundraising/darujme-stats');
const data = await resp.json();
progressBar.setAttribute('style', '--filled: ' + Math.round(data.projectStats.collectedAmountEstimate.cents / 18000000 * 100) + '%')
const amount = Math.round(data.projectStats.collectedAmountEstimate.cents / 100).toLocaleString('cs-CZ');
amount.textContent = "vybráno " + amount + " Kč z 180 000 Kč";
})()
</script>
</div>
</div>
<div class="flex justify-center max-md:flex-wrap gap-3">