feat: client side loading

This commit is contained in:
2025-01-20 23:37:03 +01:00
parent 463141981b
commit 19a1344d3d
7 changed files with 75 additions and 15 deletions

View File

@ -2,6 +2,7 @@ import { isYoutubeLink } from "@lib/string.ts";
import { IconBrandYoutube } from "@components/icons.tsx";
import { GenericResource } from "@lib/types.ts";
import { SmallRating } from "@components/Rating.tsx";
import { Link } from "@islands/Link.tsx";
export function Card(
{
@ -22,7 +23,7 @@ export function Card(
rating?: number;
},
) {
const backgroundStyle = {
const backgroundStyle: preact.JSX.CSSProperties = {
backgroundSize: "cover",
backgroundColor: backgroundColor,
};
@ -34,7 +35,7 @@ export function Card(
}
return (
<a
<Link
href={link}
style={backgroundStyle}
data-thumb={thumbnail}
@ -88,7 +89,7 @@ export function Card(
)}
</div>
<div class="absolute inset-x-0 bottom-0 h-3/4" />
</a>
</Link>
);
}