Files
web-alterflixhub/app/global.css
T
Bkk1234 319c271d23 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 ไฟล์)
2026-11-10 02:31:10 +07:00

403 lines
10 KiB
CSS

@import url("https://fonts.googleapis.com/css2?family=Jersey+15&family=Noto+Sans+Thai:wght@400;500;600;700&display=swap");
@import "@fontsource-variable/inter";
@import "@fontsource/ibm-plex-sans-thai-looped/400.css";
@import "@fontsource/ibm-plex-sans-thai-looped/500.css";
@import "tailwindcss";
@import "@agent-native/toolkit/styles.css";
@source "./**/*.{ts,tsx}";
/* ฟอนต์เนื้อหายาว (มีหัว) — หัวข้อและ UI ยังใช้ Inter + Noto Sans Thai ตาม DESIGN.md */
@theme {
--font-content: "IBM Plex Sans Thai Looped", "Noto Sans Thai", sans-serif;
}
:root {
--background: 0 0% 100%;
--foreground: 0 0% 10%;
--card: 0 0% 100%;
--card-foreground: 0 0% 10%;
--popover: 0 0% 100%;
--popover-foreground: 0 0% 10%;
--primary: 0 0% 15%;
--primary-foreground: 0 0% 100%;
--secondary: 0 0% 95%;
--secondary-foreground: 0 0% 15%;
--muted: 0 0% 95%;
--muted-foreground: 0 0% 45%;
--accent: 0 0% 95%;
--accent-foreground: 0 0% 15%;
--destructive: 0 91% 71%;
--destructive-foreground: 0 0% 98%;
--border: 0 0% 90%;
--input: 0 0% 90%;
--ring: 0 0% 40%;
--radius: 0.5rem;
--sidebar-background: 0 0% 97%;
--sidebar-foreground: 0 0% 45%;
--sidebar-primary: 0 0% 15%;
--sidebar-primary-foreground: 0 0% 100%;
--sidebar-accent: 0 0% 95%;
--sidebar-accent-foreground: 0 0% 15%;
--sidebar-border: 0 0% 90%;
--sidebar-ring: 0 0% 40%;
--chat-sidebar-width: 17.25rem;
--chat-sidebar-content-inset: 0.5rem;
--chat-sidebar-row-padding: 0.75rem;
--chat-sidebar-title-fade: 1.25rem;
}
.chat-layout-shell {
--agent-layout-left-drawer-expanded-width: var(--chat-sidebar-width);
--agent-native-lower-surface: var(--agent-kit-nav-surface);
}
.agentkit-chat-empty-copy {
text-align: center;
}
.agentkit-chat-empty-copy h1 {
margin: 0;
color: hsl(var(--foreground));
font-size: 1.5rem;
font-weight: 600;
letter-spacing: -0.02em;
}
.agent-kit-chat-footer-stack {
inline-size: min(100%, 47rem);
margin-inline: auto;
pointer-events: auto;
}
.agent-kit-chat-footer-stack > .agentkit-composer-stack {
inline-size: 100%;
}
.agent-kit-chat-guided-question {
max-block-size: min(32rem, 58dvh);
overflow: auto;
margin-block-end: 0.5rem;
border: 1px solid var(--agentkit-border);
border-radius: var(--agentkit-radius);
background: var(--agentkit-surface);
box-shadow: var(--agentkit-elevation);
}
.chat-sidebar-history .an-chat-history__list {
padding-top: 0;
}
.chat-sidebar-history .an-chat-history__section-label {
padding: 8px
calc(var(--chat-sidebar-content-inset) + var(--chat-sidebar-row-padding))
5px;
color: hsl(var(--sidebar-foreground) / 0.66);
font-size: 11px;
font-weight: 500;
letter-spacing: 0;
text-transform: none;
}
.chat-sidebar-history.an-chat-history--rail .an-chat-history-row {
margin-inline: var(--chat-sidebar-content-inset);
border-radius: calc(var(--radius) + 2px);
}
.chat-sidebar-history.an-chat-history--rail .an-chat-history-row__button {
min-height: 34px;
padding-block: 7px;
padding-inline: var(--chat-sidebar-row-padding);
color: hsl(var(--sidebar-foreground));
}
.chat-sidebar-history.an-chat-history--rail
.an-chat-history-row--has-menu
.an-chat-history-row__button {
padding-inline-end: calc(var(--chat-sidebar-row-padding) + 1.5rem);
}
.chat-sidebar-history .an-chat-history-row__title {
flex: 1 1 auto;
color: hsl(var(--sidebar-accent-foreground));
font-size: 13px;
font-weight: 400;
text-overflow: clip;
}
.chat-sidebar-thread-title-shell {
display: flex;
min-width: 0;
align-items: center;
gap: 6px;
}
.chat-sidebar-thread-title {
display: block;
flex: 1 1 auto;
min-width: 0;
overflow: hidden;
white-space: nowrap;
}
.chat-sidebar-thread-running {
color: hsl(var(--sidebar-foreground) / 0.72);
}
.chat-sidebar-thread-title[data-overflow="true"] {
mask-image: linear-gradient(
to right,
hsl(var(--foreground)) 0,
hsl(var(--foreground)) calc(100% - var(--chat-sidebar-title-fade)),
hsl(var(--foreground) / 0) 100%
);
}
.chat-sidebar-thread-title__content {
display: block;
width: max-content;
transform: translateX(0);
}
.an-chat-history-row:hover
.chat-sidebar-thread-title[data-overflow="true"]
.chat-sidebar-thread-title__content {
animation: chat-sidebar-title-reveal
var(--chat-sidebar-title-duration, 1800ms) ease-in-out 350ms;
}
.chat-sidebar-thread-details {
border-color: hsl(var(--sidebar-border));
}
.chat-sidebar-history.an-chat-history--rail
.an-chat-history-row__menu-trigger--pinned {
pointer-events: none;
opacity: 0;
}
.chat-sidebar-history.an-chat-history--rail
.an-chat-history-row:hover
.an-chat-history-row__menu-trigger--pinned,
.chat-sidebar-history.an-chat-history--rail
.an-chat-history-row:focus-within
.an-chat-history-row__menu-trigger--pinned,
.chat-sidebar-history.an-chat-history--rail
.an-chat-history-row__menu-trigger--pinned[aria-expanded="true"] {
pointer-events: auto;
opacity: 1;
}
@keyframes chat-sidebar-title-reveal {
to {
transform: translateX(calc(-1 * var(--chat-sidebar-title-shift, 0px)));
}
}
@media (prefers-reduced-motion: reduce) {
.an-chat-history-row:hover .chat-sidebar-thread-title__content {
animation: none;
}
}
.chat-sidebar-history.an-chat-history--rail
.an-chat-history-row--active
.an-chat-history-row__button {
background: hsl(var(--sidebar-accent));
color: hsl(var(--sidebar-accent-foreground));
}
.dark {
--background: 0 0% 13%;
--foreground: 0 0% 90%;
--card: 0 0% 16.47%;
--card-foreground: 0 0% 90%;
--popover: 0 0% 15%;
--popover-foreground: 0 0% 90%;
--primary: 0 0% 75%;
--primary-foreground: 0 0% 10%;
--secondary: 0 0% 18%;
--secondary-foreground: 0 0% 90%;
--muted: 0 0% 16%;
--muted-foreground: 0 0% 60%;
--accent: 0 0% 18%;
--accent-foreground: 0 0% 90%;
--destructive: 0 84% 60%;
--destructive-foreground: 0 0% 98%;
--border: 0 0% 24%;
--input: 0 0% 24%;
--ring: 0 0% 60%;
--radius: 0.5rem;
--sidebar-background: 0 0% 10%;
--sidebar-foreground: 0 0% 60%;
--sidebar-primary: 0 0% 75%;
--sidebar-primary-foreground: 0 0% 10%;
--sidebar-accent: 0 0% 16%;
--sidebar-accent-foreground: 0 0% 90%;
--sidebar-border: 0 0% 20%;
--sidebar-ring: 0 0% 60%;
}
@layer base {
body {
@apply bg-background text-foreground;
font-family: "Inter Variable", "Inter", "Noto Sans Thai", sans-serif;
font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}
}
::-webkit-scrollbar {
width: 5px;
height: 5px;
}
::-webkit-scrollbar-track {
background: transparent;
}
::-webkit-scrollbar-thumb {
background: hsl(var(--muted-foreground) / 0.22);
border-radius: 3px;
}
::-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;
}
}