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:
Bkk1234 committed 2026-11-22 22:24:36 +07:00
1 parent 05487728a7
commit e6c4ebff48
394 files changed
+3977 -37891

No files matched your search

-185
View File
@@ -1,185 +0,0 @@
import { IconCheck, IconChevronDown } from "@tabler/icons-react";
import {
useEffect,
useRef,
useState,
type KeyboardEvent as ReactKeyboardEvent,
} from "react";
import { COLORS } from "@/lib/design-tokens";
import { useI18n } from "@/lib/i18n";
import { LOCALE_OPTIONS, type Locale } from "@/lib/i18n/messages";
/** ธงชาติไทยย่อส่วน */
function FlagTh() {
return (
<span
className="block h-4 w-[21px] shrink-0 rounded-[1px]"
style={{ background: COLORS.flagGradient }}
/>
);
}
/** ธงสหราชอาณาจักรย่อส่วน */
function FlagEn() {
return (
<span
className="relative block h-4 w-[21px] shrink-0 overflow-hidden rounded-[1px]"
style={{ background: "#012169" }}
>
<span
className="absolute inset-0"
style={{
background:
"linear-gradient(45deg, transparent 44%, #F4F5F8 44% 56%, transparent 56%), linear-gradient(-45deg, transparent 44%, #F4F5F8 44% 56%, transparent 56%)",
}}
/>
<span
className="absolute inset-0"
style={{
background:
"linear-gradient(90deg, transparent 40%, #F4F5F8 40% 60%, transparent 60%), linear-gradient(0deg, transparent 33%, #F4F5F8 33% 67%, transparent 67%)",
}}
/>
<span
className="absolute inset-0"
style={{
background:
"linear-gradient(90deg, transparent 44%, #C8102E 44% 56%, transparent 56%), linear-gradient(0deg, transparent 40%, #C8102E 40% 60%, transparent 60%)",
}}
/>
</span>
);
}
const FLAGS = { th: FlagTh, en: FlagEn } as const;
/**
* สลับภาษาเป็น "ปุ่มเดียว + dropdown"
*
* - ปุ่มแสดงภาษาปัจจุบัน (ธง + รหัส) พร้อมลูกศรบอกว่ามีกั้นลงมา
* - เลือกแล้วเปลี่ยนภาษาทันทีและปิดเมนู คืนโฟกัสกลับไปที่ปุ่ม
* - ปิดได้ด้วยคลิกนอกเมนู หรือกด Escape
* (เดิมเป็นปุ่ม TH/EN สองปุ่ม — ยุบเหลือปุ่มเดียวเพื่อประหยัดที่ใน header มือถือ)
*/
export function LocaleSwitcher() {
const { locale, setLocale, messages } = useI18n();
const [open, setOpen] = useState(false);
const wrapperRef = useRef<HTMLDivElement>(null);
const triggerRef = useRef<HTMLButtonElement>(null);
// ปิดเมนูเมื่อคลิกที่อื่น หรือกด Escape
useEffect(() => {
if (!open) return;
// ให้คีย์บอร์ดเริ่มที่ตัวเลือกปัจจุบัน (มาตรฐานของ role="menu")
wrapperRef.current
?.querySelector<HTMLButtonElement>(
'[role="menuitemradio"][aria-checked="true"]',
)
?.focus();
function handlePointerDown(event: MouseEvent) {
if (!wrapperRef.current?.contains(event.target as Node)) setOpen(false);
}
function handleKeyDown(event: KeyboardEvent) {
if (event.key !== "Escape") return;
setOpen(false);
triggerRef.current?.focus();
}
document.addEventListener("mousedown", handlePointerDown);
document.addEventListener("keydown", handleKeyDown);
return () => {
document.removeEventListener("mousedown", handlePointerDown);
document.removeEventListener("keydown", handleKeyDown);
};
}, [open]);
const current =
LOCALE_OPTIONS.find((option) => option.locale === locale) ??
LOCALE_OPTIONS[0];
const CurrentFlag = FLAGS[current.locale];
/** เลื่อนโฟกัสด้วยลูกศรขึ้น/ลงในเมนู (role="menu" ต้องรองรับคีย์บอร์ด) */
function handleMenuKeyDown(event: ReactKeyboardEvent<HTMLDivElement>) {
if (event.key !== "ArrowDown" && event.key !== "ArrowUp") return;
event.preventDefault();
const items = Array.from(
wrapperRef.current?.querySelectorAll<HTMLButtonElement>(
'[role="menuitemradio"]',
) ?? [],
);
if (items.length === 0) return;
const currentIndex = items.indexOf(
document.activeElement as HTMLButtonElement,
);
const step = event.key === "ArrowDown" ? 1 : -1;
const nextIndex = (currentIndex + step + items.length) % items.length;
items[nextIndex]?.focus();
}
function choose(next: Locale) {
setLocale(next);
setOpen(false);
triggerRef.current?.focus();
}
return (
<div ref={wrapperRef} className="relative">
<button
ref={triggerRef}
type="button"
aria-haspopup="menu"
aria-expanded={open}
aria-label={`${messages.nav.language}: ${current.name}`}
title={current.name}
onClick={() => setOpen((value) => !value)}
className="flex min-h-10 items-center gap-1.5 rounded-lg px-2 text-sm text-[#B3B3B3] transition hover:text-white focus-visible:outline focus-visible:outline-2 focus-visible:outline-[#A92626] after:absolute after:-inset-y-1 after:-inset-x-0.5 after:content-[''] sm:gap-2"
>
<CurrentFlag />
<span className="font-medium leading-none">{current.code}</span>
<IconChevronDown
size={14}
aria-hidden="true"
className={`transition-transform duration-200 ${open ? "rotate-180" : ""}`}
/>
</button>
{open ? (
<div
role="menu"
aria-label={messages.nav.language}
onKeyDown={handleMenuKeyDown}
className="absolute right-0 top-[calc(100%+8px)] z-30 flex w-[190px] flex-col gap-1 rounded-xl border border-[#303030] bg-[#141414] p-2 shadow-lg"
>
{LOCALE_OPTIONS.map((option) => {
const Flag = FLAGS[option.locale];
const isActive = option.locale === locale;
return (
<button
key={option.locale}
type="button"
role="menuitemradio"
aria-checked={isActive}
lang={option.locale}
onClick={() => choose(option.locale)}
className={`flex min-h-11 items-center gap-2 rounded-lg px-2.5 text-sm transition ${
isActive
? "bg-[#242424] font-semibold text-[#D47272]"
: "text-[#B3B3B3] hover:bg-[#1B1B1B] hover:text-white"
}`}
>
<Flag />
<span className="flex-1 text-left">{option.name}</span>
{isActive ? <IconCheck size={16} aria-hidden="true" /> : null}
</button>
);
})}
</div>
) : null}
</div>
);
}