feat: บทความ 2 หน้า + แชร์/ลิงก์ย่อ + PWA + แอนิเมชัน + SEO/AI + เอกสาร
- บทความจากหลังบ้าน: /for-film-lovers, /for-cinemas (ArticlePage + ArticleEditor แบบบล็อกย่อหน้า/รูป) - แชร์: ปุ่มบนการ์ดและท้ายหน้ารายละเอียด · ลิงก์ย่อ /c/<slug> (302) · ธีมแก้วตาม DESIGN.md - PWA: manifest/sw/offline + ถอดการล็อกซูม (WCAG 1.4.4) + touch target ≥44px - แอนิเมชัน reveal: IntersectionObserver + gate ด้วย html.fx-motion · เคารพ prefers-reduced-motion - ค้นหา: normalize/ตัดวรรณยุกต์ + AND หลายคำ + จัดอันดับ · รองรับ /?q= จาก SearchAction - SEO: pageMeta (canonical/OG/Twitter) + JSON-LD (WebSite/Organization/BreadcrumbList/MovieTheater/Article) - ไม่ฝังโดเมนในโค้ด: origin มาจาก request (x-forwarded-host/proto) ทั้ง canonical, sitemap, robots, ลิงก์แชร์ - กัน AI: robots.txt (Nitro route, บล็อก AI 21 ตัว) + ai.txt + OG image 1200x630 - เอกสาร: README สรุปโปรเจกต์, DESIGN.md (motion/PWA/SEO/ข้อมูล), architecture.html, admin-guide - tests: 135 ผ่าน (16 ไฟล์)
This commit is contained in:
1 parent
1e84023a44
commit
319c271d23
72 files changed
+4731
-765
No files matched your search
@@ -1,7 +1,8 @@
|
||||
import { Link, useLocation } from "react-router";
|
||||
|
||||
import { Logo } from "@/components/site/Logo";
|
||||
import { LocaleSwitcher } from "@/components/site/LocaleSwitcher";
|
||||
import { Logo } from "@/components/site/Logo";
|
||||
import { NavLink } from "@/components/site/NavLink";
|
||||
import { useI18n } from "@/lib/i18n";
|
||||
|
||||
/**
|
||||
@@ -11,26 +12,61 @@ import { useI18n } from "@/lib/i18n";
|
||||
export function SiteHeader() {
|
||||
const { messages } = useI18n();
|
||||
const { pathname } = useLocation();
|
||||
const isAbout = pathname.startsWith("/about");
|
||||
|
||||
// เมนูหลัก: หน้าเฉพาะกลุ่มมาก่อน แล้วปิดท้ายด้วย "เกี่ยวกับเรา"
|
||||
const links: Array<{ to: string; label: string }> = [
|
||||
{ to: "/for-film-lovers", label: messages.nav.forFilmLovers },
|
||||
{ to: "/for-cinemas", label: messages.nav.forCinemas },
|
||||
{ to: "/about", label: messages.nav.about },
|
||||
];
|
||||
|
||||
return (
|
||||
<header className="relative z-10 mx-auto flex h-[68px] w-full max-w-[1440px] items-center justify-between gap-4 px-5 md:px-[108px]">
|
||||
<Link to="/" aria-label={`AlterFlixHub — ${messages.nav.home}`} className="shrink-0">
|
||||
<header className="fx-drop relative z-10 mx-auto flex h-[68px] w-full max-w-[1440px] items-center justify-between gap-3 px-5 md:px-[108px]">
|
||||
<Link
|
||||
to="/"
|
||||
aria-label={`AlterFlixHub — ${messages.nav.home}`}
|
||||
className="shrink-0"
|
||||
>
|
||||
<Logo />
|
||||
</Link>
|
||||
|
||||
<div className="flex items-center gap-1.5 sm:gap-2">
|
||||
<Link
|
||||
to="/about"
|
||||
aria-current={isAbout ? "page" : undefined}
|
||||
className={`rounded-lg border px-2 py-1 text-xs transition sm:px-3 sm:py-1.5 sm:text-sm ${
|
||||
isAbout
|
||||
? "border-[#A92626] bg-[#8F0808]/20 text-white"
|
||||
: "border-[#303030] text-[#B3B3B3] hover:border-[#A92626]/60 hover:text-white"
|
||||
}`}
|
||||
{/* มือถือ: เมนูพับ (ใช้ <details> เนทีฟ — คีย์บอร์ด/ปิดด้วย Esc ได้เอง) */}
|
||||
<details className="group relative sm:hidden">
|
||||
<summary className="flex min-h-10 cursor-pointer list-none items-center rounded-lg border border-[#303030] px-3 text-sm text-[#B3B3B3] transition hover:border-[#A92626]/60 hover:text-white [&::-webkit-details-marker]:hidden">
|
||||
{messages.nav.menu}
|
||||
</summary>
|
||||
<nav
|
||||
aria-label={messages.nav.menu}
|
||||
className="absolute right-0 top-[calc(100%+8px)] z-20 flex w-[220px] flex-col gap-1 rounded-xl border border-[#303030] bg-[#141414] p-2 shadow-lg"
|
||||
>
|
||||
{links.map((link) => (
|
||||
<NavLink
|
||||
key={link.to}
|
||||
to={link.to}
|
||||
label={link.label}
|
||||
isActive={pathname.startsWith(link.to)}
|
||||
variant="panel"
|
||||
/>
|
||||
))}
|
||||
</nav>
|
||||
</details>
|
||||
|
||||
{/* เดสก์ท็อป: ลิงก์ตรงทั้งสามหน้า */}
|
||||
<nav
|
||||
aria-label={messages.nav.menu}
|
||||
className="hidden items-center gap-2 sm:flex"
|
||||
>
|
||||
{messages.nav.about}
|
||||
</Link>
|
||||
{links.map((link) => (
|
||||
<NavLink
|
||||
key={link.to}
|
||||
to={link.to}
|
||||
label={link.label}
|
||||
isActive={pathname.startsWith(link.to)}
|
||||
variant="bar"
|
||||
/>
|
||||
))}
|
||||
</nav>
|
||||
|
||||
<LocaleSwitcher />
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user