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
@@ -0,0 +1,41 @@
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
import { useReveal } from "@/hooks/use-reveal";
|
||||
import type { RevealKind } from "@/lib/motion";
|
||||
|
||||
type RevealProps = {
|
||||
children: ReactNode;
|
||||
/** rise = เลื่อนขึ้นเบา ๆ (ค่าตั้งต้น) · fade = จางเข้าอย่างเดียว · zoom = ขยายเล็กน้อย */
|
||||
kind?: RevealKind;
|
||||
/** หน่วงก่อนเริ่ม (ms) — ใช้ทำจังหวะไล่กันในกริด/คอลัมน์ */
|
||||
delay?: number;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* ห่อบล็อกให้ "ค่อย ๆ โผล่" เมื่อเลื่อนมาถึง
|
||||
*
|
||||
* ใช้ `data-revealed` เป็น attribute ว่าง (ไม่ใช่ boolean) เพราะ CSS เลือกด้วย
|
||||
* selector `[data-revealed]` ใน global.css
|
||||
* เป็น <div> ธรรมดา — ใช้ในบริบท block/flex/grid เท่านั้น (ไม่ใช้กับ inline)
|
||||
*/
|
||||
export function Reveal({
|
||||
children,
|
||||
kind = "rise",
|
||||
delay = 0,
|
||||
className,
|
||||
}: RevealProps) {
|
||||
const { ref, revealed, style } = useReveal<HTMLDivElement>(delay);
|
||||
|
||||
return (
|
||||
<div
|
||||
ref={ref}
|
||||
data-reveal={kind}
|
||||
data-revealed={revealed ? "" : undefined}
|
||||
style={style}
|
||||
className={className}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user