import IconButton from '$lib/components/util/iconButton.svelte'
const iconClasses = {
song: 'fa-solid fa-music',
album: 'fa-solid fa-compact-disc',
artist: 'fa-solid fa-user',
playlist: 'fa-solid fa-forward-fast',
}
let card: HTMLDivElement, cardGlare: HTMLDivElement
const rotateCard = (event: MouseEvent): void => {
const cardRect = card.getBoundingClientRect()
const x = (2 * (event.x - cardRect.left)) / cardRect.width - 1 // These are simplified calculations to find the x-y coords relative to the center of the card
const angle = Math.atan(x / y) // You'd think it should be y / x but it's actually the inverse
const distanceFromCorner = Math.sqrt((x - 1) ** 2 + (y - 1) ** 2) // This is a cool little trick, the -1 on the x an y coordinate is effective the same as saying "make the origin of the glare [1, 1]"
<ititle="Stream from {Services[mediaItem.service.type].displayName}"class="{iconClasses[mediaItem.type]} text-xs"style="color: var({Services[mediaItem.service.type].primaryColor});"/>