memorium/components/Card.tsx

36 lines
971 B
TypeScript
Raw Normal View History

2023-08-07 13:42:00 +02:00
import { isYoutubeLink } from "@lib/string.ts";
import { IconBrandYoutube } from "@components/icons.tsx";
export function Card(
{ link, title, image }: { link?: string; title?: string; image?: string },
) {
return (
<a
href={link}
style={{
backgroundImage: `url(${image})`,
backgroundSize: "cover",
2023-07-31 17:21:17 +02:00
//background: "#2B2930",
}}
2023-07-30 23:55:51 +02:00
class="text-white rounded-3xl shadow-md p-4 relative overflow-hidden
lg:w-56 lg:h-56
2023-08-02 01:58:03 +02:00
sm:w-48 sm:h-48
2023-08-02 17:35:10 +02:00
w-[37vw] h-[37vw]"
>
<div class="h-full flex flex-col justify-between relative z-10">
<div>
{/* Recipe Card content */}
</div>
2023-08-07 13:42:00 +02:00
<div class="mt-2 flex items-center gap-2">
{isYoutubeLink(link || "") && <IconBrandYoutube />}
{title}
</div>
</div>
2023-07-31 17:21:17 +02:00
<div
class="absolute inset-x-0 bottom-0 h-3/4"
style={{ background: "linear-gradient(transparent, #000e)" }}
/>
</a>
);
}