@@ -0,0 +1,94 @@
|
||||
import Link from "next/link";
|
||||
|
||||
import { AdBanners } from "@/components/common/ads/ad-banners";
|
||||
import { CardTags } from "@/components/common/card-tags";
|
||||
import {
|
||||
MEDIA_CARD_COVER,
|
||||
MEDIA_CARD_DESC,
|
||||
MEDIA_CARD_EPISODES,
|
||||
MEDIA_CARD_META,
|
||||
MEDIA_CARD_ROOT,
|
||||
MEDIA_CARD_TITLE_PC,
|
||||
MEDIA_CARD_TITLE_PC_MD,
|
||||
} from "@/components/common/media-card-hover";
|
||||
import { dramaHref } from "@/components/short-drama/data";
|
||||
import type { AdvertiseInfo, AdvitiseData } from "@/lib/api/types";
|
||||
|
||||
import type { Drama } from "./data";
|
||||
import { Badge } from "./section-heading";
|
||||
|
||||
type DramaCardProps = {
|
||||
drama: Drama;
|
||||
size?: "wide" | "card";
|
||||
rank?: string;
|
||||
};
|
||||
|
||||
export function DramaCard({ drama, size = "card", rank }: DramaCardProps) {
|
||||
const isWide = size === "wide";
|
||||
const detailHref = dramaHref(drama.id);
|
||||
|
||||
return (
|
||||
<article data-component="drama-card" className={MEDIA_CARD_ROOT}>
|
||||
<Link href={detailHref} className="block">
|
||||
<div className={`relative overflow-hidden rounded-t-lg ${isWide ? "h-[355px]" : "h-[215px]"}`}>
|
||||
<img src={drama.cover} alt="" className={MEDIA_CARD_COVER} />
|
||||
{drama.badge ? (
|
||||
<div className="absolute top-4 right-4">
|
||||
<Badge tone={drama.badge} />
|
||||
</div>
|
||||
) : null}
|
||||
<span
|
||||
className={`absolute right-4 bottom-4 rounded-md bg-black/60 px-3 py-2 font-medium text-white ${MEDIA_CARD_EPISODES}`}
|
||||
>
|
||||
{drama.episodes}
|
||||
</span>
|
||||
</div>
|
||||
<div className={`flex flex-col gap-1.5 ${isWide ? "px-4 pt-4" : "px-2 pt-2"}`}>
|
||||
<h3 className={`flex items-center gap-2 ${isWide ? MEDIA_CARD_TITLE_PC : MEDIA_CARD_TITLE_PC_MD}`}>
|
||||
{rank ? <span className="media-card-title shrink-0 font-extrabold text-[#F12B9E]">{rank}</span> : null}
|
||||
<span className="truncate">{drama.title}</span>
|
||||
</h3>
|
||||
<p className={`${MEDIA_CARD_DESC} text-white/60`}>{drama.subtitle}</p>
|
||||
</div>
|
||||
</Link>
|
||||
<div
|
||||
className={`flex items-center justify-between gap-2 ${MEDIA_CARD_META} ${isWide ? "px-4 pt-1.5 pb-4" : "px-2 pt-1 pb-2"}`}
|
||||
>
|
||||
<CardTags tags={drama.tags} kind="playlet" className="text-white/60" />
|
||||
<span className="shrink-0 font-medium text-[#F92882]">{drama.heat}</span>
|
||||
</div>
|
||||
</article>
|
||||
);
|
||||
}
|
||||
|
||||
export function ThemeBlock({ title, subtitle, cover }: { title: string; subtitle: string; cover: string }) {
|
||||
return (
|
||||
<article className="relative h-[475px] overflow-hidden rounded-lg bg-[#0C1A26]">
|
||||
<img src={cover} alt="" className="absolute -bottom-8 -left-16 h-[340px] w-[330px] rotate-[-27deg] object-cover opacity-80" />
|
||||
<div className="absolute inset-0 bg-[linear-gradient(180deg,rgba(12,26,38,0.2),rgba(12,26,38,0.72))]" />
|
||||
<div className="absolute top-24 left-12">
|
||||
<h3 className="text-[54px] leading-[42px] font-bold text-[#EFF3F3]">{title}</h3>
|
||||
<p className="mt-7 text-2xl leading-[21px] text-[#DDE0E3]">{subtitle}</p>
|
||||
</div>
|
||||
<Link
|
||||
href="/more"
|
||||
className="absolute bottom-[72px] left-12 inline-flex items-center gap-1.5 rounded-full border border-[#F12B9E] px-4 py-4 text-2xl leading-[21px] text-[#F12B9E]"
|
||||
>
|
||||
浏览更多
|
||||
<span aria-hidden="true">→</span>
|
||||
</Link>
|
||||
</article>
|
||||
);
|
||||
}
|
||||
|
||||
/** @deprecated 使用 AdBanners;covers 保留兼容,有接口数据时优先接口 */
|
||||
export function PromoRow({
|
||||
items,
|
||||
advitise,
|
||||
}: {
|
||||
covers?: readonly string[];
|
||||
items?: AdvertiseInfo[] | null;
|
||||
advitise?: AdvitiseData | null;
|
||||
}) {
|
||||
return <AdBanners variant="pc" items={items} advitise={advitise} />;
|
||||
}
|
||||
Reference in New Issue
Block a user