-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added my Discord status to the navbar.
- Loading branch information
tay
committed
Sep 20, 2024
1 parent
7871b44
commit 5a19c39
Showing
21 changed files
with
74 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const dcstat = document.getElementById("dcstat"); | ||
const apiEndpoint = `https://api.lanyard.rest/v1/users/1050531216589332581`; | ||
fetch(apiEndpoint) | ||
.then(response => response.json()) | ||
.then(data => { | ||
const dcStatus = data.data.discord_status; | ||
if (dcStatus === "offline") { | ||
dcstat.src = "/assets/imgs/offline.png"; | ||
} else if (dcStatus === "online") { | ||
dcstat.src = "/assets/imgs/online.png"; | ||
} else if (dcStatus === "idle") { | ||
dcstat.src = "/assets/imgs/away.png"; | ||
} else if (dcStatus === "dnd") { | ||
dcstat.src = "/assets/imgs/dnd.png"; | ||
} | ||
}) | ||
.catch(error => { | ||
console.error('Error fetching Discord status:', error); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const dcstat = document.getElementById("dcstat"); | ||
const apiEndpoint = `https://api.lanyard.rest/v1/users/1050531216589332581`; | ||
fetch(apiEndpoint) | ||
.then(response => response.json()) | ||
.then(data => { | ||
const dcStatus = data.data.discord_status; | ||
if (dcStatus === "offline") { | ||
dcstat.src = "/assets/imgs/offline.png"; | ||
} else if (dcStatus === "online") { | ||
dcstat.src = "/assets/imgs/online.png"; | ||
} else if (dcStatus === "idle") { | ||
dcstat.src = "/assets/imgs/away.png"; | ||
} else if (dcStatus === "dnd") { | ||
dcstat.src = "/assets/imgs/dnd.png"; | ||
} | ||
}) | ||
.catch(error => { | ||
console.error('Error fetching Discord status:', error); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters