chore(publish): replace source tree with static export at repo root
Publish the prerendered static export (index.html, 404.html, cinema/,
c/, about/, for-cinemas/, for-film-lovers/, assets/, images/, og/,
sitemap.xml, robots.txt) as the site root and remove the React Router
+ Nitro source tree from this branch. Source remains available in
history at 0548772.
Note: public/sw.js here reports VERSION v2.0.5 while the removed source
tree (v2.1.0) was newer, and .gitignore was not carried over.
This commit is contained in:
1 parent
05487728a7
commit
e6c4ebff48
394 files changed
+3977
-37891
No files matched your search
@@ -1,115 +0,0 @@
|
||||
import {
|
||||
IconArrowRight,
|
||||
IconBuildingCommunity,
|
||||
IconMapPin,
|
||||
} from "@tabler/icons-react";
|
||||
import { Link } from "react-router";
|
||||
|
||||
import { PhotoImage } from "@/components/site/PhotoImage";
|
||||
import { ShareButton } from "@/components/site/ShareButton";
|
||||
import { useNearMe } from "@/hooks/use-near-me";
|
||||
import { useReveal } from "@/hooks/use-reveal";
|
||||
import { trackEvent } from "@/lib/analytics-client";
|
||||
import {
|
||||
CARD_GRADIENTS,
|
||||
cinemaCategoryLabel,
|
||||
cinemaLocationLabel,
|
||||
cinemaName,
|
||||
type Cinema,
|
||||
} from "@/lib/cinemas";
|
||||
import { formatDistance } from "@/lib/geo";
|
||||
import { useI18n } from "@/lib/i18n";
|
||||
|
||||
type CinemaCardProps = {
|
||||
cinema: Cinema;
|
||||
/** ลำดับการ์ด ใช้เลือก gradient ให้สลับสีสม่ำเสมอ */
|
||||
index?: number;
|
||||
/** ที่มาของการ์ด ใช้บันทึกสถิติการคลิก */
|
||||
source?: string;
|
||||
/** คำค้นปัจจุบัน (แนบไปกับการคลิกเพื่อวัด CTR ของคำค้น) */
|
||||
searchQuery?: string;
|
||||
};
|
||||
|
||||
export function CinemaCard({
|
||||
cinema,
|
||||
index = 0,
|
||||
source = "list",
|
||||
searchQuery,
|
||||
}: CinemaCardProps) {
|
||||
const { locale, messages } = useI18n();
|
||||
const { distances } = useNearMe();
|
||||
const gradient = CARD_GRADIENTS[index % CARD_GRADIENTS.length];
|
||||
// รูปแรก = ปกการ์ด (ถ้าไม่มีรูป ใช้ gradient เดิมเป็นพื้นหลัง)
|
||||
const cover = cinema.photos.find((photo) => photo.trim() !== "");
|
||||
const distanceLabel = formatDistance(
|
||||
distances[cinema.slug],
|
||||
messages.card.distanceFallback,
|
||||
);
|
||||
|
||||
// ไล่จังหวะโผล่ทีละใบตามคอลัมน์ (เริ่มหลังหัวข้อ/หมวด เพื่อให้ดูเป็นลำดับ)
|
||||
const { ref, revealed, style } = useReveal<HTMLElement>(
|
||||
140 + (index % 4) * 70,
|
||||
);
|
||||
|
||||
return (
|
||||
<article
|
||||
ref={ref}
|
||||
data-reveal="zoom"
|
||||
data-revealed={revealed ? "" : undefined}
|
||||
style={style}
|
||||
className={`group relative flex aspect-[3/4] flex-col justify-end overflow-hidden rounded-[20px] bg-gradient-to-br p-2 transition-[translate,box-shadow] duration-300 ease-out hover:-translate-y-1 hover:shadow-[0_18px_38px_-24px_rgba(143,8,8,0.75)] lg:aspect-auto lg:h-[308px] ${gradient}`}
|
||||
>
|
||||
{cover ? (
|
||||
<>
|
||||
<PhotoImage
|
||||
src={cover}
|
||||
alt=""
|
||||
lazy
|
||||
className="absolute inset-0 size-full object-cover transition-transform duration-700 ease-out group-hover:scale-[1.06]"
|
||||
/>
|
||||
{/* ไล่เงาเพื่อให้ตัวอักษรบนการ์ดอ่านได้ */}
|
||||
<div
|
||||
aria-hidden="true"
|
||||
className="absolute inset-0 bg-gradient-to-t from-[#0D0D0D]/95 via-[#0D0D0D]/35 to-transparent"
|
||||
/>
|
||||
</>
|
||||
) : null}
|
||||
|
||||
{/* ปุ่มแชร์ลอยมุมขวาบนของการ์ด */}
|
||||
<div className="absolute right-3 top-3 z-10">
|
||||
<ShareButton slug={cinema.slug} title={cinemaName(cinema, locale)} />
|
||||
</div>
|
||||
|
||||
<div className="relative flex flex-col gap-1.5 rounded-2xl border border-white/10 bg-[#1B1B1B]/80 p-3 backdrop-blur-xl transition-colors duration-300 group-hover:border-[#A92626]/40">
|
||||
<span className="text-[10px] text-[#B3B3B3]">{distanceLabel}</span>
|
||||
<h3 className="text-sm font-semibold">{cinemaName(cinema, locale)}</h3>
|
||||
<p className="flex items-center gap-1.5 text-xs text-[#B3B3B3]">
|
||||
<IconMapPin size={12} />
|
||||
{cinemaLocationLabel(cinema, locale) ||
|
||||
messages.card.locationFallback}
|
||||
</p>
|
||||
<p className="flex items-center gap-1.5 text-xs text-[#B3B3B3]">
|
||||
<IconBuildingCommunity size={12} />
|
||||
{cinemaCategoryLabel(cinema, messages) ||
|
||||
messages.card.categoryFallback}
|
||||
</p>
|
||||
<Link
|
||||
to={`/cinema/${cinema.slug}`}
|
||||
onClick={() =>
|
||||
trackEvent({
|
||||
type: "cinema_select",
|
||||
slug: cinema.slug,
|
||||
source,
|
||||
query: searchQuery,
|
||||
position: index + 1,
|
||||
locale,
|
||||
})
|
||||
}
|
||||
className="mt-3 flex items-center justify-end gap-2 text-xs font-medium"
|
||||
>
|
||||
{messages.card.seeDetail} <IconArrowRight size={12} />
|
||||
</Link>
|
||||
</div>
|
||||
</article>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user