- 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
67 lines
3.1 KiB
TypeScript
67 lines
3.1 KiB
TypeScript
/**
|
|
* Static design assets from `web-at-transit-mock/.image`
|
|
* (copied to `frontend/public/images`).
|
|
*
|
|
* Every image resolves offline — no backend `/files` proxy needed for
|
|
* brand/route/stop/partner visuals. Backend-uploaded images remain the
|
|
* fallback only where the design has no matching asset.
|
|
*/
|
|
|
|
const IMG = "/images";
|
|
|
|
/** Route vehicle/hero photos keyed by `route_id` (subset that exists in design). */
|
|
const ROUTE_PHOTOS: Record<string, { hero?: string; car?: string }> = {
|
|
"101": { hero: `${IMG}/routes/101/hero.jpeg`, car: `${IMG}/routes/101/car.jpeg` },
|
|
"1011": { hero: `${IMG}/routes/1011/hero.jpeg`, car: `${IMG}/routes/1011/car.jpeg` },
|
|
"15": { hero: `${IMG}/routes/15/hero.jpg`, car: `${IMG}/routes/15/car.jpg` },
|
|
"2194": { car: `${IMG}/routes/2194/car.jpg` },
|
|
"2231": { car: `${IMG}/routes/2231/car.jpg` },
|
|
"324": { hero: `${IMG}/routes/324/hero.jpg`, car: `${IMG}/routes/324/car.jpg` },
|
|
"464": { car: `${IMG}/routes/464/car.jpeg` },
|
|
"641": { car: `${IMG}/routes/641/car.jpeg` },
|
|
"902": { hero: `${IMG}/routes/902/hero.jpg`, car: `${IMG}/routes/902/car.jpg` },
|
|
"951": { car: `${IMG}/routes/951/car.jpg` },
|
|
"952": { hero: `${IMG}/routes/952/hero.webp`, car: `${IMG}/routes/952/car.webp` },
|
|
};
|
|
|
|
/** Stop photos keyed by code (pad5 kilometer markers in the design). */
|
|
const STOP_PHOTOS: Record<string, string> = {
|
|
"36020": `${IMG}/stops/36020.jpg`,
|
|
"39321": `${IMG}/stops/39321.jpg`,
|
|
"42110": `${IMG}/stops/42110.jpg`,
|
|
"42250": `${IMG}/stops/42250.jpg`,
|
|
"54950": `${IMG}/stops/54950.jpg`,
|
|
};
|
|
|
|
export const LOGO = `${IMG}/icons/minibus-512x512.png`;
|
|
export const HERO_MAP = `${IMG}/network/overview-map.png`;
|
|
|
|
/** Partner / sponsor logos (footer + home marquee), from `.image/partners`. */
|
|
export const PARTNERS: { id: string; label: string; src: string }[] = [
|
|
{ id: "7-11", label: "7-Eleven", src: `${IMG}/partners/7-11.png` },
|
|
{ id: "shopee", label: "Shopee", src: `${IMG}/partners/shopee.png` },
|
|
{ id: "lazada", label: "Lazada", src: `${IMG}/partners/lazada.png` },
|
|
{ id: "airasia-move", label: "airasia MOVE", src: `${IMG}/partners/airasia-move.png` },
|
|
{ id: "busonlineticket", label: "busonlineticket", src: `${IMG}/partners/busonlineticket.png` },
|
|
{ id: "trip", label: "Trip.com", src: `${IMG}/partners/trip.jpg` },
|
|
{ id: "truck2hand", label: "truck2hand", src: `${IMG}/partners/truck2hand.png` },
|
|
{ id: "tcl999-angthong", label: "ทีซีแอล 999 อ่างทอง", src: `${IMG}/partners/tcl999-angthong.jpg` },
|
|
{ id: "bus-pingraow", label: "รถบัสปิ่นเกล้า", src: `${IMG}/partners/bus-pingraow.jpg` },
|
|
];
|
|
|
|
/** Resolve a route photo URL (hero preferred, car as fallback). Returns null if none. */
|
|
export function routePhoto(
|
|
routeId: string,
|
|
kind: "hero" | "car" = "car",
|
|
): string | null {
|
|
const p = ROUTE_PHOTOS[String(routeId)];
|
|
if (!p) return null;
|
|
if (kind === "hero") return p.hero ?? p.car ?? null;
|
|
return p.car ?? p.hero ?? null;
|
|
}
|
|
|
|
/** Resolve a stop photo URL by code. Returns null if the design has no asset. */
|
|
export function stopPhoto(code: string): string | null {
|
|
return STOP_PHOTOS[String(code)] ?? null;
|
|
}
|