remove react

This commit is contained in:
darwinx64 2025-04-20 23:52:17 -05:00
parent 98412adab9
commit 0bb40ff89f
No known key found for this signature in database
29 changed files with 430 additions and 1730 deletions

View file

@ -0,0 +1,52 @@
---
import { Image } from "astro:assets"
import logo from "@assets/logo.png"
---
<div class="avatar-wrapper">
<Image
alt="My profile picture"
src={logo}
class="avatar"
width={80}
height={80}
aria-hidden
/>
</div>
<style>
.avatar-wrapper {
width: 80px;
height: 80px;
clip-path: var(--clip-avatar-outer);
background-color: var(--overlay0);
}
.avatar {
width: 80px;
height: 80px;
clip-path: var(--clip-avatar-inner);
}
</style>
<script>
const colours = {
"online": "var(--green)",
"idle": "var(--yellow)",
"dnd": "var(--red)",
"offline": "var(--overlay0)"
};
const avatarWrapper: HTMLElement = document.querySelector(".avatar-wrapper");
window.addEventListener('lanyard-update', (e: CustomEvent) => {
const presence = e.detail;
avatarWrapper.animate(
[
{ backgroundColor: colours[presence.discord_status] ?? colours.offline }
],
{
duration: 100,
fill: "forwards"
},
);
});
</script>