From d8a1b4b1866e6718ba87ecbb0edefd50b8d33a99 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Wed, 20 Sep 2023 19:30:37 -0700 Subject: fix dynamic discord status --- src/components/DiscordStatus.astro | 101 +++++++++++++++++++++++-------------- 1 file changed, 63 insertions(+), 38 deletions(-) diff --git a/src/components/DiscordStatus.astro b/src/components/DiscordStatus.astro index b40df15..518909e 100644 --- a/src/components/DiscordStatus.astro +++ b/src/components/DiscordStatus.astro @@ -1,11 +1,4 @@ --- -const API_URL = "https://api.lanyard.rest/v1/users/246787839570739211"; -const response = await fetch(API_URL); -const data = await response.json(); - -const discordUser = data.data.discord_user; -const discordStatus = data.data.discord_status; - const statusColors = { online: "#43b581", idle: "#faa61a", @@ -21,36 +14,68 @@ const statusText = { } --- - -
- {`${discordUser.username}'s -

Status: {statusText[discordStatus]}

+
+ Discord Avatar +

Status:

+ \ No newline at end of file + #discord-status { + display: flex; + align-items: center; + padding: 20px; + border-radius: 10px; + color: white; + transition: background-color 0.3s ease-in-out; + } + + #discord-status img { + width: 60px; + height: 60px; + border-radius: 50%; + margin-right: 20px; + } + + #discord-status h2 { + margin: 0; + font-size: 1.5rem; + } + + #discord-status p { + margin: 0; + font-size: 1rem; + opacity: 0.8; + } + + + \ No newline at end of file -- cgit v1.2.3