From d27c3dc91302fcde3ef32ae908f81f6fe5f043ee Mon Sep 17 00:00:00 2001 From: Bkk1234 Date: Thu, 19 Nov 2026 11:48:03 +0700 Subject: [PATCH] feat(hero): add the hobbyproject wordmark with split browns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 'hobbyp' + 'j' in brand-900 (12.21:1), 'ro' + 'ect' in brand-500 (3.12:1) so the reader connects hobbypj with hobby project - caption under it: 'hobbypj ย่อมาจาก hobby project' - wordmark is 24-32px bold, the size at which the light brown still passes AA large text - entrance animation with the rest of the hero; aria-label keeps the whole word for screen readers - DESIGN.md records the colour split and the size rule --- DESIGN.md | 1 + assets/css/home.css | 22 +++++++++++++++++++++- assets/css/motion.css | 6 ++++++ ui/views/home.js | 2 ++ 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/DESIGN.md b/DESIGN.md index 00af4bc..da0d44a 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -50,6 +50,7 @@ - **ปุ่ม**: สูงขั้นต่ำ 44px (44×44 ตาม WCAG 2.5.8) · `primary` (น้ำตาลเข้ม+ขาว) · `ghost` (ขาว+ขอบ) · `quiet` · `danger` - **ช่องค้นหา**: pill, เงา, ไอคอนซ้าย, ปุ่มล้างคำค้นหา 32×32 (มี label ให้ screen reader) - **การ์ดโปรเจค**: ไอคอน 46×46 (พื้น `--brand-50`), ชื่อเป็นลิงก์ที่ขยายพื้นที่คลิกเต็มใบด้วย `::after`, คำอธิบาย 3 บรรทัดตัดด้วย `-webkit-line-clamp`, ท้ายการ์ดมี host + “เปิดเว็บไซต์” +- **คำว่า `hobbyproject` ในฮีโร่**: แบ่งสีตามตัวอักษร — `hobbyp` + `j` ใช้ `--brand-900` (#3D241A, 12.21:1) และ `ro` + `ect` ใช้ `--brand-500` (#C4703C, 3.12:1 บนพื้นฮีโร่เข้มสุด) จึงต้องมีขนาด ≥24px ตัวหนาขึ้นไป (ตอนนี้ clamp 24–32px) ถ้าลดต่ำกว่านั้นต้องเปลี่ยนไปใช้ `--brand-600` (#A85A2C, 4.30:1) เพื่อให้ผ่าน 4.5:1 ของตัวอักษรปกติ · ใต้คำมีบรรทัดอธิบาย `hobbypj ย่อมาจาก hobby project` (13px, `--muted-foreground`) - **ฮีโร่**: พื้นไล่เฉดอุ่นอ่อน + การ์ดลอย 3 ใบ **สุ่มจากโปรเจคทั้งหมดใหม่ทุกครั้งที่โหลดหน้า** (Fisher–Yates, ไม่ซ้ำ) แสดงเฉพาะ ≥1080px, `aria-hidden` - **หลังบ้าน**: พาเนล + การ์ดรายการ, ปุ่มเลื่อนขึ้น/ลง/ลบ, แถบบันทึกแบบ sticky ด้านล่าง, `` ยืนยันการลบ/ทิ้งการแก้ไข diff --git a/assets/css/home.css b/assets/css/home.css index c3ad3f6..d4f1723 100644 --- a/assets/css/home.css +++ b/assets/css/home.css @@ -33,12 +33,32 @@ height: 15px; } .hero__title { - margin-top: var(--space-4); + margin-top: var(--space-3); font-size: clamp(1.6rem, 1.15rem + 2.05vw, 2.5rem); letter-spacing: -0.015em; line-height: 1.35; max-width: 24ch; } + +/* --------------------------------------------------- คำว่า hobbyproject */ +.hero__wordmark { + margin-top: var(--space-4); + font-size: clamp(1.5rem, 1.15rem + 1.05vw, 2rem); + font-weight: 700; + line-height: 1.15; + letter-spacing: -0.02em; +} +.hero__wordmark .wm-dark { + color: var(--brand-900); /* 12.21:1 บนพื้นฮีโร่เข้มสุด */ +} +.hero__wordmark .wm-light { + color: var(--brand-500); /* 3.12:1 — ผ่านเกณฑ์ large text (≥24px ตัวหนา) */ +} +.hero__wordmark-note { + margin-top: 6px; + font-size: 13px; + color: var(--muted-foreground); +} .hero__title em { font-style: normal; color: var(--brand-600); diff --git a/assets/css/motion.css b/assets/css/motion.css index 0fa4ac5..31fcdb4 100644 --- a/assets/css/motion.css +++ b/assets/css/motion.css @@ -121,6 +121,12 @@ html.fx-motion .hero__eyebrow { html.fx-motion .hero__lead { animation: fx-rise-in 620ms var(--ease) 520ms both; } +html.fx-motion .hero__wordmark { + animation: fx-rise-in 640ms cubic-bezier(0.16, 0.84, 0.28, 1) 260ms both; +} +html.fx-motion .hero__wordmark-note { + animation: fx-fade-in 520ms var(--ease) 420ms both; +} html.fx-motion .searchbar { animation: fx-pop-in 680ms cubic-bezier(0.16, 0.84, 0.28, 1) 600ms both; } diff --git a/ui/views/home.js b/ui/views/home.js index 4d7e91b..b6cf017 100644 --- a/ui/views/home.js +++ b/ui/views/home.js @@ -104,6 +104,8 @@ export function homeView(ctx) {

${icon("spark")}${escapeHtml( site.site_title, )}

+

hobbyproject

+

hobbypj ย่อมาจาก hobby project

${splitWordsHtml( site.welcome_message, escapeHtml,