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
+139
@@ -261,3 +261,142 @@
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: hsl(var(--muted-foreground) / 0.34);
|
||||
}
|
||||
|
||||
/* ══ Motion — อนิเมชันเล็ก ๆ ตอนโหลด/เลื่อน ═══════════════════════════════
|
||||
เปิดใช้เฉพาะเมื่อผู้ใช้ไม่ได้ขอ reduced motion: สคริปต์ใน <head> (root.tsx)
|
||||
ใส่คลาส .fx-motion ให้ <html> ก่อน paint → ไม่กระพริบ และถ้าปิด JS ไว้
|
||||
เนื้อหาก็ยังแสดงครบเพราะไม่มีคลาสนี้ = ไม่มีอะไรถูกซ่อน
|
||||
กติกา: ใช้ transform/opacity เท่านั้น (ไม่กระตุก), หน่วงไม่เกิน ~360ms */
|
||||
:root {
|
||||
--fx-fast: 160ms;
|
||||
--fx-base: 280ms;
|
||||
--fx-page: 460ms;
|
||||
--fx-slow: 640ms;
|
||||
--fx-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
|
||||
}
|
||||
|
||||
@keyframes fx-rise-in {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translate3d(0, 28px, 0);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes fx-fade-in {
|
||||
from {
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes fx-pop-in {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: scale(0.965);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes fx-drop-in {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translate3d(0, -14px, 0);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes fx-hero-zoom {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: scale(1.06);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes fx-page-in {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translate3d(0, 26px, 0);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* สถานะตั้งต้น: ซ่อนเฉพาะเมื่อ motion เปิดอยู่ (JS ใส่คลาสแล้วเท่านั้น) */
|
||||
html.fx-motion [data-reveal] {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
html.fx-motion [data-reveal="rise"][data-revealed] {
|
||||
animation: fx-rise-in var(--fx-slow) var(--fx-ease-out) var(--fx-delay, 0ms)
|
||||
both;
|
||||
}
|
||||
|
||||
html.fx-motion [data-reveal="fade"][data-revealed] {
|
||||
animation: fx-fade-in var(--fx-base) var(--fx-ease-out) var(--fx-delay, 0ms)
|
||||
both;
|
||||
}
|
||||
|
||||
html.fx-motion [data-reveal="zoom"][data-revealed] {
|
||||
animation: fx-pop-in var(--fx-slow) var(--fx-ease-out) var(--fx-delay, 0ms)
|
||||
both;
|
||||
}
|
||||
|
||||
/* อนิเมชันตอนโหลด (ไม่ผูกกับ scroll) */
|
||||
html.fx-motion .fx-page {
|
||||
animation: fx-page-in var(--fx-page) var(--fx-ease-out) both;
|
||||
}
|
||||
|
||||
/* สลับภาพในแกลเลอรี (ปุ่มลูกศร) — จางเข้าเบา ๆ ไม่กระตุก */
|
||||
@keyframes fx-swap-in {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: scale(1.015);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
|
||||
html.fx-motion .fx-swap {
|
||||
animation: fx-swap-in 320ms var(--fx-ease-out) both;
|
||||
}
|
||||
|
||||
html.fx-motion .fx-drop {
|
||||
animation: fx-drop-in var(--fx-base) var(--fx-ease-out) both;
|
||||
}
|
||||
|
||||
html.fx-motion .fx-hero-image {
|
||||
animation: fx-hero-zoom 1400ms var(--fx-ease-out) both;
|
||||
}
|
||||
|
||||
/* ทางออกสุดท้าย: ถ้าผู้ใช้ขอ reduced motion ให้ทุกอย่างนิ่งและเห็นครบ */
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
html.fx-motion [data-reveal],
|
||||
html.fx-motion .fx-page,
|
||||
html.fx-motion .fx-drop,
|
||||
html.fx-motion .fx-swap,
|
||||
html.fx-motion .fx-hero-image {
|
||||
animation: none !important;
|
||||
opacity: 1 !important;
|
||||
transform: none !important;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user