Something went wrong. Try again.
silly personal website
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177/** * Copyright (c) 2025 adoravel * SPDX-License-Identifier: AGPL-3.0-or-later */
import { css } from "~/lib/css.ts";import { boundaries, ease, fontFamily, fontSize, radius, spacing, theme } from "~/layout.tsx";import { Song } from "~/content/songs.ts";import { SongArt } from "~/components/content/SongArt.tsx";
interface Props extends Song {}
const Styled = css(` :scope { display: flex; flex-direction: column; width: 100%; background-color: ${theme.base}; border: 1px solid ${theme.baseBorder}; border-radius: ${radius.lg}; font-size: ${fontSize.sm}; color: ${theme.subtext}; font-family: ${fontFamily.misc}; letter-spacing: ${spacing.letter.misc};
transform: translateY(0px); box-shadow: 0 0px 0px rgba(0, 0, 0, 0); transition: transform ${ease.spring}, color ${ease.fast}, background-color ${ease.fast}, border-color ${ease.fast}, box-shadow ${ease.spring};
&:hover { transform: translateY(-4px); background-color: ${theme.surfaceHover}; border-color: ${theme.surfaceBorderHover};
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.2); }
&:hover .header { border-bottom-color: ${theme.surfaceBorderHover}; }
&:hover :is(.release-date, .listen-link, .info-tag, .info-artist, .info-artist > span) { color: ${theme.textMutedHover}; }
&:hover .listen-link::after { background-color: ${theme.textMutedHover}; } }
.header { display: flex; align-items: center; line-height: 1; padding: ${spacing[4]} ${spacing[4]}; gap: ${spacing[2]}; border-bottom: 1px solid ${theme.baseBorder};
transition: border-bottom-color ${ease.fast}; }
.release-date { display: flex; align-items: center; color: ${theme.textMuted}; letter-spacing: ${spacing.letter.plus}; }
.listen-link { margin-left: auto; gap: ${spacing[1]}; color: ${theme.textMuted}; font-size: ${fontSize.xs}; }
.listen-link::after { background-color: ${theme.textMuted} !important; margin-right: 0; margin-left: 8px; } .listen-link:hover { color: ${theme.accent}; &::after { background-color: ${theme.accent} !important; } }
.body { display: flex; align-items: flex-start; padding: ${spacing[4]}; gap: ${spacing[4]}; text-decoration: none; color: inherit; @media (max-width: ${boundaries.mobileMaxWidth}) { flex-direction: column; align-items: center; text-align: center; } } .info { display: flex; flex-direction: column; line-height: 1.75; }
.info-title { color: ${theme.text}; font-weight: 500; font-size: ${fontSize.md}; }
.info-tag { margin-left: 1ch; color: ${theme.textMuted}; }
.info-artist { color: ${theme.textMuted}; font-size: ${fontSize.sm}; }
.info-artist > spany { color: ${theme.textMuted}; }`);
export default function FeaturedSong({ title, artist, album, releaseDate, coverUrl, url, tag,}: Props) { return ( <Styled.div> <div class="header"> <div class="release-date"> {releaseDate} </div> <a class="listen-link link" href={url} target="_blank" rel="noopener noreferrer"> listen </a> </div> <a class="body" href={url} target="_blank" rel="noopener noreferrer"> <SongArt url={coverUrl} /> <div class="info"> <div class="info-title"> {title} {tag && <span class="info-tag">{tag}</span>} </div> <div class="info-artist"> {album && <span>{album}</span>} <br /> {artist} </div> </div> </a> </Styled.div> );}