feat(ui): port design UI + static assets from web-at-transit-mock
- copy .image assets to frontend/public/images (logo, hero map, partner logos, route/stop photos, qrcode, landmarks) - add K2D fonts (offline local woff2) in frontend/public/fonts - add Lucide icon components (Icons.tsx); replace all emoji icons - add lib/images.ts static asset resolver (route/stop/partner/logo) - header/footer/home: minibus logo, hero map bg, partner marquee - route detail: design car/hero photo; stop detail: design stop photo - .gitignore: un-ignore frontend/public/images + app icons so the frontend Docker build ships the assets
This commit is contained in:
1 parent
24187fc3b7
commit
9ba7113017
98 files changed
+778
-122
No files matched your search
@@ -3,6 +3,8 @@ import { notFound } from "next/navigation";
|
||||
import { api, isApiNotFoundError, resolveFileUrl, type Schedule, type StopDetail } from "@/lib/api";
|
||||
import LazyMapView from "@/components/LazyMapView";
|
||||
import { VisitTracker } from "@/lib/visit-tracker";
|
||||
import { stopPhoto } from "@/lib/images";
|
||||
import { Icon } from "@/components/Icons";
|
||||
|
||||
const TONES = ["sky", "purple", "pink", "mint", "amber"] as const;
|
||||
|
||||
@@ -46,16 +48,23 @@ export default async function StopDetailsPage({ searchParams }: StopDetailsPageP
|
||||
? [{ id: stop.id, lat: stop.lat as number, lng: stop.lng as number, label: stop.name_th, code: stop.code }]
|
||||
: [];
|
||||
|
||||
// รูปป้ายจาก design (.image/stops/<code>.jpg) — สำคัญกว่า backend images
|
||||
const designPhoto = stopPhoto(stop.code);
|
||||
|
||||
return (
|
||||
<main className="page">
|
||||
<VisitTracker path={`/stops/details?code=${stop.code}`} />
|
||||
<section className="hero">
|
||||
<span className="pill">{stop.station_type}</span>
|
||||
<h1 style={{ marginTop: 10 }}>{stop.name_th}</h1>
|
||||
<p className="muted">📍 {place}{hasMap ? ` · ${stop.lat?.toFixed(4)}, ${stop.lng?.toFixed(4)}` : ""}</p>
|
||||
<p className="muted"><Icon name="map-pin" size={14} className="icon" /> {place}{hasMap ? ` · ${stop.lat?.toFixed(4)}, ${stop.lng?.toFixed(4)}` : ""}</p>
|
||||
</section>
|
||||
<div className="stop-detail__split">
|
||||
{stop.images.length > 0 ? (
|
||||
{designPhoto ? (
|
||||
<div className="stop-detail__gallery">
|
||||
<img className="stop-detail__hero-img" src={designPhoto} alt={stop.name_th} />
|
||||
</div>
|
||||
) : stop.images.length > 0 ? (
|
||||
<div className="stop-detail__gallery">
|
||||
<img
|
||||
className="stop-detail__hero-img"
|
||||
@@ -72,7 +81,7 @@ export default async function StopDetailsPage({ searchParams }: StopDetailsPageP
|
||||
</div>
|
||||
) : (
|
||||
<div className="stop-detail__gallery stop-detail__gallery--empty">
|
||||
<div className="stop-detail__placeholder">📷 ยังไม่มีรูปป้ายนี้</div>
|
||||
<div className="stop-detail__placeholder"><Icon name="camera" size={20} className="icon" /> ยังไม่มีรูปป้ายนี้</div>
|
||||
</div>
|
||||
)}
|
||||
{hasMap ? (
|
||||
@@ -81,7 +90,7 @@ export default async function StopDetailsPage({ searchParams }: StopDetailsPageP
|
||||
</div>
|
||||
) : (
|
||||
<div className="stop-detail__map stop-detail__map--empty">
|
||||
<div className="stop-detail__placeholder">🗺️ ยังไม่มีพิกัดของป้ายนี้</div>
|
||||
<div className="stop-detail__placeholder"><Icon name="map" size={20} className="icon" /> ยังไม่มีพิกัดของป้ายนี้</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
@@ -105,11 +114,11 @@ export default async function StopDetailsPage({ searchParams }: StopDetailsPageP
|
||||
</Link>
|
||||
<div className="schedule-card__meta">
|
||||
<span className="schedule-card__direction">
|
||||
<span aria-hidden>🧭</span>
|
||||
<Icon name="globe" size={13} className="icon" />
|
||||
{s.direction_note || "ไม่ระบุทิศทาง"}
|
||||
</span>
|
||||
{s.schedule_note && (
|
||||
<span className="schedule-card__note">📝 {s.schedule_note}</span>
|
||||
<span className="schedule-card__note"><Icon name="message-circle" size={13} className="icon" /> {s.schedule_note}</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
@@ -118,7 +127,7 @@ export default async function StopDetailsPage({ searchParams }: StopDetailsPageP
|
||||
<span className="schedule-card__empty">— ยังไม่มีรอบ —</span>
|
||||
) : (
|
||||
s.departure_times.map((t, j) => (
|
||||
<span key={j} className="schedule-card__time">🕒 {t}</span>
|
||||
<span key={j} className="schedule-card__time"><Icon name="clock" size={13} className="icon" /> {t}</span>
|
||||
))
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -2,6 +2,7 @@ import Link from "next/link";
|
||||
import { api } from "@/lib/api";
|
||||
import LazyMapView from "@/components/LazyMapView";
|
||||
import { VisitTracker } from "@/lib/visit-tracker";
|
||||
import { Icon, type IconName } from "@/components/Icons";
|
||||
|
||||
const TONES = ["sky", "purple", "pink", "mint", "amber"] as const;
|
||||
const TYPE_TONE: Record<string, (typeof TONES)[number]> = {
|
||||
@@ -11,12 +12,12 @@ const TYPE_TONE: Record<string, (typeof TONES)[number]> = {
|
||||
market: "pink",
|
||||
landmark: "mint",
|
||||
};
|
||||
const TYPE_ICON: Record<string, string> = {
|
||||
terminal: "🚍",
|
||||
station: "🚏",
|
||||
pickup: "🛣️",
|
||||
market: "🏪",
|
||||
landmark: "📍",
|
||||
const TYPE_ICON: Record<string, IconName> = {
|
||||
terminal: "bus-front",
|
||||
station: "map-pin",
|
||||
pickup: "bus",
|
||||
market: "store",
|
||||
landmark: "map-pin",
|
||||
};
|
||||
const TYPE_LABEL: Record<string, string> = {
|
||||
terminal: "สถานีขนส่ง",
|
||||
@@ -44,7 +45,7 @@ export default async function StopsPage() {
|
||||
<div className="page-hero__blob page-hero__blob--b" />
|
||||
<div className="page-hero__blob page-hero__blob--c" />
|
||||
<div className="page-hero__inner">
|
||||
<span className="page-hero__badge">🚏 STOP DIRECTORY</span>
|
||||
<span className="page-hero__badge"><Icon name="map-pin" size={13} className="icon" /> STOP DIRECTORY</span>
|
||||
<h1 className="page-hero__title">
|
||||
จุดจอด<span className="page-hero__title-grad">ทั่วประเทศ</span>
|
||||
</h1>
|
||||
@@ -67,13 +68,13 @@ export default async function StopsPage() {
|
||||
|
||||
<div className="toolbar">
|
||||
<div className="toolbar__search">
|
||||
<span aria-hidden>🔍</span>
|
||||
<Icon name="search" size={16} className="icon" />
|
||||
<input placeholder="ค้นหาชื่อป้าย หรือจังหวัด…" disabled />
|
||||
</div>
|
||||
<div className="toolbar__chips">
|
||||
{Object.entries(typeCounts).map(([t, n]) => (
|
||||
<span key={t} className={`chip-soft chip-soft--${TYPE_TONE[t] ?? "sky"}`}>
|
||||
{TYPE_ICON[t] ?? "📍"} {TYPE_LABEL[t] ?? t} · {n}
|
||||
<Icon name={TYPE_ICON[t] ?? "map-pin"} size={13} className="icon" /> {TYPE_LABEL[t] ?? t} · {n}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
@@ -82,7 +83,7 @@ export default async function StopsPage() {
|
||||
<div className="tile-grid">
|
||||
{items.map((s, i) => {
|
||||
const tone = TYPE_TONE[s.station_type] ?? TONES[i % TONES.length];
|
||||
const icon = TYPE_ICON[s.station_type] ?? "📍";
|
||||
const icon = TYPE_ICON[s.station_type] ?? "map-pin";
|
||||
const place = [s.city_th, s.province_th].filter(Boolean).join(" · ");
|
||||
const stopHref = s.code ? `/stops/${encodeURIComponent(s.code)}` : null;
|
||||
return (
|
||||
@@ -93,7 +94,7 @@ export default async function StopsPage() {
|
||||
className={`tile tile--${tone}`}
|
||||
>
|
||||
<div className={`tile__badge tile__badge--${tone}`}>
|
||||
<span>{icon}</span>
|
||||
<Icon name={icon} size={26} />
|
||||
</div>
|
||||
<div className="tile__body">
|
||||
<p className="tile__title">{s.name_th}</p>
|
||||
@@ -103,7 +104,7 @@ export default async function StopsPage() {
|
||||
{TYPE_LABEL[s.station_type] ?? s.station_type}
|
||||
</span>
|
||||
{s.lat != null && s.lng != null && (
|
||||
<span className="chip-soft chip-soft--mint">📍 บนแผนที่</span>
|
||||
<span className="chip-soft chip-soft--mint"><Icon name="map-pin" size={13} className="icon" /> บนแผนที่</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
@@ -112,7 +113,7 @@ export default async function StopsPage() {
|
||||
) : (
|
||||
<div key={s.id} className={`tile tile--${tone} tile--disabled`}>
|
||||
<div className={`tile__badge tile__badge--${tone}`}>
|
||||
<span>{icon}</span>
|
||||
<Icon name={icon} size={26} />
|
||||
</div>
|
||||
<div className="tile__body">
|
||||
<p className="tile__title">{s.name_th}</p>
|
||||
@@ -122,7 +123,7 @@ export default async function StopsPage() {
|
||||
{TYPE_LABEL[s.station_type] ?? s.station_type}
|
||||
</span>
|
||||
{s.lat != null && s.lng != null && (
|
||||
<span className="chip-soft chip-soft--mint">📍 บนแผนที่</span>
|
||||
<span className="chip-soft chip-soft--mint"><Icon name="map-pin" size={13} className="icon" /> บนแผนที่</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user