Skip to content

Commit

Permalink
add crash_sight
Browse files Browse the repository at this point in the history
  • Loading branch information
williamsjokvist committed Jan 19, 2024
1 parent 077da32 commit b1f2bb6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 38 deletions.
Binary file added public/streamer-icons/crash_sight.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 1 addition & 37 deletions src/components/SiteFooter.astro
Original file line number Diff line number Diff line change
@@ -1,42 +1,6 @@
---
---

<script>
const fetchDownloadCount = async () => {
const res = await fetch(
`https://api.github.com/repos/williamsjokvist/cfn-tracker/releases`,
{
method: `GET`,
}
);

if (res.status == 200) {
const releases = await res.json();

let downloadCount = 0;
for (const release of releases) {
for (const asset of release.assets) {
downloadCount += asset.download_count;
}
}
return downloadCount;
} else if (res.status == 404) {
return 0;
}
};

const assignDownloadCount = async () => {
const download_count = await fetchDownloadCount();
const cfnTrackerEl = document.getElementById(`cfn-tracker-download-count`);
cfnTrackerEl.innerText = download_count.toString();
}

document.addEventListener("astro:page-load", assignDownloadCount);
</script>

<footer class="pb-80 pt-48 text-2xl lowercase flex justify-center">
<div class="border-solid border-[#2d29b9] border-4 text-center p-8 rounded-3xl">
<p class="text-2xl">CFN Tracker // <a href="https://www.williamsjokvist.se/" target="_blank" class="text-gradient font-bold">William</a></p>
<p class="text-xl mt-2"><b id="cfn-tracker-download-count" class="font-extrabold text-[#ff53d9]"></b> downloads</p>
</div>
<p class="text-2xl"><b class="font-extrabold text-[#ff53d9]">CFN</b> Tracker // <a href="https://www.williamsjokvist.se/" target="_blank" class="text-gradient">William</a></p>
</footer>
9 changes: 8 additions & 1 deletion src/components/Streamers.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import osl from "../../public/streamer-icons/osl.png"
import sheldon from "../../public/streamer-icons/sheldon.png"
import espadah from "../../public/streamer-icons/espadah.png"
import crash_sight from "../../public/streamer-icons/crash_sight.jpg"
import WithTooltip from "./WithTooltip.astro";
Expand All @@ -18,7 +19,13 @@ const streamers = [{
url: "https://twitch.tv/Espadah",
img: espadah.src,
name: "Espadah"
},
{
url: "https://www.twitch.tv/crash_sight",
img: crash_sight.src,
name: "くらっしゅ"
}]
---

<script>
Expand Down Expand Up @@ -61,7 +68,7 @@ const streamers = [{
{
streamers.map(s => (
<WithTooltip label={s.name}>
<a href={s.url}>
<a href={s.url} target="_blank">
<img src={s.img} width="60px" height="60px" class="rounded-full" />
</a>
</WithTooltip>
Expand Down

0 comments on commit b1f2bb6

Please sign in to comment.