pages/bio/lanyard.js
2025-05-09 18:46:04 +02:00

23 lines
667 B
JavaScript

lanyard({
userId: "1201415921802170388",
}).then(data => {
const status = document.getElementById('status');
const nameDiv = document.getElementById('name');
const customStatus = data.activities.find(activity => activity.type === 4);
const statusColors = {
online: "#23a55a",
idle: "#f0b232",
dnd: "#f23f43",
offline: "#80848e"
};
document.getElementById('pfp').style.borderColor = statusColors[data.discord_status] || offline;
if (customStatus) {
nameDiv.setAttribute("data-tooltip", customStatus.state);
} else {
nameDiv.setAttribute("data-tooltip", "No custom status");
}
})