Commit Graph
36 Commits
Author SHA1 Message Date
Bkk1234 eabcff197c navbar: rebuild mock header from the Next implementation (source of truth)
- markup: lang + theme moved into .mu-topbar-tools (theme first, then lang),
  same order as web-at-transit: brand, nav, menu, tools, CTA
- CSS: replaced mock's .mu-lang-*/.mu-theme-* buttons with the Next rules
  (.mu-pop / .mu-pop-btn / .mu-pop-btn-lang / .mu-pop-panel / .mu-pop-item,
  40px tall, radius 8px, surface bg, 44px on coarse pointers)
- lang button keeps short label + 12px chevron; menu items use
  .mu-pop-item-th/.mu-pop-item-en and data-active for the selected row
- nav 0.95rem (was .92rem), header border -> var(--c-border)
- theme.js was never included in the shell (regex missed the versioned src) —
  added after i18n.js + precached with theme.css; that was why the theme menu
  did not open in the previous build
- VERSION 2026.09.27.120
2026-11-04 01:37:50 +07:00
Bkk1234 5800a61da3 theme: align nav colours with the shared tokens (parity with Next)
- .mu-nav a -> var(--c-ink-2), .mu-nav a.active -> var(--c-danger)
  so light and dark render identically in both projects
- VERSION 2026.09.27.116
2026-11-04 01:30:32 +07:00
Bkk1234 cdfd77ffff theme: dark mode + theme tokens (parity with web-at-transit)
- ui/theme.css: token set copied value-for-value from the Next app
  (--c-surface/-ink/-border/-brand/-tint/-glass + radius), light and dark blocks
- ui/theme.js: 3-mode switch (light / dark / auto=prefers-color-scheme) with a
  header dropdown, aria-haspopup/menu, Esc/outside close, live matchMedia listener
- index.html: pre-paint theme script (no flash), theme.css link before _shared.css
- remapped ~290 literal colours in _shared.css/index.html/partials to var(--c-*)
  so both projects render from the same tokens; dark patch block covers the
  remaining decorative gradients
- DESIGN.md: new section 3.2 (theme tokens + where to add colours)
- VERSION 2026.09.27.114
2026-11-04 01:29:37 +07:00
Bkk1234 bea8f0773e header: language dropdown + Thai as default language
- replace the two inline TH/EN buttons with a single dropdown (icon + label +
  caret) mirroring the Next app's LangSwitch: aria-haspopup/expanded,
  menuitemradio + aria-checked, close on Esc/outside, focus management
- i18n.js: default language is Thai (no longer guesses from navigator.language);
  saved choice still wins via at_lang
- bump VERSION 2026.09.27.109
2026-11-04 01:17:32 +07:00
Bkk1234 fcdab3ac80 pwa: automatic update UX - no more hard refresh
- ui/version.json: server-side version marker, polled by pwa.js (load, 5 min,
  tab focus, network online); mismatch -> toast + auto reload once per version
- pwa.js: silent reload when tab hidden, guarded reload (sessionStorage) so a
  partial deploy cannot loop, ATUpdate.check() exposed for testing
- _shared.css: .mu-update-toast pill (bottom center, reduced-motion aware)
- shell js/css get ?v=<version> automatically (bump-version.py) so HTTP cache
  cannot serve stale files before the service worker takes control
- sw: cache fallback now ignores query string (precache still matches ?v= URLs)
- bump-version.py: writes version.json + verifies it in --check
- VERSION 2026.09.27.108
2026-11-03 00:32:41 +07:00
Bkk1234 449afb923a pwa: remove floating install-app button
- drop beforeinstallprompt handler + .mu-install-btn markup from ui/pwa.js
- remove .mu-install-btn styles from _shared.css
- drop unused pwa.install i18n key (th/en)
- SW registration/auto-update untouched; VERSION 2026.09.27.107
2026-11-03 00:20:30 +07:00
Bkk1234 4acb43ff45 footer: remove visitor counter (12,834) and its reset dialog
- drop .mu-visitor markup + styles from ui/index.html
- delete ui/visitors.js (unused), remove from shell + sw PRECACHE
- drop unused visitors.* i18n keys (th/en)
- VERSION 2026.09.27.106
2026-11-03 00:15:54 +07:00
Bkk1234 2504c39305 analytics: privacy-first search stats (Umami-style), #/stats page
- ui/analytics.js: cookie-less local-first tracker (localStorage), DNT/GPC
  honoured, opt-out switch, term sanitiser (email/@handle/long digits stripped),
  900ms debounce, caps 300 terms / 200 views / 120 days
- optional Umami-compatible beacon (window.AT_ANALYTICS endpoint+siteId),
  disabled by default: no third-party requests unless the owner configures it
- #/stats view: KPIs, 14-day CSS bar chart, top terms, top route/stop pages,
  no-result terms, privacy panel, JSON export, clear, opt-out
- hooks: busStop search apply(), stopDetail route filter, hashchange pageviews
- i18n th/en (395 keys each), credits section, sw.js precache + VERSION 2026.09.27.105
2026-11-03 00:07:57 +07:00
Bkk1234 5381e0690a ui: add shared motion layer (page enter, scroll reveal, loading bar)
- ui/motion.js: Motion.enter/scan/loading, IntersectionObserver reveal with
  sweep fallback for jump-scroll, hidden tab and late-rendered cards
- _shared.css: --mu-ease token, .mu-loadbar, #view.mu-view-in, .mu-reveal
- router.js: start/stop loading bar, replay enter animation per view
- reduced-motion disables everything; maps are never transformed
- sw.js: precache motion.js, VERSION 2026.09.27.104
2026-11-02 23:56:16 +07:00
Bkk1234 ba5f4fd887 about/blog: revised copy for text2/3/4 and text5/7 2026-10-24 13:51:10 +07:00
Bkk1234 9b8f1597db sync with web-at-transit: type scale, radius, hint colour, i18n
Pulled the newer values from the Next port where it had already been aligned
with DESIGN.md:
- .mu-search-tab font-size .88 -> .85rem
- .mu-btn border-radius 12px -> 8px (DESIGN allows 4/8/999 only)
- .mu-btn.ghost colour #5b3b71 -> #7a4cc0 (brand)
- .mu-search-hint colour #6f7b95 -> #5f6b83 (AA contrast) and .82 -> .85rem
- locales: share.label now 'แชร์หน้านี้' / 'Share this page', stops.nearHint
  matches the longer English copy
2026-10-24 00:53:09 +07:00
Bkk1234 0132c791ae stops: white search panel, drop the search button, purple reset 2026-10-24 00:46:30 +07:00
Bkk1234 d80c59de07 stops: white hero panel with a dark border 2026-10-24 00:43:48 +07:00
Bkk1234 aeb51c2ebd stops: make [hidden] actually hide the stop list
.mu-stop-grid sets display:grid, which overrides the hidden attribute, so the
list stayed visible on the near-me tab even though the code set hidden.
Same class of bug as .mu-search-mode, which now has an explicit [hidden] rule
in both repos.
2026-10-24 00:42:02 +07:00
Bkk1234 750b4a2ea8 mock: three search tabs - stop code, place name, near me
- busStop.html: added the third tab (data-mode=near) and its own panel with
  the location button, hint and result area; removed the near button from the
  toolbar and deleted the old on-screen numpad markup
- busStop.search.js: MODE_NEAR in setMode, disables the other panels, hides
  the stop list while ranked results are shown, skips filtering in that mode,
  and removed the dead initNumpad code
- security gate: the tab is revealed only when isSecureContext and
  navigator.geolocation exist; otherwise it stays hidden and the mode is
  refused
- map.js: re-enable the button after a successful lookup
- i18n: stops.modeNear / nearCta / nearHint
- bump SW version to 2026.09.27.98

Verified on localhost:8090 - three tabs, near mode shows a map with 8 ranked
stops, button re-enables and works again, switching back restores the list;
with isSecureContext forced false the tab is hidden and unselectable.
2026-10-24 00:11:56 +07:00
Bkk1234 74d605f1c4 ระบบ affiliate พาร์ทเนอร์ + นับผู้เข้าชม + สายที่เปิดดูบ่อย + ความปลอดภัยรูป
== ระบบพาร์ทเนอร์ (affiliate) ==
- resource/data/affiliates.json — ข้อมูล 11 โปรแกรม (8 ใน footer) + ที่วางลิงก์แนะนำ
- home.init.js: initSponsors() สร้างไทล์ marquee จาก JSON (ไม่ฮาร์ดโค้ดใน HTML)
    · มี affiliate_link → <a target=_blank rel="noopener sponsored">
    · ยังไม่มีลิงก์   → <span> แสดงรูปเฉย ๆ (กดไม่ได้ ไม่พาไปหน้าเปล่า)
    · โหลด JSON ไม่ได้ → คงไทล์ fallback ที่ฝังใน HTML (8 ไทล์)
- เติมลิงก์ affiliate แล้ว 6 แบรนด์: 7-Eleven · Shopee · Lazada · airasia MOVE ·
  busonlineticket · Trip.com

== ระบบสถิติ (ฝั่งเบราว์เซอร์ ไม่มี backend) ==
- ui/popular.js — "สายที่เปิดดูบ่อย" ใน footer
    · score = hits × 0.5^(อายุวัน/30) — กันคะแนนเฟ้อ (ครึ่งชีวิต 30 วัน)
    · ทิ้งข้อมูลที่ตายเกิน 180 วันอัตโนมัติ · เก็บ 2 ตัวเลข/สาย (~24 ไบต์)
    · ไม่มีข้อมูล → ใช้ค่าเริ่มต้น 101/902/15/464
- ui/visitors.js — นับผู้เข้าชมจริง (ฐาน 12,834)
    · กันเฟ้อ 3 ชั้น: sessionStorage (F5 ไม่นับ) → 1 ครั้ง/วัน → dayKey กันล้าง session
    · กดตัวเลข 5 ครั้ง → ช่องกรอกรหัส (SHA-256 ไม่เก็บรหัสจริงในโค้ด) → รีเซ็ตเป็น 0
- หัวข้อ footer เปลี่ยนเป็น "สายที่เปิดดูบ่อย" / "Most Viewed Routes"

== ความปลอดภัยของรูป ==
- images.zip: ลบ EXIF/GPS ทั้งหมด 12 ไฟล์ (piexif — ไม่แตะ pixel data, คง ICC profile)
    · ตัด .image/partners/_original/ ออก (ไฟล์สำรองที่ไม่ควรแจก)
    · ตรวจแล้ว: GPS=0 · EXIF=0 · รูปเสีย=0 · 39.4 MB → 37 MB
- tcl999-angthong.jpg ย่อ 4032×3024 (2.5 MB) → 700×525 (86 KB) สำหรับใช้บนเว็บ

== UI ==
- nav (mu-topbar) z-index 50 → 1100 + isolation:isolate ที่กรอบแผนที่
  (Leaflet ใช้ z-index ถึง 1000 — เดิมปุ่มซูม/ป๊อปอัปทะลุขึ้นทับ nav)
- รูปสำรองสถานี: ไม่มีรูป → แสดง minibus-512x512 (.is-fallback ใช้ object-fit:contain)
- affiliate.json เป็น CRLF ตาม pattern เดิมของโปรเจกต์
2026-10-07 23:29:36 +07:00
Bkk1234 488b4c6054 แผนที่ blog 4-5 จาก shapefile + แปล EN บทความ 3-4 + ป้าย tag บนแผนที่
== แผนที่บทความ (blog) ==
- blog/3: map ใหม่ 5 เส้นตามเนื้อหา (902 · 15 · 952 · 101 · 324) — เดิมเป็นสำเนาของ blog/2
- blog/4: map 2 แนวทางจาก QGIS Project/รถมินิบัส แสวงหา-กรุงเทพ
    · แนวทาง 1  แสวงหา-โพธิ์ทอง-กรุงเทพ (127.2 กม.)
    · แนวทาง 2  แยก 1011 เป็น 2 ช่วง: อ่างทอง-โพธิ์ทอง-แสวงหา + แสวงหา-สีบัวทอง
- blog/5: map 3 เส้นจาก QGIS Project/amphoeroutes (ข้อเสนอขั้นต่ำ)
    · สามโก้-วิเศษ-อ่างทอง · แสวงหา-โพธิ์ทอง-อ่างทอง · ไชโย-อ่างทอง-ป่าโมก
- ป้าย tag แสดงบนแผนที่ด้วย (.blog-mapx-tag มุมขวาบน — หลบปุ่มซูมของ Leaflet)

== เครื่องมือ qgis-to-web.py ==
- SHP_MAP +6 (รวมโฟลเดอร์ย่อย: รถมินิบัส แสวงหา-กรุงเทพ/ · amphoeroutes/)
- แก้บั๊ก: โหมด shp เคยตัด "-" ออกจากชื่อ dream-* ทำให้หา SHP_MAP ไม่เจอ

== ข้อความ (blog-data) ==
- text3: แปล EN ใหม่ให้ตรงกับ TH (เดิมเป็นสำเนาของ text2 — ชื่อการ์ดซ้ำกันใน #/blog)
- text4-6: ตรวจ/แปล EN ครบ · TH = EN ทุกไฟล์
- pic5.jpg · pic6.jpg (รูปประกอบบทความ 5-6)

== geojson ใหม่ 6 เส้น (dream-*) ==
sawangha-bangkok · angthong-phothong-sawangha · sawangha-srinuathong
samko-wisad-angthong · sawangha-phothong-angthong · chaiyo-angthong-pamok
2026-10-06 02:43:21 +07:00
Bkk1234 656f65b41c แผนที่จาก GPKG + บทความ 6 ชิ้น + ลดความหนา footer
== แผนที่ / GIS ==
- qgis-to-web.py: อ่าน GPKG ได้ (--from gpkg) + เพิ่ม dream-Watcharapol
- เพิ่ม dream-*.geojson 6 ไฟล์ (เส้นทางที่เสนอ: บ้านภาชี · ชานเมืองอยุธยา · HSR · เมืองทองธานี · ปากเกร็ด · วัชรพล)
- map.js: ATMap.proposal() วาดเส้นจริงจาก geojson (ไม่ใช่เส้นตรง) · smoothFactor 0.5
  · coordOf() รับ coords=[lat,lng] · fitAll รับได้ทั้งจุดเดี่ยวและเส้น · setStyle บน featureGroup

== บทความ (blog) ==
- text3: ถ้าผมได้ออกแบบสายเดินรถเอง (จาก mydream.html) TH+EN
- text4: วิธีเดินทางไปสถานีรถไฟ และสนามบิน (จาก train-airplane.html) TH+EN
- text5/text6: โครงเปล่ารอเติมเนื้อหา (แสวงหา-โพธิ์ทอง · อำเภอเข้าเมือง)
- แผนที่ความฝัน: map.groups 3 กลุ่ม · คลิกเส้น/หมุด/แถวได้ · ป้ายที่มา
- ย่อหน้า: ระยะห่าง 20px + ย่อหน้าหน้าบรรทัด 1.5em

== ตารางเดินรถ ==
- เปลี่ยนชื่อคีย์ dir_* -> direction_* ทุกไฟล์ (backward-compat ในโค้ด)
- 1011: จุดย่อย 2 ทิศ + offsets [0,25,55]
- 954/2194: จุดย่อย station 8 + offsets
- refreshHighlights: วนข้ามวันเมื่อเลยเที่ยวสุดท้าย + ไฮเทลต์ชิปทุกจุด
- 8 other_stop.md: อัปเดตตรงข้อมูลจริง 8 รายการ

== i18n ==
- แยกไฟล์ต่อภาษา ui/locales/{th,en}.json + i18n.js = loader (ลด 28KB -> 6.5KB)
- resource/tools/check-i18n.py ตรวจคีย์ขาด/ซ้ำ
- ข้อความผู้สนับสนุนหน้าแรก + คำแปล EN

== UI ==
- ฝังฟอนต์ K2D (ui/vendor/fonts/) ออฟไลน์ 100%
- cache busting ?v=<SW VERSION> ทุกรูป (ui/imageurl.js)
- footer: ลดความหนา 468 -> 349px + line-height 1.5 กันสระ/วรรณยุกต์ซ้อน
- QR modal + ปุ่มคัดลอกลิงก์ · หน้าอัปเดตล่าสุดใน #/check
- credits: ขอขอบคุณภาพรถ 3 สาย

== เครื่องมือ ==
- bump-version.py · stamp-schedules.py · derive-times.py (จุดอ้างอิง ± นาที)
2026-10-05 03:55:09 +07:00
Bkk1234 1cfaeb1526 ตารางเวลาคำนวณได้ + หน้ารายละเอียดป้ายขับเคลื่อนด้วยข้อมูล + แผนที่ Leaflet
Schedules — กติกา "จุดนี้ = เวลาจุดอ้างอิง ± n นาที"
- ฟิลด์ derive { from_station_id, offset_min } คำนวณที่ ui/partials/schedules.js (ท่อเดียว) รองรับอ้างจุดข้ามทิศ
- จุดย่อยของ "8 other_stop" ใช้ offsets_min จับคู่ตามลำดับ (เช่น ตลาดสามโก้ = ตลาดท่าช้าง +45 นาที)
- เครื่องมือ resource/tools/derive-times.py + ตาราง resource/data/derive-times.csv (--check / --audit ชี้จุดที่ควรตั้งกฎ)
- แยกตารางเป็นรายสาย: scheduleslist/schedules<route_id>.json และ schedules.json เป็นสารบัญ (โหลดแบบ lazy + cache)
- ตรวจจับวันทำงาน/วันหยุด + schema 3 (weekday/holiday → directions) · ไฟล์ข้อมูลเป็น CRLF ทั้งชุด
- ล้างค่าที่ไม่ใช่ HH:MM ที่ฝังใน times (ทำให้ KPI เพี้ยน) + กันค่าหลอกในตัวสรุปเวลา

UI
- หน้ารายละเอียดป้าย/ตารางเวลา ขับเคลื่อนด้วย JSON (stopDetail.init.js) · จุดขึ้นรถประจำทางอื่นๆ รองรับหลายจุดต่อสาย
- #/stops: แสดง 6 ป้ายแรก + ปุ่ม "แสดงป้ายทั้งหมด" (โหลดรูปเฉพาะที่แสดง) · ชิปสาย → #/routes/<route_id>
- หน้าแรก: ตัดตัวเลือก "ทุกสถานีในจังหวัดนี้" · ตัวกรองจังหวัด/สถานี + ปุ่มแชร์ (share URL)
- การ์ดติดต่อ: ไอคอน/ชื่อ/สีเปลี่ยนตามชนิด URL (Facebook / LINE / เว็บไซต์) + ปุ่มเปิดลิงก์จาก web_url
- รูปรองรับหลายนามสกุล (.jpg → .jpeg → .webp → .png) · ป้าย "ประมาณ" + หมายเหตุสำหรับตารางที่คำนวณ
- หน้าเครดิตเหลือ 3 หมวด · แก้ข้อความหมวดแผนที่ให้ตรงกับข้อมูลจริง
- แผนที่ Leaflet (vendor ในโปรเจกต์ ไม่ใช้ CDN): เส้นทาง + หมุด + ป๊อปอัป · แก้ CSS ที่ทำให้ SVG ยุบ 0x0

เครื่องมือและเอกสาร
- qgis-to-web.py อ่าน .shp ตรง → geojson-web (สร้างใหม่ 10 ไฟล์) + audit-geojson.py ตรวจ 3 ส่วน
- stop-km.py วัดระยะ กม. ตามเส้นจริง → stop-km.json · schedules-editor.html (แก้ทีละไฟล์ · มุมมองตารางแบบ Excel)
- AGENTS.md: กติกา derive · offsets_min · นามสกุลรูป · ชิปสาย · หน้ารายละเอียดป้ายมาจากไหน
2026-09-30 03:25:18 +07:00
Bkk1234 88311326e6 add schudual function 2026-09-25 04:20:16 +07:00
Bkk1234 d198430310 555 2026-09-23 00:53:14 +07:00
Bkk1234 4ac51969e2 add 2026-09-23 00:53:04 +07:00
Bkk1234 bea0fff388 add blog feature 2026-09-22 04:48:50 +07:00
phattaranun.a e4fb0eeefb fix: redesign path /routes 2026-09-12 17:56:13 +07:00
phattaranun.a 6b612e2758 feat: pwa and responsive 2026-09-12 17:21:19 +07:00
phattaranun.a 71dacc0da2 Eliminate horizontal scrolling on phone: wrap instead of scroll
- Topbar: switch from overflow-x:auto to a two-line layout on mobile
  (brand + language on line 1, nav full-width on line 2) so the header
  never scrolls left/right
- Province filter strip: flex-wrap instead of overflow-x:auto so the
  province chips wrap onto multiple lines
- Reset topbar/nav to single-line at >=640px

Site now scrolls vertically only on phone; zero user horizontal scroll.
2026-09-12 16:04:57 +07:00
phattaranun.a 0ac33f0735 Tighten mobile layout: fix hero height and tap targets
- Fix .mu-select-field flex-basis bug: flex:1 1 250px became a 250px
  HEIGHT basis when the selector stacks to a column on phone, bloating
  the home/check heroes to ~700-760px. Reset to flex:0 0 auto (content
  height) -> heroes now ~350-420px
- Enlarge tap targets on phone: language buttons 21px -> 40px, footer
  links and contact link -> 44px min-height

Verified with headless Chrome: 0 horizontal overflow at 320-1600px, hero
heights sane on phone.
2026-09-12 15:51:05 +07:00
phattaranun.a 0a464b6b18 Fix horizontal overflow across the site on phone and tablet widths
- Add box-sizing: border-box and img/svg/video max-width:100% reset
- Add min-width:0 to grid/flex children so they can shrink (hero panel,
  layout grid, metric grid)
- Allow long text to wrap (mock-state query strings, long stop names)
- Topbar: hide CTA button until 1024px, hide brand subtitle until 768px,
  and wrap the bar onto two lines under 360px so nav is never cut off

Verified with headless Chrome at 320/375/414/640/768/1024/1280/1600px:
zero horizontal overflow on all 7 routes.
2026-09-12 15:41:45 +07:00
phattaranun.a 82aafdc61f Rename hidden image folder .resource/ to .image/
.resource/ clashed with resource/ (the tracked data folder), so rename the
hidden image folder to .image/ for clarity. Re-zip resource/images.zip to
contain .image/ and update setup.sh, .gitignore, README.md, AGENTS.md and
all image references in ui/.
2026-09-12 12:40:29 +07:00
phattaranun.a 670afcb773 Move images to hidden .resource/ folder
- Rename resource/images/ to .resource/ (dot-prefixed, gitignored, never pushed)
- Repackage resource/images.zip to contain .resource/ at the archive root
- Update setup.sh to extract the zip to .resource/
- Update all image references from ../resource/images/ to ../.resource/
  across ui HTML, manifest.json and sw.js
- Sync .gitignore, README.md and AGENTS.md with the new layout
2026-09-12 12:38:00 +07:00
phattaranun.a b2383ca7d0 Redesign #/check to match homepage design; drop home hero buttons; add README
- Rebuild checkSchedule.html to reuse index.html shell classes (gradient
  hero + blobs + gradient-text, summary stats, gradient stop-card headers)
- Remove View Route Details / Find Bus Stops / Preview a Route buttons and
  their i18n keys from the homepage hero
- Add check.* i18n keys (th/en) for the redesigned schedule page
- Add README.md with run instructions
2026-09-12 12:13:12 +07:00
Bkk1234 c44f79b7d9 Rebuild mock as hash-routed SPA with i18n and PWA refresh
- Single-page shell (ui/index.html) + vanilla hash router; each screen is a partial
- New #/check schedule view (all stop times open, no collapse) wired to the
  'check schedules' CTA; contact-operator box, route map and gallery trimmed from it
- Mobile-first responsive.css (375px iPhone 8 up to 27-inch/1440p)
- TH/EN i18n system (data-i18n, browser-language detect, topbar switcher)
- Shared form controls moved to _shared.css (mu-btn, custom select chevron,
  focus-visible ring); footer contact column now mailto:[email protected]
- SW v9: JS network-first, precache i18n.js + all partials
- Legacy pages become redirect stubs to index.html#/...
2026-09-03 00:08:04 +07:00
phattaranun.a 8a6133fd77 Remove backup HTML file for AT Transit homepage 2026-08-22 19:41:17 +07:00
phattaranun.a c2db993f5c Add marquee functionality to sponsor section with animation 2026-08-22 19:40:24 +07:00
phattaranun.a 413e280e9a Add initial HTML structure for AT Transit homepage and hero section
- Created index_backup.html with complete layout and styling for the homepage.
- Added home.html partial for the hero section, including province and station selectors.
- Implemented responsive design elements and navigation for bus routes.
- Included sponsor section with partner logos in a marquee format.
2026-08-22 19:27:45 +07:00
phattaranun.a 7bf06e6f88 Refactor code structure for improved readability and maintainability 2026-08-22 17:29:38 +07:00