commit bc1edb39ef76453fb8681f9e0d456daaf02309de Author: phattaranun.a Date: Sat Jul 18 16:51:23 2026 +0700 feat: add routes page with filtering and drawer details - Implemented a new routes page with search and category filtering. - Added a drawer component to display detailed information about selected routes. - Created a CSS file for styling the routes page and its components. - Introduced a Python script to upload seed images to SeaweedFS and generate SQL insert statements for the images table. diff --git a/at-transit/web-design/build_click_flow.py b/at-transit/web-design/build_click_flow.py new file mode 100644 index 0000000..3fc971c --- /dev/null +++ b/at-transit/web-design/build_click_flow.py @@ -0,0 +1,881 @@ +#!/usr/bin/env python3 +"""Horizontal click-flow diagram with row-aware centering and orthogonal arrows.""" +import asyncio +import os +import random +import sys +import subprocess +from pathlib import Path +from math import atan2, cos, sin + +VENV_DIR = Path(__file__).resolve().parent.parent / ".venv" +VENV_PY = VENV_DIR / "bin" / "python" +if Path(sys.prefix).resolve() != VENV_DIR.resolve() and VENV_PY.exists(): + raise SystemExit(subprocess.run([str(VENV_PY), *sys.argv], check=False).returncode) + +from playwright.async_api import async_playwright +from PIL import Image, ImageDraw, ImageFont + +Image.MAX_IMAGE_PIXELS = None + +ROOT = Path(__file__).resolve().parent +SHOTS_DIR = ROOT / "screenshots" +OUT_PNG = ROOT / "frontend-web-transit-flow.png" +VIEWPORT = {"width": 1600, "height": 1000} +OUTPUT_SCALE = 2 +BASE = os.environ.get("FRONTEND_BASE", "http://localhost:13000") +STOP_CODE = os.environ.get("STOP_CODE", "at_main_terminal") +ROUTE_ID = os.environ.get("ROUTE_ID", "101") + +URLS = { + "index.html": "/", + "busStop.html": "/stops", + "stopDetail.html": f"/stops/details?code={STOP_CODE}", + "stopDetailExpanded.html": f"/stops/details?code={STOP_CODE}", + "busDetail.html": f"/routes/{ROUTE_ID}", + "busDetailExpanded.html": f"/routes/{ROUTE_ID}", +} + +# id, page, selector_or_None, col, row, marker_label, panel_title, span_rows, align_mode +# row: integer row index (0=top). span_rows: if >1, node is centered across N rows. +# align_mode: "top" or "center-row" (centered vertically within its row band when span_rows == 1) +NODES = [ + # Row 0 (top) — stop discovery flow + ("N1", "index.html", None, + 0, 0, "", "index.html", 1, "top"), + ("N2a", "index.html", '.hero__actions a[href="/stops"]', + 1, 0, "คลิก 'ป้ายหยุดรถ'", "index.html · ป้ายหยุดรถ", 1, "top"), + ("N3a", "busStop.html", '.tile-grid a.tile[href^="/stops/"]', + 2, 0, "คลิกจุดจอด 'บขส.อ่างทอง'", "busStop.html", 1, "center-row"), + ("N4a", "stopDetail.html", None, + 4, 0, "ถึงรายละเอียดป้าย ?stop=at_main_terminal", "stopDetail.html", 1, "center-row"), + ("N4b", "stopDetailExpanded.html", '.schedule-card__route[href^="/routes/"]', + 5, 0, "คลิกสายจากตารางเวลา", "stopDetail.html (expanded)", 1, "center-row"), + # Row 1 (bottom) — route detail flow + ("N2b", "index.html", f'.zone .grid a.card[href="/routes/{ROUTE_ID}"]', + 1, 1, "คลิกหมายเลขสาย 101", "index.html · สาย 101", 1, "top"), + ("N3b", "busDetail.html", ".stop-timeline a.stop-node__title", + 2, 1, "คลิกจุดจอดแรกในสาย", "busDetail.html", 1, "center-row"), + ("N4c", "busDetailExpanded.html", ".stop-timeline a.stop-node__arrow", + 3, 1, "คลิกไปหน้ารายละเอียดจุดจอด", "busDetail.html (expanded)", 1, "center-row"), +] + +EDGES = [ + ("N1", "N2a"), ("N1", "N2b"), + ("N2a", "N3a"), ("N2b", "N3b"), + ("N3a", "N4a"), ("N3b", "N4c"), + ("N4c", "N4a"), ("N4a", "N4b"), +] + +PAGES = sorted({n[1] for n in NODES}) + +STOP_DETAIL_ACTIONS = [ + ("A1", "stopDetail.html", "N4", "ดูตารางเวลาสายรถ", "busDetail.html", "N3", "?stop=at_main_terminal"), + ("A2", "stopDetail.html", "N4", "เปิดรายละเอียดสาย 101", "busDetail.html", "N3", "?route=101&origin=at_main_terminal"), + ("A3", "stopDetail.html", "N4", "กลับไปรายการป้าย", "busStop.html", "N2", "กลับหน้า list"), + ("A4", "stopDetail.html", "N4", "กลับหน้าแรก (breadcrumb)", "index.html", "N1", "ผ่าน breadcrumb"), + ("A5", "stopDetail.html", "N4", "ขยายเวลารถของสาย", "stopDetailExpanded", "N4e", "state transition"), +] + +async def capture_all(): + SHOTS_DIR.mkdir(parents=True, exist_ok=True) + boxes, sizes = {}, {} + async with async_playwright() as p: + browser = await p.chromium.launch() + ctx = await browser.new_context(viewport=VIEWPORT, device_scale_factor=1) + page = await ctx.new_page() + for name in PAGES: + url = f"{BASE}{URLS.get(name, '/') }" + try: + await page.goto(url, wait_until="networkidle", timeout=20000) + except Exception as e: + print(f"WARN load {url}: {e}") + await page.goto(url, wait_until="domcontentloaded", timeout=20000) + await page.wait_for_timeout(600) + doc = await page.evaluate( + "({w: document.documentElement.scrollWidth, h: document.documentElement.scrollHeight})") + sizes[name] = (doc["w"], doc["h"]) + await page.screenshot(path=str(SHOTS_DIR / name.replace(".html", ".png")), full_page=True) + for nid, p_name, sel, *_ in NODES: + if p_name != name or not sel: + continue + el = await page.query_selector(sel) + if not el: + print(f"WARN missing {sel} on {name}") + continue + boxes[nid] = await el.bounding_box() + print(f"captured {name} {sizes[name]}") + await browser.close() + return boxes, sizes + +def get_font(size): + for path in [ + "/System/Library/Fonts/Supplemental/Arial Unicode.ttf", + "/System/Library/Fonts/Supplemental/Tahoma.ttf", + ]: + try: + return ImageFont.truetype(path, size) + except Exception: + pass + return ImageFont.load_default() + +def hex_to_rgb(value): + value = value.lstrip("#") + return tuple(int(value[i:i+2], 16) for i in (0, 2, 4)) + +def draw_cursor_icon(base_img, tip_x, tip_y, color_hex, scale=1.0): + # Render only the split two-prong motif (no main arrow-head triangle). + ss = 6 + icon_w = int(30 * scale) + icon_h = int(30 * scale) + local = Image.new("RGBA", (icon_w * ss, icon_h * ss), (0, 0, 0, 0)) + d = ImageDraw.Draw(local) + + core = (int(9 * scale * ss), int(9 * scale * ss)) + + # Two-prong symbol balanced to avoid obscuring the center core. + prong_right = [ + core, + (int(32 * scale * ss), int(18 * scale * ss)), + (int(19 * scale * ss), int(19 * scale * ss)), + ] + prong_down = [ + core, + (int(18 * scale * ss), int(32 * scale * ss)), + (int(19 * scale * ss), int(19 * scale * ss)), + ] + connector = [ + core, + (int(19 * scale * ss), int(19 * scale * ss)), + (int(16 * scale * ss), int(22 * scale * ss)), + (int(22 * scale * ss), int(16 * scale * ss)), + ] + + r, g, b = hex_to_rgb(color_hex) + d.polygon(prong_right, fill=(r, g, b, 248)) + d.polygon(prong_down, fill=(r, g, b, 248)) + d.polygon(connector, fill=(r, g, b, 248)) + d.ellipse( + [ + core[0] - int(1.6 * ss), + core[1] - int(1.6 * ss), + core[0] + int(1.6 * ss), + core[1] + int(1.6 * ss), + ], + fill=(r, g, b, 255), + ) + + local = local.resize((icon_w, icon_h), Image.Resampling.LANCZOS) + px = int(tip_x - 8 * scale) + py = int(tip_y - 8 * scale) + base_img.paste(local, (px, py), local) + +def compose(boxes, sizes): + s = OUTPUT_SCALE + cell_w = int(900 * s) + margin_h, margin_v = int(40 * s), int(30 * s) + # Keep enough horizontal/vertical whitespace so connectors stay visible. + gutter_h = int(440 * s) + row_gap = int(240 * s) + label_block_h = int(48 * s) + px_per_col = cell_w + gutter_h + grid = {} + for nid, page, sel, col, row, marker_lbl, title, span_rows, align_mode in NODES: + grid[nid] = { + "col": col, "row": row, "span_rows": span_rows, + "marker_label": marker_lbl, "title": title, + "align_mode": align_mode, + "page": page, "selector": sel + } + # Precompute scaled sizes for each node and dynamic row heights. + scaled_sizes = {} + for nid, page, *_ in NODES: + page_w, page_h = sizes.get(page, (cell_w, 800)) + scale = cell_w / page_w if page_w else 1 + scaled_w = int(page_w * scale) + scaled_h = int(page_h * scale) + scaled_sizes[nid] = (scaled_w, scaled_h) + + unique_rows = sorted(set(n[4] for n in NODES)) + row_heights = {} + for row in unique_rows: + row_nodes = [n[0] for n in NODES if n[4] == row] + row_heights[row] = max((scaled_sizes[nid][1] for nid in row_nodes), default=800) + + row_tops = {} + cursor_y = margin_v + for row in unique_rows: + row_tops[row] = cursor_y + cursor_y += row_heights[row] + label_block_h + row_gap + # Compute bounds + cols = [n[3] for n in NODES] + rows = [n[4] for n in NODES] + max_col = max(cols) if cols else 0 + max_row = max(rows) if rows else 0 + canvas_w = (max_col + 1) * px_per_col + 2 * margin_h + canvas_h = cursor_y + margin_v + img = Image.new("RGB", (int(canvas_w), int(canvas_h)), "white") + draw = ImageDraw.Draw(img) + font_label = get_font(int(12 * s)) + font_title = get_font(int(13 * s)) + font_arrow = get_font(int(12 * s)) + font_marker = get_font(int(11 * s)) + + # Per-node action color: deterministic random so output is stable across runs. + color_rng = random.Random(20260512) + color_palette = [ + "#2563eb", "#7c3aed", "#db2777", "#ea580c", + "#0f766e", "#0891b2", "#4338ca", "#be123c", + ] + action_colors = {nid: color_rng.choice(color_palette) for nid, *_ in NODES} + # Draw node panels: each is a screenshot at target grid cell with rounded corners + node_boxes = {} + click_points = {} + for nid, page, sel, col, row, marker_lbl, title, span_rows, align_mode in NODES: + # Load screenshot + png_path = SHOTS_DIR / page.replace(".html", ".png") + if not png_path.exists(): + print(f"WARN no screenshot {png_path}") + continue + ss = Image.open(png_path) + page_w, page_h = ss.size + # Compute panel position + px = margin_h + col * px_per_col + py = row_tops[row] + label_block_h + # Scale screenshot + scale = cell_w / page_w + scaled_w = int(page_w * scale) + scaled_h = int(page_h * scale) + # Vertical centering within row band(s) for all nodes. + span_rows_list = [row + i for i in range(span_rows)] + band_h = sum(row_heights.get(r, row_heights[row]) for r in span_rows_list) + row_gap * (span_rows - 1) + if scaled_h < band_h: + py += (band_h - scaled_h) // 2 + # Horizontal centering within column cell + if scaled_w < px_per_col: + px += (px_per_col - scaled_w) // 2 + ss_scaled = ss.resize((scaled_w, scaled_h), Image.Resampling.LANCZOS) + # Paste onto main canvas + img.paste(ss_scaled, (int(px), int(py))) + # Record bounds for arrow drawing + node_boxes[nid] = (px, py, px + scaled_w, py + scaled_h) + # Record click marker position from selector bounding box on original page. + if nid in boxes and boxes[nid]: + b = boxes[nid] + cx = px + (b["x"] + b["width"] / 2) * scale + cy = py + (b["y"] + b["height"] / 2) * scale + click_points[nid] = (cx, cy) + # Add colored bar with filename/title and action description above screenshot. + action_color = action_colors.get(nid, "#1f4f7a") + bar_h = int(42 * s) + bar_y1 = py - label_block_h + bar_y2 = bar_y1 + bar_h + # Draw full-width colored bar + draw.rectangle([px, bar_y1, px + scaled_w, bar_y2], fill=action_color) + # Draw title and marker label inside bar + title_y = bar_y1 + int(12 * s) + draw.text((px + int(8 * s), title_y), title, fill="#ffffff", font=font_title, anchor="lm") + desc_y = bar_y1 + int(28 * s) + draw.text((px + int(8 * s), desc_y), marker_lbl, fill="#ffffff", font=font_label, anchor="lm") + + def draw_edge_label(text, x, y, label_color="#1f4f7a"): + pad_x = int(12 * s) + pad_y = int(6 * s) + font_bold = get_font(int(14 * s)) + text_w = draw.textlength(text, font=font_bold) + text_h = int(16 * s) + x1 = x - text_w / 2 - pad_x + y1 = y - text_h / 2 - pad_y + x2 = x + text_w / 2 + pad_x + y2 = y + text_h / 2 + pad_y + draw.rounded_rectangle([x1, y1, x2, y2], radius=int(8 * s), fill=label_color, outline="#ffffff", width=int(2 * s)) + draw.text((x, y), text, fill="#ffffff", font=font_bold, anchor="mm") + + def draw_soft_gradient_circle(base_img, cx, cy, rgb): + # Render gradient on a local RGBA surface, then composite to keep soft edges. + circle_scale = 1.3 * 1.2 * s + outer = int(round(20 * circle_scale)) + inner = int(round(9 * circle_scale)) + pad = int(4 * s) + size = outer * 2 + pad * 2 + local = Image.new("RGBA", (size, size), (0, 0, 0, 0)) + ld = ImageDraw.Draw(local) + + center = outer + pad + r, g, b = rgb + + # Outer soft halo. + for rr in range(outer, inner, -1): + t = (rr - inner) / max(1, (outer - inner)) + alpha = int(12 + (1 - t) * 56) + ld.ellipse( + [center - rr, center - rr, center + rr, center + rr], + fill=(r, g, b, alpha), + ) + + # Inner light core for the "soft gradient" look. + for rr in range(inner, 2, -1): + t = rr / max(1, inner) + alpha = int(110 + (1 - t) * 80) + ld.ellipse( + [center - rr, center - rr, center + rr, center + rr], + fill=(255, 255, 255, alpha), + ) + + # Crisp center dot to preserve click focal point. + dot = max(2, int(2 * s)) + ld.ellipse([center - dot, center - dot, center + dot, center + dot], fill=(r, g, b, 230)) + base_img.paste(local, (cx - center, cy - center), local) + + def draw_click_marker(nid, x, y): + # Normal cursor orientation with tip at click center. + cx = int(x) + cy = int(y) + + action_color = action_colors.get(nid, "#334155") + r, g, b = hex_to_rgb(action_color) + + # Soft gradient circle that shares the same hue as action label text. + draw_soft_gradient_circle(img, cx, cy, (r, g, b)) + + # Upright cursor with anti-aliased edges; tip lands exactly on click center. + draw_cursor_icon(img, cx, cy, action_color, scale=1.38 * s) + + # Arrow routing: orthogonal with elbow + src_gap = int(15 * s) + dst_gap = int(10 * s) + def route_arrow(p1, p2, src_y_offset=0, dst_y_offset=0): + """Return [(x_start, y0), (x_elbow, y0), (x_elbow, y1), (x_end, y1)].""" + x0, y0, x1_r, y1_r = p1 + x2, y2, x3_r, y3_r = p2 + src_y = (y0 + y1_r) / 2 + src_y_offset + dst_y = (y2 + y3_r) / 2 + dst_y_offset + mid_x = x1_r + (x2 - x1_r) * 0.25 + return [(x1_r + src_gap, src_y), (mid_x, src_y), (mid_x, dst_y), (x2 - dst_gap, dst_y)] + arrow_width = int(5 * s) + # Count outgoing and incoming edges per node to compute per-edge y-offsets. + src_edge_counter = {} + dst_edge_counter = {} + for src, dst in EDGES: + src_edge_counter[src] = src_edge_counter.get(src, 0) + dst_edge_counter[dst] = dst_edge_counter.get(dst, 0) + src_seen = {k: 0 for k in src_edge_counter} + dst_seen = {k: 0 for k in dst_edge_counter} + src_labeled = set() + for src, dst in EDGES: + if src not in node_boxes or dst not in node_boxes: + continue + src_y_offset = src_seen[src] * int(4 * s) + dst_y_offset = 0 + src_seen[src] += 1 + dst_seen[dst] += 1 + points = route_arrow(node_boxes[src], node_boxes[dst], src_y_offset=src_y_offset, dst_y_offset=dst_y_offset) + arrow_color = action_colors.get(src, "#0066cc") + # Compute arrowhead geometry first so line ends exactly at arrowhead base. + x_dst, y_dst = points[-1] + x_prev, y_prev = points[-2] + angle = atan2(y_dst - y_prev, x_dst - x_prev) + arr_len = arrow_width * 6 + arr_w = arrow_width * 3 + xa = x_dst - arr_len * cos(angle) + ya = y_dst - arr_len * sin(angle) + perp_angle = angle + 3.14159 / 2 # perpendicular (90 degrees) to arrow direction + xbl = xa + arr_w * cos(perp_angle) + ybl = ya + arr_w * sin(perp_angle) + xbr = xa - arr_w * cos(perp_angle) + ybr = ya - arr_w * sin(perp_angle) + # Draw line segments; last segment stops at arrowhead base (xa, ya). + for i in range(len(points) - 1): + x0, y0 = points[i] + x1, y1 = points[i + 1] + if i == len(points) - 2: + x1, y1 = xa, ya + draw.line([(x0, y0), (x1, y1)], fill=arrow_color, width=arrow_width) + # Draw arrowhead on top to create clean connection. + draw.polygon([(x_dst, y_dst), (xbl, ybl), (xbr, ybr)], fill=arrow_color) + # Add edge label above the final horizontal segment — only once per source. + lbl = grid.get(src, {}).get("marker_label", "") + if lbl and src not in src_labeled: + lx = (points[2][0] + points[3][0]) / 2 + ly = points[2][1] - int(20 * s) + lbl_color = action_colors.get(src, "#1f4f7a") + draw_edge_label(lbl, lx, ly, lbl_color) + src_labeled.add(src) + + # Draw click markers last so they stay above screenshots and arrows. + for nid, (cx, cy) in click_points.items(): + draw_click_marker(nid, cx, cy) + + # ── Stacked action-flow frames ────────────────────────────────────────── + # Layout constants + outer_pad = int(34 * s) + section_gap = int(30 * s) + header_h = int(70 * s) + footer_h = int(18 * s) + inner_pad = int(34 * s) # inside each frame + frame_tag_h = int(56 * s) # frame title-bar height + cell_pad = int(20 * s) # gutter between grid-line and cell box + cell_tag_h = int(34 * s) # per-cell label bar height + img_pad = int(12 * s) # space between cell-box edge and screenshot + arrow_gap = int(40 * s) # horizontal gutter between columns for arrows + + # ONE global standard image width — every screenshot is scaled to exactly + # this many pixels wide; height follows the natural aspect ratio (no crop). + STANDARD_IMG_W = int(480 * s) + + # Pre-read native screenshot dimensions from disk + def _shot_orig(name): + p = SHOTS_DIR / name.replace(".html", ".png") + if not p.exists(): + return (1600, 900) + with Image.open(p) as im: + return im.size + + _orig = {pg: _shot_orig(pg) for pg in [ + "index.html", "busStop.html", "busDetail.html", "stopDetail.html", + "busDetailExpanded.html", "stopDetailExpanded.html", + ]} + + def _natural_h(page): + ow, oh = _orig.get(page, (1600, 900)) + return int(oh * STANDARD_IMG_W / ow) + + # ── Frame table definitions ───────────────────────────────────────────── + frame1_table = { + 'cols': [ + {'col': 0, 'rows': [ + {'id': 'I', 'page': 'index.html', 'label': 'index.html', 'show_marker': False, 'emphasis_start': True}, + ]}, + {'col': 1, 'rows': [ + {'id': 'IA', 'page': 'index.html', 'label': 'index.html (คลิก "ป้ายหยุดรถ")', 'show_marker': True}, + {'id': 'IB', 'page': 'index.html', 'label': 'index.html (คลิก "คลิกหมายเลขสาย 101")', 'show_marker': True}, + ]}, + {'col': 2, 'rows': [ + {'id': 'S', 'page': 'busStop.html', 'label': 'busStop.html', 'show_marker': False, 'emphasis_end': True}, + {'id': 'B', 'page': 'busDetail.html', 'label': 'busDetail.html', 'show_marker': False, 'emphasis_end': True}, + ]}, + ], + 'edges': [ + {'src': 'I', 'dst': 'IA', 'label': 'คลิก "ป้ายหยุดรถ"', 'color': '#2563eb'}, + {'src': 'I', 'dst': 'IB', 'label': 'คลิกหมายเลขสาย 101', 'color': '#2563eb'}, + {'src': 'IA', 'dst': 'S', 'label': 'ไป busStop', 'color': '#2563eb'}, + {'src': 'IB', 'dst': 'B', 'label': 'ไป busDetail', 'color': '#2563eb'}, + ], + } + frame2_table = { + 'cols': [ + {'col': 0, 'rows': [{'id': 'S', 'page': 'busStop.html', 'label': 'busStop.html', 'show_marker': False, 'emphasis_start': True}]}, + {'col': 1, 'rows': [{'id': 'SC', 'page': 'busStop.html', 'label': 'busStop.html (คลิก "บขส.อ่างทอง")', 'show_marker': True, 'marker_box_id': 'N3a'}]}, + {'col': 2, 'rows': [{'id': 'D', 'page': 'stopDetail.html', 'label': 'stopDetail.html', 'show_marker': False}]}, + {'col': 3, 'rows': [{'id': 'BE', 'page': 'busDetailExpanded.html','label': 'busDetail (expanded)', 'show_marker': True}]}, + {'col': 4, 'rows': [{'id': 'DE', 'page': 'stopDetailExpanded.html','label':'stopDetail (expanded)', 'show_marker': True}]}, + {'col': 5, 'rows': [{'id': 'B', 'page': 'busDetail.html', 'label': 'busDetail.html', 'show_marker': False, 'emphasis_end': True}]}, + ], + 'edges': [ + {'src': 'S', 'dst': 'SC', 'label': 'คลิก "บขส.อ่างทอง"', 'color': '#7c3aed'}, + {'src': 'SC', 'dst': 'D', 'label': 'ไป stopDetail', 'color': '#7c3aed'}, + {'src': 'D', 'dst': 'BE', 'label': 'ไป busDetail(exp)', 'color': '#7c3aed'}, + {'src': 'BE', 'dst': 'DE', 'label': 'ไป stopDetail(exp)', 'color': '#7c3aed'}, + {'src': 'DE', 'dst': 'B', 'label': 'สิ้นสุด busDetail', 'color': '#7c3aed'}, + ], + } + frame3_table = { + 'cols': [ + {'col': 0, 'rows': [{'id': 'B', 'page': 'busDetail.html', 'label': 'busDetail.html', 'show_marker': False, 'emphasis_start': True}]}, + {'col': 1, 'rows': [{'id': 'BE', 'page': 'busDetailExpanded.html', 'label': 'busDetail (expanded)', 'show_marker': True}]}, + {'col': 2, 'rows': [{'id': 'DE', 'page': 'stopDetailExpanded.html','label': 'stopDetail (expanded)', 'show_marker': True}]}, + {'col': 3, 'rows': [{'id': 'D', 'page': 'stopDetail.html', 'label': 'stopDetail.html', 'show_marker': False, 'emphasis_end': True}]}, + ], + 'edges': [ + {'src': 'B', 'dst': 'BE', 'label': 'ไป busDetail(exp)', 'color': '#0f766e'}, + {'src': 'BE', 'dst': 'DE', 'label': 'ไป stopDetail(exp)', 'color': '#0f766e'}, + {'src': 'DE', 'dst': 'D', 'label': 'สิ้นสุด stopDetail','color': '#0f766e'}, + ], + } + + FRAMES = [ + (frame1_table, "#2563eb", + "index.html action flow", + "start at index.html → busStop.html / busDetail.html"), + (frame2_table, "#7c3aed", + "busStop action flow", + "busStop → stopDetail → busDetail(exp) → stopDetail(exp) → busDetail"), + (frame3_table, "#0f766e", + "busDetail action flow", + "busDetail → busDetail(exp) → stopDetail(exp) → stopDetail"), + ] + + # Pages that are used as a flow start. Reuse the same "start signature" + # frame style whenever these pages appear in other flows. + START_SIGNATURE_PAGES = { + node['page'] + for table, *_ in FRAMES + for col in table['cols'] + for node in col['rows'] + if node.get('emphasis_start') + } + START_SIGNATURE_PAGE_TINT = { + node['page']: tint + for table, tint, *_ in FRAMES + for col in table['cols'] + for node in col['rows'] + if node.get('emphasis_start') + } + + # ── Dynamic layout computation ────────────────────────────────────────── + # cell content width: STANDARD_IMG_W + padding on both sides + cell_content_w = STANDARD_IMG_W + 2 * img_pad + # full column width (cell box + gutter) + col_slot_w = cell_content_w + 2 * cell_pad + arrow_gap + + def _row_img_heights(table): + """Per-row max natural image height at STANDARD_IMG_W.""" + cols = table['cols'] + max_rows = max(len(c['rows']) for c in cols) + heights = [] + for ri in range(max_rows): + mh = 0 + for c in cols: + if ri < len(c['rows']): + mh = max(mh, _natural_h(c['rows'][ri]['page'])) + heights.append(mh) + return heights + + def _frame_h(row_img_heights): + rows_total = sum( + cell_tag_h + 2 * img_pad + h + 2 * cell_pad + for h in row_img_heights + ) + return frame_tag_h + 2 * inner_pad + rows_total + + def _frame_content_w(table): + return len(table['cols']) * col_slot_w + + all_row_heights = [_row_img_heights(t) for t, *_ in FRAMES] + all_frame_h = [_frame_h(rh) for rh in all_row_heights] + + frame_w = max(_frame_content_w(t) for t, *_ in FRAMES) + 2 * inner_pad + frame_w = max(frame_w, int(2000 * s)) + + total_h = (outer_pad + header_h + + sum(all_frame_h) + + section_gap * (len(FRAMES) - 1) + + footer_h + outer_pad) + + final_img = Image.new("RGBA", (outer_pad * 2 + frame_w, total_h), "#f4f7ff") + final_draw = ImageDraw.Draw(final_img) + + # ── Helper functions ──────────────────────────────────────────────────── + def mix_rgb(c1, c2, t): + return ( + int(c1[0] + (c2[0] - c1[0]) * t), + int(c1[1] + (c2[1] - c1[1]) * t), + int(c1[2] + (c2[2] - c1[2]) * t), + ) + + def tint_towards_white(hex_color, strength): + base = hex_to_rgb(hex_color) + return mix_rgb(base, (255, 255, 255), strength) + + def draw_linear_gradient(rect, c1, c2, vertical=True): + x1, y1, x2, y2 = [int(v) for v in rect] + if vertical: + h = max(1, y2 - y1) + for i in range(h): + t = i / max(1, h - 1) + final_draw.line([(x1, y1 + i), (x2, y1 + i)], fill=mix_rgb(c1, c2, t)) + else: + w = max(1, x2 - x1) + for i in range(w): + t = i / max(1, w - 1) + final_draw.line([(x1 + i, y1), (x1 + i, y2)], fill=mix_rgb(c1, c2, t)) + + def draw_soft_rounded_gradient(rect, radius, c1, c2, outline=None, outline_w=1, vertical=True): + x1, y1, x2, y2 = [int(v) for v in rect] + w = max(1, x2 - x1) + h = max(1, y2 - y1) + grad = Image.new("RGBA", (w, h), (0, 0, 0, 0)) + gd = ImageDraw.Draw(grad) + if vertical: + for i in range(h): + t = i / max(1, h - 1) + gd.line([(0, i), (w, i)], fill=(*mix_rgb(c1, c2, t), 255)) + else: + for i in range(w): + t = i / max(1, w - 1) + gd.line([(i, 0), (i, h)], fill=(*mix_rgb(c1, c2, t), 255)) + mask = Image.new("L", (w, h), 0) + md = ImageDraw.Draw(mask) + md.rounded_rectangle([0, 0, w - 1, h - 1], radius=radius, fill=255) + final_img.paste(grad, (x1, y1), mask) + if outline: + final_draw.rounded_rectangle([x1, y1, x2, y2], radius=radius, outline=outline, width=outline_w) + + bg_c1 = (246, 248, 255) + bg_c2 = (237, 245, 255) + draw_linear_gradient([0, 0, final_img.width, final_img.height], bg_c1, bg_c2, vertical=True) + + def fit_shot_std(name): + """Scale screenshot to exactly STANDARD_IMG_W; height is natural (no crop).""" + p = SHOTS_DIR / name.replace(".html", ".png") + if not p.exists(): + return None + shot = Image.open(p).convert("RGB") + new_h = int(shot.height * STANDARD_IMG_W / shot.width) + return shot.resize((STANDARD_IMG_W, new_h), Image.Resampling.LANCZOS) + + def place_cell(col_x1, row_y1, page_name, label, tint, row_img_h, node_def=None, shared_start_pages=None, shared_start_tints=None): + """ + Draw one table cell: label bar + screenshot at STANDARD_IMG_W. + Cell is vertically centered inside a row band driven by row_img_h. + Returns both frame and screenshot bounds for downstream routing. + """ + cx1 = col_x1 + cell_pad + cx2 = cx1 + cell_content_w + + # Fit each frame to the actual image height so the border hugs the image. + shot = fit_shot_std(page_name) + content_h = shot.height if shot is not None else row_img_h + cell_h = cell_tag_h + 2 * img_pad + content_h + 2 * cell_pad + row_h = cell_tag_h + 2 * img_pad + row_img_h + 2 * cell_pad + cy1 = row_y1 + max(0, (row_h - cell_h) // 2) + cy2 = cy1 + cell_h + + # Determine emphasis state for highlight + is_emphasis_start = node_def and node_def.get('emphasis_start') + is_emphasis_end = node_def and node_def.get('emphasis_end') + has_click_marker = bool(node_def and node_def.get('show_marker')) + is_clean_node = not has_click_marker + is_shared_start_page = bool(shared_start_pages and page_name in shared_start_pages) + is_start_signature = bool((is_emphasis_start or is_shared_start_page) and is_clean_node) + + signature_tint = tint + if is_start_signature and shared_start_tints and page_name in shared_start_tints: + signature_tint = shared_start_tints[page_name] + + tint_rgb = hex_to_rgb(tint) + signature_tint_rgb = hex_to_rgb(signature_tint) + cell_top = tint_towards_white(tint, 0.94) + cell_bottom = tint_towards_white(tint, 0.88) + + # Start-signature redesign: stronger visual presence with an outer ring. + if is_start_signature: + ring_pad = int(10 * s) + ring_top = tint_towards_white(signature_tint, 0.84) + ring_bottom = tint_towards_white(signature_tint, 0.68) + draw_soft_rounded_gradient( + [cx1 - ring_pad, cy1 - ring_pad, cx2 + ring_pad, cy2 + ring_pad], + radius=int(18 * s), + c1=ring_top, + c2=ring_bottom, + outline=signature_tint, + outline_w=int(2 * s), + vertical=True, + ) + + cell_top = tint_towards_white(signature_tint, 0.90) + cell_bottom = tint_towards_white(signature_tint, 0.78) + + # Cell box with enhanced border for emphasized nodes + border_width = int(8 * s) if is_start_signature else (int(6 * s) if is_emphasis_end else int(3 * s)) + draw_soft_rounded_gradient( + [cx1, cy1, cx2, cy2], + radius=int(14 * s), + c1=cell_top, + c2=cell_bottom, + outline=signature_tint if is_start_signature else tint, + outline_w=border_width, + vertical=True, + ) + + if is_start_signature: + # Double-edge look for start frames to make them stand out from others. + inner_pad = int(8 * s) + final_draw.rounded_rectangle( + [cx1 + inner_pad, cy1 + inner_pad, cx2 - inner_pad, cy2 - inner_pad], + radius=int(10 * s), outline=signature_tint, width=int(2 * s) + ) + + # Label bar + bar_color_rgb = signature_tint_rgb if is_start_signature else tint_rgb + bar_top = mix_rgb(bar_color_rgb, (255, 255, 255), 0.12) if is_start_signature else mix_rgb(bar_color_rgb, (255, 255, 255), 0.22) + bar_bottom = mix_rgb(bar_color_rgb, (255, 255, 255), 0.02) if is_start_signature else mix_rgb(bar_color_rgb, (255, 255, 255), 0.08) + draw_soft_rounded_gradient( + [cx1, cy1, cx2, cy1 + cell_tag_h], + radius=int(12 * s), + c1=bar_top, + c2=bar_bottom, + outline=None, + vertical=True, + ) + final_draw.rectangle([cx1, cy1 + cell_tag_h - int(6 * s), cx2, cy1 + cell_tag_h], + fill=bar_bottom) + final_draw.text((cx1 + int(10 * s), cy1 + int(18 * s)), + label, fill="#ffffff", font=get_font(int(11 * s)), anchor="lm") + + # Screenshot — always STANDARD_IMG_W wide + ix = cx1 + img_pad + iy = cy1 + cell_tag_h + img_pad + if shot is not None: + final_img.paste(shot, (int(ix), int(iy))) + return { + "frame": (int(cx1), int(cy1), int(cx2), int(cy2)), + "image": (int(ix), int(iy), int(ix) + shot.width, int(iy) + shot.height), + } + else: + mx = (cx1 + cx2) // 2 + my = (cy1 + cy2) // 2 + final_draw.text((mx, my), page_name, fill="#64748b", + font=get_font(int(10 * s)), anchor="mm") + return { + "frame": (int(cx1), int(cy1), int(cx2), int(cy2)), + "image": (int(cx1), int(cy1), int(cx2), int(cy2)), + } + + def draw_frame_box(rect, title, subtitle, tint): + x1, y1, x2, y2 = rect + frame_top = tint_towards_white(tint, 0.96) + frame_bottom = tint_towards_white(tint, 0.90) + draw_soft_rounded_gradient( + [x1, y1, x2, y2], + radius=int(18 * s), + c1=frame_top, + c2=frame_bottom, + outline=tint, + outline_w=int(3 * s), + vertical=True, + ) + + bar_h = int(48 * s) + tint_rgb = hex_to_rgb(tint) + bar_top = mix_rgb(tint_rgb, (255, 255, 255), 0.20) + bar_bottom = mix_rgb(tint_rgb, (255, 255, 255), 0.04) + draw_soft_rounded_gradient( + [x1, y1, x2, y1 + bar_h], + radius=int(16 * s), + c1=bar_top, + c2=bar_bottom, + outline=None, + vertical=True, + ) + final_draw.rectangle([x1, y1 + bar_h - int(8 * s), x2, y1 + bar_h], fill=bar_bottom) + final_draw.text((x1 + int(12 * s), y1 + int(16 * s)), + title, fill="#ffffff", font=get_font(int(14 * s)), anchor="lm") + final_draw.text((x1 + int(12 * s), y1 + int(36 * s)), + subtitle, fill="#edf2ff", font=get_font(int(11 * s)), anchor="lm") + + def draw_arrow_with_label(sx, sy, dx, dy, label, color): + mid_x = sx + (dx - sx) * 0.45 + path = [(sx, sy), (mid_x, sy), (mid_x, dy), (dx, dy)] + for i in range(len(path) - 1): + final_draw.line([path[i], path[i + 1]], fill=color, width=int(4 * s)) + angle = atan2(dy - path[-2][1], dx - path[-2][0]) + aln, alw = int(16 * s), int(9 * s) + xa = dx - aln * cos(angle); ya = dy - aln * sin(angle) + perp = angle + 3.14159 / 2 + final_draw.polygon([(dx, dy), + (xa + alw * cos(perp), ya + alw * sin(perp)), + (xa - alw * cos(perp), ya - alw * sin(perp))], fill=color) + lx = (path[1][0] + path[2][0]) / 2 + ly = min(path[1][1], path[2][1]) - int(16 * s) + tw = final_draw.textlength(label, font=get_font(int(11 * s))) + final_draw.rounded_rectangle( + [lx - tw / 2 - int(10 * s), ly - int(17 * s), + lx + tw / 2 + int(10 * s), ly + int(6 * s)], + radius=int(8 * s), fill=color) + final_draw.text((lx, ly - int(4 * s)), label, + fill="#ffffff", font=get_font(int(11 * s)), anchor="mm") + + def render_frame(frame_rect, table, tint, row_img_heights): + fx1, fy1, fx2, fy2 = frame_rect + # Content area starts below frame title bar + cx1 = fx1 + inner_pad + cy1 = fy1 + frame_tag_h + inner_pad + + cols = table['cols'] + max_rows = max(len(c['rows']) for c in cols) + + # Build cumulative row y-positions + row_tops = [] + cy = cy1 + for rh in row_img_heights: + row_tops.append(cy) + cy += cell_tag_h + 2 * img_pad + rh + 2 * cell_pad + + node_boxes = {} + for col_idx, col in enumerate(cols): + col_x1 = cx1 + col_idx * col_slot_w + for row_idx, node in enumerate(col['rows']): + rh = row_img_heights[row_idx] + bbox = place_cell(col_x1, row_tops[row_idx], + node['page'], node['label'], tint, rh, node_def=node, + shared_start_pages=START_SIGNATURE_PAGES, + shared_start_tints=START_SIGNATURE_PAGE_TINT) + node_boxes[node['id']] = bbox + + if col_idx < len(cols) - 1: + sep_x = col_x1 + col_slot_w - arrow_gap // 2 + final_draw.line([sep_x, int(cy1), sep_x, int(cy)], + fill="#d1d5db", width=int(2 * s)) + + # Draw horizontal row separator before each row > 0 in this column + if row_idx > 0: + sep_y = row_tops[row_idx] + final_draw.line([col_x1, sep_y, col_x1 + col_slot_w, sep_y], + fill="#d1d5db", width=int(2 * s)) + + # Click markers + for node_id, bounds in node_boxes.items(): + node_def = next( + n for c in cols for n in c['rows'] if n['id'] == node_id) + if node_def.get('show_marker'): + bbox = bounds['image'] + cmx = int((bbox[0] + bbox[2]) / 2) + cmy = int((bbox[1] + bbox[3]) / 2) + + marker_box_id = node_def.get('marker_box_id') + if marker_box_id and marker_box_id in boxes: + mb = boxes[marker_box_id] + page_w = _orig.get(node_def['page'], (1600, 900))[0] + scale = (bbox[2] - bbox[0]) / page_w if page_w else 1 + cmx = int(bbox[0] + (mb['x'] + mb['width'] / 2) * scale) + cmy = int(bbox[1] + (mb['y'] + mb['height'] / 2) * scale) + + r, g, b = hex_to_rgb(tint) + draw_soft_gradient_circle(final_img, cmx, cmy, (r, g, b)) + draw_cursor_icon(final_img, cmx, cmy, tint, scale=1.38 * s) + + # Arrows + for edge in table['edges']: + src_bounds = node_boxes.get(edge['src']) + dst_bounds = node_boxes.get(edge['dst']) + if src_bounds is None or dst_bounds is None: + continue + src_frame = src_bounds['frame'] + dst_frame = dst_bounds['frame'] + dst_x = dst_frame[0] - int(6 * s) + draw_arrow_with_label( + src_frame[2], (src_frame[1] + src_frame[3]) / 2, + dst_x, (dst_frame[1] + dst_frame[3]) / 2, + edge['label'], edge['color']) + + # ── Compose canvas ────────────────────────────────────────────────────── + final_draw.text((outer_pad, outer_pad + int(18 * s)), + "AT Transit Action Flow (Stacked Frames)", + fill="#1f2a44", font=get_font(int(18 * s)), anchor="lm") + + cursor_y = outer_pad + header_h + for (table, tint, title, subtitle), rh_list, fh in zip(FRAMES, all_row_heights, all_frame_h): + frame_rect = (outer_pad, cursor_y, outer_pad + frame_w, cursor_y + fh) + draw_frame_box(frame_rect, title, subtitle, tint) + render_frame(frame_rect, table, tint, rh_list) + cursor_y += fh + section_gap + + final_img.convert("RGB").save(OUT_PNG) + print(f"saved {OUT_PNG}") + +if __name__ == "__main__": + print("Capturing screenshots...") + boxes, sizes = asyncio.run(capture_all()) + print(f"Composing diagram with {len(NODES)} nodes...") + compose(boxes, sizes) diff --git a/at-transit/web-design/frontend-web-transit-flow.png b/at-transit/web-design/frontend-web-transit-flow.png new file mode 100644 index 0000000..946a309 Binary files /dev/null and b/at-transit/web-design/frontend-web-transit-flow.png differ diff --git a/at-transit/web-design/html/README.md b/at-transit/web-design/html/README.md new file mode 100644 index 0000000..ef6ac43 --- /dev/null +++ b/at-transit/web-design/html/README.md @@ -0,0 +1,17 @@ +# AT Transit Static HTML Showcase + +Generated from page structure in: +- src/app/page.tsx +- src/app/routes/page.tsx +- src/app/routes/[routeId]/page.tsx +- src/app/routes/[routeId]/expanded/page.tsx +- src/app/stops/page.tsx +- src/app/stops/[stopId]/page.tsx +- src/app/stops/details/page.tsx +- src/app/layout.tsx +- src/app/globals.css + +## Notes +- Uses static mock data for preview only. +- Shared CSS copied from the real project and extended with showcase-only helpers. +- Open `index.html` to browse every sample page. diff --git a/at-transit/web-design/html/assets/dark-routes.css b/at-transit/web-design/html/assets/dark-routes.css new file mode 100644 index 0000000..053afbf --- /dev/null +++ b/at-transit/web-design/html/assets/dark-routes.css @@ -0,0 +1,18 @@ +/* Dark showcase overrides for routes.html — minimal, self-contained */ +:root{--bg:linear-gradient(135deg,#0f172a,#1e1b34,#1b2332);--surface:rgba(255,255,255,0.03);--muted:#94a3b8} +html,body{height:100%;background:var(--bg);color:#f8fafc} +.topbar, .topbar__inner, .brand, .nav, .cta-pill{background:transparent} +.brand__title,.brand__subtitle{color:#f8fafc} +.page, .panel, .card, .grid, .zone{background:transparent;border:0;box-shadow:none} +.zone__tag,.chip{background:rgba(255,255,255,0.03);color:#fff} +.card__name{color:#fff} +.card__chips .chip{background:rgba(255,255,255,0.02)} +.pill-link{display:none} +/* tile/grid -> card list adjustments */ +.grid{display:block} +.card{background:linear-gradient(180deg,rgba(255,255,255,0.02),rgba(255,255,255,0.01));border:1px solid rgba(255,255,255,0.03);border-radius:12px;padding:12px;margin-bottom:10px} +.card__head{display:none} +.card__body{padding:0} +.card__num{color:#fff} +.footer, .footer__grid, .footer__col {color:var(--muted)} +@media (max-width:900px){body{background:#0f172a}} diff --git a/at-transit/web-design/html/assets/logo.svg b/at-transit/web-design/html/assets/logo.svg new file mode 100644 index 0000000..76b45a9 --- /dev/null +++ b/at-transit/web-design/html/assets/logo.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/at-transit/web-design/html/assets/styles.css b/at-transit/web-design/html/assets/styles.css new file mode 100644 index 0000000..52405ef --- /dev/null +++ b/at-transit/web-design/html/assets/styles.css @@ -0,0 +1,1310 @@ +/* ============================================================ + AT Transit — bold-creative light theme + Ported from flow_ui/ui/_shared.css + index.html inline styles + ============================================================ */ + +:root { + --bg: #f7f9fd; + --surface: #ffffff; + --ink: #1f2a44; + --ink-muted: #4a5876; + --muted: #6f7b95; + --line: #e9eef7; + + --sky-50: #dbeafe; --sky-700: #1d4ed8; + --purple-50: #ede9fe; --purple-700: #6d28d9; + --pink-50: #fce7f3; --pink-700: #be185d; + --mint-50: #d1fae5; --mint-700: #047857; + --green-50: #dcfce7; --green-700: #15803d; + --amber-50: #fef3c7; --amber-700: #b45309; + + --grad-sky: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%); + --grad-purple: linear-gradient(135deg, #8b5cf6 0%, #c084fc 100%); + --grad-pink: linear-gradient(135deg, #ec4899 0%, #f472b6 100%); + --grad-mint: linear-gradient(135deg, #10b981 0%, #34d399 100%); + --grad-amber: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%); + --grad-cta: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%); + + --radius: 16px; + --radius-lg: 22px; + --shadow-sm: 0 4px 14px rgba(20, 40, 90, .06); + --shadow-md: 0 10px 24px rgba(20, 40, 90, .10); + --shadow-lg: 0 18px 36px rgba(15, 23, 42, .14); +} + +* { box-sizing: border-box; } +html, body { margin: 0; padding: 0; } +body { + font-family: "Noto Sans Thai", "Prompt", "Sukhumvit Set", "Sarabun", + system-ui, -apple-system, sans-serif; + background: var(--bg); + color: var(--ink); + min-height: 100vh; +} +a { color: inherit; text-decoration: none; } +img { max-width: 100%; display: block; } + +/* ---------- Layout helpers ---------- */ +.container { max-width: 1200px; margin: 0 auto; padding: 0 28px; } +@media (max-width: 640px) { .container { padding: 0 18px; } } +.main { padding: 40px 0 24px; } + +/* ---------- Topbar ---------- */ +.topbar { + position: sticky; top: 0; z-index: 50; + background: #ffffff; + border-bottom: 1px solid var(--line); + box-shadow: 0 2px 8px rgba(20, 40, 90, .04); +} +.topbar__inner { + display: flex; align-items: center; gap: 18px; + padding: 14px 28px; max-width: 1200px; margin: 0 auto; +} +.brand { display: flex; align-items: center; gap: 12px; } +.brand__logo { + width: 44px; height: 44px; border-radius: 12px; + background: var(--grad-cta); + padding: 4px; +} +.brand__title { margin: 0; font-weight: 800; font-size: 1.05rem; color: var(--ink); } +.brand__subtitle { margin: 0; font-size: .72rem; color: var(--muted); } + +.nav { margin-left: auto; display: flex; gap: 28px; } +.nav a { + color: var(--ink-muted); font-size: .92rem; font-weight: 600; + padding: 6px 4px; border-bottom: 2px solid transparent; transition: color .15s; +} +.nav a.active { color: var(--pink-700); border-bottom-color: #ec4899; } +.nav a:hover { color: var(--ink); } + +.cta-pill { + background: var(--grad-cta); color: #fff; padding: 10px 22px; + border-radius: 999px; font-weight: 700; font-size: .88rem; + box-shadow: 0 6px 14px rgba(124, 58, 237, .3); + display: inline-block; +} + +@media (max-width: 820px) { + .nav { display: none; } + .brand__subtitle { display: none; } +} + +/* ---------- Hero ---------- */ +.hero { + position: relative; overflow: hidden; + padding: 56px 0 64px; + background: linear-gradient(180deg, #f0ebff 0%, #ffe8ee 50%, #fff4d6 100%); + text-align: center; +} +.hero__blob { + position: absolute; border-radius: 50%; + filter: blur(50px); opacity: .55; z-index: 0; +} +.hero__blob.one { width: 220px; height: 220px; background: #b794f4; top: -50px; left: 8%; } +.hero__blob.two { width: 260px; height: 260px; background: #f9a8d4; top: 40%; right: 8%; } +.hero__blob.three { width: 180px; height: 180px; background: #fde68a; bottom: -40px; left: 38%; } +.hero__inner { position: relative; z-index: 1; } + +.hero__badge { + display: inline-block; + background: rgba(255, 255, 255, .8); + backdrop-filter: blur(6px); + color: var(--purple-700); + padding: 6px 16px; border-radius: 999px; + font-size: .82rem; font-weight: 700; + margin-bottom: 18px; + box-shadow: 0 4px 10px rgba(124, 58, 237, .12); +} +.hero h1 { + margin: 0 0 26px; + font-size: clamp(1.6rem, 4vw, 2.4rem); + font-weight: 800; line-height: 1.35; color: var(--ink); +} +.hero__lead { + margin: -6px auto 0; + max-width: 640px; + color: var(--ink-muted); + font-size: 1rem; + line-height: 1.7; +} +.hero__grad { + background: linear-gradient(120deg, #d946ef 10%, #a855f7 60%, #6366f1 100%); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + background-clip: text; +} +.hero__actions { + margin: 28px auto 0; + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); + gap: 14px; + max-width: 860px; +} +.pill-link { + display: flex; + align-items: center; + justify-content: center; + min-height: 58px; + background: rgba(255, 255, 255, .88); + color: var(--ink); + padding: 12px 18px; + border-radius: 18px; + font-weight: 800; + font-size: .98rem; + border: 1px solid rgba(124, 58, 237, .18); + box-shadow: 0 10px 22px rgba(40, 60, 120, .10); + transition: transform .15s, box-shadow .15s, border-color .15s; +} +.pill-link:hover { transform: translateY(-2px); box-shadow: 0 14px 24px rgba(40, 60, 120, .16); } +.pill-link--primary { + background: var(--grad-cta); + color: #fff; + border-color: transparent; +} +.pill-link--secondary { + background: rgba(255, 255, 255, .95); + border-color: rgba(59, 130, 246, .22); +} +.pill-link--accent { + background: rgba(255, 255, 255, .95); + border-color: rgba(236, 72, 153, .22); +} + +@media (max-width: 900px) { + .hero__actions { grid-template-columns: 1fr; } +} + +/* ---------- Zones / Cards ---------- */ +.zone { margin-bottom: 36px; } +.zone__head { + display: flex; align-items: center; gap: 14px; margin-bottom: 14px; + flex-wrap: wrap; +} +.zone__tag { + padding: 5px 14px; border-radius: 999px; + font-size: .82rem; font-weight: 700; +} +.zone__tag.sky { background: var(--sky-50); color: var(--sky-700); } +.zone__tag.purple { background: var(--purple-50); color: var(--purple-700); } +.zone__tag.pink { background: var(--pink-50); color: var(--pink-700); } +.zone__tag.mint { background: var(--mint-50); color: var(--mint-700); } +.zone__desc { color: var(--muted); font-size: .88rem; margin: 0; } + +.grid { + display: grid; gap: 18px; + grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); +} + +.card { + display: flex; gap: 12px; align-items: center; + padding: 14px; border-radius: 12px; background: #fff; color: inherit; + box-shadow: 0 6px 18px rgba(20, 40, 90, 0.06); border: 1px solid var(--line); + transition: transform .12s ease, box-shadow .12s ease; +} +.card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12); } + +.card__head { width: 64px; height: 64px; display:flex; align-items:center; justify-content:center; border-radius:10px; flex-shrink:0; } +.card__head.sky { background: var(--grad-sky); } +.card__head.purple { background: var(--grad-purple); } +.card__head.pink { background: var(--grad-pink); } +.card__head.mint { background: var(--grad-mint); } +.card__head.amber { background: var(--grad-amber); } + +.card__badge { color: #fff; font-size: 18px; font-weight: 800; } +.card__body { flex:1; padding: 0; } +.card__name { margin: 0; font-size: 1rem; color: var(--ink); font-weight: 800; } +.card__meta { margin-top:6px; font-size: 13px; color: var(--muted); } +.card__chips { margin-top:10px; display:flex; gap:8px; } +.chip { background: rgba(0,0,0,0.04); padding:6px 10px; border-radius:999px; font-size:12px; color: var(--ink-muted); font-weight:700; } +.chip.sky { background: var(--sky-50); color: var(--sky-700); } +.chip.purple { background: var(--purple-50); color: var(--purple-700); } +.chip.pink { background: var(--pink-50); color: var(--pink-700); } +.chip.mint { background: var(--mint-50); color: var(--mint-700); } +.chip.green { background: var(--green-50); color: var(--green-700); } +.chip.amber { background: var(--amber-50); color: var(--amber-700); } + +/* ---------- Stats summary ---------- */ +.summary { padding: 8px 0 40px; } +.summary__grid { + display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; +} +.stat { + padding: 28px 18px; text-align: center; + border-radius: 18px; margin: 0; +} +.stat h3 { margin: 0 0 4px; font-size: 2rem; color: var(--ink); font-weight: 800; } +.stat p { margin: 0; font-size: .82rem; color: var(--ink-muted); font-weight: 600; } +.stat.pink { background: var(--pink-50); } +.stat.sky { background: var(--sky-50); } +.stat.purple { background: var(--purple-50); } +.stat.mint { background: var(--mint-50); } +@media (max-width: 720px) { + .summary__grid { grid-template-columns: repeat(2, 1fr); } +} + +/* ---------- Generic content (routes/stops detail pages) ---------- */ +.page { max-width: 1200px; margin: 0 auto; padding: 28px 28px 60px; } +.section-title { margin: 28px 0 14px; font-size: 1.25rem; color: var(--ink); font-weight: 800; } +.muted { color: var(--muted); } + +.panel { + background: #fff; border-radius: var(--radius); + box-shadow: var(--shadow-sm); padding: 22px 24px; + border: 1px solid var(--line); +} +.crumbs { color: var(--muted); font-size: .85rem; margin: 8px 0 12px; } +.crumbs a { color: var(--purple-700); font-weight: 600; } +.crumbs a:hover { text-decoration: underline; } + +.pill { + display: inline-block; padding: 5px 12px; border-radius: 999px; + background: var(--purple-50); color: var(--purple-700); + font-size: .78rem; font-weight: 700; +} +.pill--alt { background: var(--pink-50); color: var(--pink-700); } + +.table { + width: 100%; border-collapse: separate; border-spacing: 0; + margin-top: 14px; + background: linear-gradient(180deg, #ffffff 0%, #fbfbff 100%); + border-radius: var(--radius); overflow: hidden; + border: 1px solid var(--line); + box-shadow: var(--shadow-sm); +} +.table th, .table td { padding: 14px 18px; text-align: left; font-size: .92rem; } +.table th { + background: linear-gradient(180deg, #f3eefe 0%, #fde7f0 100%); + color: var(--ink); font-weight: 800; + font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; + border-bottom: 1px solid var(--line); +} +.table tr + tr td { border-top: 1px solid var(--line); } +.table tbody tr:hover td { background: #faf8ff; } + +.map-wrap { + height: 360px; border-radius: var(--radius); overflow: hidden; + border: 1px solid var(--line); +} + +/* ---------- Stop detail (map + gallery) ---------- */ +.stop-detail__split { + display: grid; + grid-template-columns: 1.1fr 1fr; + gap: 18px; + margin-bottom: 8px; +} +@media (max-width: 900px) { + .stop-detail__split { grid-template-columns: 1fr; } +} +.stop-detail__gallery { + display: flex; flex-direction: column; gap: 10px; + background: #fff; border-radius: var(--radius); + border: 1px solid var(--line); box-shadow: var(--shadow-sm); + overflow: hidden; +} +.stop-detail__gallery--empty, +.stop-detail__map--empty { + display: flex; align-items: center; justify-content: center; + min-height: 320px; background: #f4f6fc; color: var(--muted); +} +.stop-detail__hero-img { + width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; +} +.stop-detail__thumbs { + display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; + padding: 0 10px 10px; +} +.stop-detail__thumbs img { + width: 100%; aspect-ratio: 1 / 1; object-fit: cover; + border-radius: 10px; border: 1px solid var(--line); +} +.stop-detail__map { + height: 100%; min-height: 360px; + border-radius: var(--radius); overflow: hidden; + border: 1px solid var(--line); box-shadow: var(--shadow-sm); + background: #e5edf7; +} +.stop-detail__placeholder { + font-size: .95rem; font-weight: 600; +} + +/* ---------- Schedule card list (soft gradient, modern) ---------- */ +.schedule-list { + display: grid; gap: 14px; margin-top: 14px; +} +.schedule-card { + position: relative; + display: grid; grid-template-columns: minmax(220px, 320px) 1fr; + gap: 18px; align-items: center; + padding: 18px 20px 18px 26px; + background: linear-gradient(135deg, #ffffff 0%, #fbfaff 60%, #fff5fb 100%); + border: 1px solid var(--line); + border-radius: var(--radius-lg); + box-shadow: var(--shadow-sm); + overflow: hidden; + transition: transform .15s ease, box-shadow .15s ease; +} +.schedule-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); } +.schedule-card__rail { + position: absolute; left: 0; top: 0; bottom: 0; width: 6px; + background: var(--grad-cta); +} +.schedule-card--sky .schedule-card__rail { background: var(--grad-sky); } +.schedule-card--purple .schedule-card__rail { background: var(--grad-purple); } +.schedule-card--pink .schedule-card__rail { background: var(--grad-pink); } +.schedule-card--mint .schedule-card__rail { background: var(--grad-mint); } +.schedule-card--amber .schedule-card__rail { background: var(--grad-amber); } +.schedule-card--sky { background: linear-gradient(135deg, #ffffff 0%, #f0f6ff 100%); } +.schedule-card--purple { background: linear-gradient(135deg, #ffffff 0%, #f6f1ff 100%); } +.schedule-card--pink { background: linear-gradient(135deg, #ffffff 0%, #fff0f7 100%); } +.schedule-card--mint { background: linear-gradient(135deg, #ffffff 0%, #ecfdf5 100%); } +.schedule-card--amber { background: linear-gradient(135deg, #ffffff 0%, #fff7e8 100%); } + +.schedule-card__head { + display: flex; flex-direction: column; gap: 10px; +} +.schedule-card__route { + display: inline-flex; flex-direction: column; align-items: flex-start; + padding: 10px 16px; border-radius: 14px; + color: #fff; min-width: 140px; + box-shadow: 0 8px 18px rgba(15, 23, 42, .15); + background: var(--grad-cta); +} +.schedule-card__route.sky { background: var(--grad-sky); } +.schedule-card__route.purple { background: var(--grad-purple); } +.schedule-card__route.pink { background: var(--grad-pink); } +.schedule-card__route.mint { background: var(--grad-mint); } +.schedule-card__route.amber { background: var(--grad-amber); } +.schedule-card__route-label { + font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; + opacity: .85; font-weight: 700; +} +.schedule-card__route-id { + font-size: 1.5rem; font-weight: 900; letter-spacing: .02em; line-height: 1.1; +} +.schedule-card__meta { + display: flex; flex-direction: column; gap: 4px; +} +.schedule-card__direction { + display: inline-flex; align-items: center; gap: 6px; + font-weight: 700; color: var(--ink); font-size: .92rem; +} +.schedule-card__note { + font-size: .82rem; color: var(--ink-muted); +} + +.schedule-card__times { + display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; +} +.schedule-card__time { + display: inline-flex; align-items: center; gap: 5px; + padding: 7px 12px; border-radius: 999px; + font-size: .88rem; font-weight: 700; letter-spacing: .02em; + color: var(--ink); + background: linear-gradient(135deg, #ffffff 0%, #f3eefe 100%); + border: 1px solid #e3d9fb; + box-shadow: 0 2px 6px rgba(124, 58, 237, .08); +} +.schedule-card__time:hover { + background: var(--grad-cta); color: #fff; border-color: transparent; +} +.schedule-card__empty { + font-size: .85rem; color: var(--muted); font-style: italic; +} + +@media (max-width: 720px) { + .schedule-card { grid-template-columns: 1fr; gap: 12px; padding: 16px 16px 16px 22px; } + .schedule-card__route { width: 100%; } +} + +/* Detail-page hero (inside .page wrapper) */ +.page > .hero { + border-radius: var(--radius-lg); + margin-bottom: 22px; + padding: 30px 28px; + text-align: left; + background: linear-gradient(135deg, #ede9fe 0%, #fce7f3 100%); +} +.page > .hero h1 { + font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 6px 0 10px; +} + +/* ---------- Footer (rich dark) ---------- */ +.footer { + margin-top: 48px; + background: + radial-gradient(circle at 0% 0%, rgba(122, 76, 192, .35), transparent 35%), + radial-gradient(circle at 100% 10%, rgba(48, 113, 184, .35), transparent 35%), + linear-gradient(180deg, #1a1830 0%, #0f1126 100%); + color: #cfd5ec; + padding: 48px 0 0; +} +.footer .container { max-width: 1200px; margin: 0 auto; padding: 0 24px; } +.footer__grid { + display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.1fr; gap: 28px; +} +.footer__brand { display: flex; flex-direction: column; gap: 12px; } +.footer__brand-row { display: flex; align-items: center; gap: 12px; } +.footer__brand-row img { + width: 48px; height: 48px; border-radius: 12px; + background: #fff; padding: 4px; object-fit: contain; +} +.footer__brand-row strong { + display: block; color: #fff; font-size: 1.05rem; + font-weight: 800; letter-spacing: .01em; +} +.footer__brand-row span { display: block; color: #9aa3c3; font-size: .82rem; margin-top: 2px; } +.footer__brand p { margin: 0; color: #b6bdda; font-size: .88rem; line-height: 1.6; } + +.footer__col h4 { + margin: 0 0 14px; color: #fff; font-size: .9rem; + font-weight: 800; letter-spacing: .03em; text-transform: uppercase; +} +.footer__col ul { + list-style: none; padding: 0; margin: 0; + display: flex; flex-direction: column; gap: 8px; +} +.footer__col ul a { + color: #cfd5ec; font-size: .9rem; transition: color .15s; + display: inline-flex; align-items: center; gap: 8px; +} +.footer__col ul a::before { content: "›"; color: #a855f7; font-weight: 800; } +.footer__col ul a:hover { color: #fff; } +.footer__contact .row { margin-bottom: 8px; } +.footer__contact a, .footer__contact span { + display: inline-flex; align-items: center; gap: 8px; + color: #cfd5ec; font-size: .88rem; +} + +.footer__sponsors { + margin-top: 36px; padding-top: 28px; + border-top: 1px solid rgba(255, 255, 255, .08); +} +.footer__sponsors h4 { margin: 0 0 6px; color: #fff; font-size: .95rem; font-weight: 800; } +.footer__sponsors .lead { margin: 0 0 18px; color: #9aa3c3; font-size: .85rem; } +.sponsor-strip { + display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; +} +.sponsor-tile { + background: #fff; border-radius: 12px; padding: 10px; + display: flex; align-items: center; justify-content: center; + aspect-ratio: 5 / 3; overflow: hidden; + transition: transform .15s, box-shadow .15s; +} +.sponsor-tile img { + width: 100%; height: 100%; + object-fit: contain; +} +.sponsor-tile:hover { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(0, 0, 0, .35); } + +.footer__bottom { + margin-top: 36px; padding: 18px 0 22px; + border-top: 1px solid rgba(255, 255, 255, .08); + text-align: center; +} +.footer__bottom p { margin: 0; color: #8d96b8; font-size: .82rem; letter-spacing: .02em; } +.footer__bottom .pill { + display: inline-block; margin-left: 10px; padding: 2px 10px; + border-radius: 999px; background: rgba(122, 76, 192, .25); + color: #d8c7ff; font-size: .72rem; font-weight: 700; +} + +@media (max-width: 980px) { .footer__grid { grid-template-columns: 1fr 1fr; } } +@media (max-width: 640px) { + .footer__grid { grid-template-columns: 1fr; } + .footer { padding: 36px 0 0; } +} + +/* ============================================================ + Modern soft-gradient list pages (/stops, /routes) + ============================================================ */ +.page-hero { + position: relative; overflow: hidden; + border-radius: var(--radius-lg); + padding: 44px 36px 38px; + margin-bottom: 22px; + background: + radial-gradient(120% 140% at 0% 0%, #ede9fe 0%, transparent 55%), + radial-gradient(120% 140% at 100% 0%, #fce7f3 0%, transparent 55%), + radial-gradient(120% 140% at 50% 120%, #fef3c7 0%, transparent 55%), + linear-gradient(135deg, #ffffff 0%, #fbfaff 100%); + border: 1px solid rgba(168, 85, 247, .12); + box-shadow: var(--shadow-sm); +} +.page-hero--alt { + background: + radial-gradient(120% 140% at 0% 0%, #dbeafe 0%, transparent 55%), + radial-gradient(120% 140% at 100% 0%, #ede9fe 0%, transparent 55%), + radial-gradient(120% 140% at 50% 120%, #d1fae5 0%, transparent 55%), + linear-gradient(135deg, #ffffff 0%, #f7faff 100%); + border-color: rgba(59, 130, 246, .14); +} +.page-hero__blob { + position: absolute; border-radius: 50%; filter: blur(46px); opacity: .55; + pointer-events: none; +} +.page-hero__blob--a { width: 220px; height: 220px; background: #c4b5fd; top: -50px; left: -40px; } +.page-hero__blob--b { width: 260px; height: 260px; background: #f9a8d4; top: 30%; right: -60px; } +.page-hero__blob--c { width: 180px; height: 180px; background: #fde68a; bottom: -50px; left: 40%; } +.page-hero--alt .page-hero__blob--a { background: #93c5fd; } +.page-hero--alt .page-hero__blob--b { background: #c4b5fd; } +.page-hero--alt .page-hero__blob--c { background: #6ee7b7; } +.page-hero__inner { position: relative; z-index: 1; } +.page-hero__badge { + display: inline-block; padding: 6px 14px; border-radius: 999px; + background: rgba(255, 255, 255, .7); backdrop-filter: blur(6px); + border: 1px solid rgba(168, 85, 247, .25); + color: var(--purple-700); font-size: .72rem; font-weight: 800; + letter-spacing: .08em; +} +.page-hero__title { + margin: 14px 0 8px; font-size: 2.4rem; font-weight: 900; + color: var(--ink); letter-spacing: -.01em; line-height: 1.15; +} +.page-hero__title-grad { + background: var(--grad-cta); -webkit-background-clip: text; + background-clip: text; color: transparent; + margin-left: 10px; +} +.page-hero--alt .page-hero__title-grad { background: var(--grad-sky); -webkit-background-clip: text; background-clip: text; } +.page-hero__subtitle { margin: 0 0 16px; color: var(--ink-muted); font-size: 1rem; } +.page-hero__stats { display: flex; flex-wrap: wrap; gap: 10px; } +.page-hero__stat { + display: inline-flex; align-items: baseline; gap: 6px; + padding: 8px 16px; border-radius: 999px; + background: rgba(255, 255, 255, .8); backdrop-filter: blur(8px); + border: 1px solid rgba(15, 23, 42, .06); + font-size: .85rem; color: var(--ink-muted); font-weight: 600; + box-shadow: 0 4px 12px rgba(124, 58, 237, .08); +} +.page-hero__stat b { + background: var(--grad-cta); -webkit-background-clip: text; + background-clip: text; color: transparent; + font-size: 1.05rem; font-weight: 900; +} + +.map-wrap--soft { border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); margin-bottom: 18px; } + +/* Toolbar (search + filter chips) */ +.toolbar { + display: flex; flex-wrap: wrap; gap: 12px; align-items: center; + padding: 14px 16px; margin: 18px 0; + background: linear-gradient(135deg, #ffffff 0%, #fbfaff 100%); + border: 1px solid var(--line); + border-radius: var(--radius); + box-shadow: var(--shadow-sm); +} +.toolbar__search { + flex: 1 1 280px; + display: inline-flex; align-items: center; gap: 8px; + padding: 8px 14px; border-radius: 12px; + background: #f4f6fc; border: 1px solid var(--line); + color: var(--muted); +} +.toolbar__search input { + flex: 1; border: 0; outline: 0; background: transparent; + font: inherit; color: var(--ink); +} +.toolbar__chips { display: flex; flex-wrap: wrap; gap: 8px; } + +.chip-soft { + display: inline-flex; align-items: center; gap: 6px; + padding: 6px 12px; border-radius: 999px; + font-size: .78rem; font-weight: 700; letter-spacing: .01em; + border: 1px solid transparent; +} +.chip-soft--sky { background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); color: var(--sky-700); border-color: #cfe0fb; } +.chip-soft--purple { background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%); color: var(--purple-700); border-color: #ddd3fb; } +.chip-soft--pink { background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%); color: var(--pink-700); border-color: #f9cce3; } +.chip-soft--mint { background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%); color: var(--mint-700); border-color: #b6ecd0; } +.chip-soft--amber { background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%); color: var(--amber-700); border-color: #fde9a8; } + +/* Route category sections (/routes) */ +.toolbar--stacked { + align-items: flex-start; +} +.route-category-summary { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); + gap: 14px; + margin: 18px 0 22px; +} +.route-category-summary__card { + padding: 18px 18px 20px; + border-radius: var(--radius-lg); + border: 1px solid var(--line); + background: linear-gradient(135deg, #ffffff 0%, #fbfaff 100%); + box-shadow: var(--shadow-sm); +} +.route-category-summary__card h2 { + margin: 8px 0 6px; + font-size: 1rem; + line-height: 1.35; + color: var(--ink); +} +.route-category-summary__card p { + margin: 0; + color: var(--ink-muted); + font-size: .84rem; + line-height: 1.55; +} +.route-category-summary__card strong { + display: inline-block; + margin-top: 14px; + font-size: 1rem; + font-weight: 900; +} +.route-category-summary__eyebrow { + display: inline-flex; + align-items: center; + min-height: 30px; + padding: 0 12px; + border-radius: 999px; + font-size: .72rem; + font-weight: 800; + letter-spacing: .08em; +} +.route-category-summary__card--sky { + background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%); +} +.route-category-summary__card--sky .route-category-summary__eyebrow { + background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%); + color: var(--sky-700); +} +.route-category-summary__card--purple { + background: linear-gradient(135deg, #ffffff 0%, #f5f3ff 100%); +} +.route-category-summary__card--purple .route-category-summary__eyebrow { + background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%); + color: var(--purple-700); +} +.route-category-summary__card--pink { + background: linear-gradient(135deg, #ffffff 0%, #fdf2f8 100%); +} +.route-category-summary__card--pink .route-category-summary__eyebrow { + background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%); + color: var(--pink-700); +} +.route-category-summary__card--mint { + background: linear-gradient(135deg, #ffffff 0%, #ecfdf5 100%); +} +.route-category-summary__card--mint .route-category-summary__eyebrow { + background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%); + color: var(--mint-700); +} +.route-category-summary__card--amber { + background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%); +} +.route-category-summary__card--amber .route-category-summary__eyebrow { + background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); + color: var(--amber-700); +} +.route-category-list { + display: flex; + flex-direction: column; + gap: 24px; +} +.route-category { + padding: 20px; + border-radius: 24px; + border: 1px solid var(--line); + box-shadow: var(--shadow-sm); +} +.route-category--sky { + background: linear-gradient(180deg, #f8fbff 0%, #eff6ff 100%); +} +.route-category--purple { + background: linear-gradient(180deg, #faf7ff 0%, #f5f3ff 100%); +} +.route-category--pink { + background: linear-gradient(180deg, #fff8fb 0%, #fdf2f8 100%); +} +.route-category--mint { + background: linear-gradient(180deg, #f7fefb 0%, #ecfdf5 100%); +} +.route-category--amber { + background: linear-gradient(180deg, #fffdf7 0%, #fffbeb 100%); +} +.route-category__head { + display: flex; + justify-content: space-between; + align-items: flex-start; + gap: 18px; + margin-bottom: 14px; +} +.route-category__badge { + display: inline-flex; + align-items: center; + min-height: 30px; + padding: 0 12px; + border-radius: 999px; + font-size: .72rem; + font-weight: 800; + letter-spacing: .08em; + margin-bottom: 10px; +} +.route-category__badge--sky { + background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%); + color: var(--sky-700); +} +.route-category__badge--purple { + background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%); + color: var(--purple-700); +} +.route-category__badge--pink { + background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%); + color: var(--pink-700); +} +.route-category__badge--mint { + background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%); + color: var(--mint-700); +} +.route-category__badge--amber { + background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); + color: var(--amber-700); +} +.route-category__title { + margin: 0 0 6px; + font-size: 1.3rem; + font-weight: 900; + color: var(--ink); +} +.route-category__desc { + margin: 0; + color: var(--ink-muted); + font-size: .92rem; + line-height: 1.6; + max-width: 760px; +} +.route-category__stats { + display: flex; + flex-wrap: wrap; + gap: 8px; +} +.route-category__empty { + padding: 20px 18px; + border-radius: 18px; + border: 1px dashed rgba(124, 58, 237, .22); + background: rgba(255, 255, 255, .72); + color: var(--muted); + font-weight: 700; +} + +/* Tile grid + tile component */ +.tile-grid { + display: grid; gap: 16px; margin-top: 4px; + grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); +} +.tile { + position: relative; + display: grid; grid-template-columns: 76px 1fr auto; + gap: 14px; align-items: center; + padding: 16px 18px; border-radius: var(--radius-lg); + border: 1px solid var(--line); + background: linear-gradient(135deg, #ffffff 0%, #fbfaff 100%); + box-shadow: var(--shadow-sm); + color: inherit; overflow: hidden; + transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; +} +.tile::before { + content: ""; position: absolute; inset: 0; + background: var(--grad-cta); opacity: 0; + transition: opacity .2s ease; + border-radius: inherit; pointer-events: none; + mix-blend-mode: multiply; +} +.tile:hover { + transform: translateY(-3px); + box-shadow: var(--shadow-md); + border-color: rgba(168, 85, 247, .28); +} +.tile--sky { background: linear-gradient(135deg, #ffffff 0%, #f0f6ff 100%); } +.tile--purple { background: linear-gradient(135deg, #ffffff 0%, #f6f1ff 100%); } +.tile--pink { background: linear-gradient(135deg, #ffffff 0%, #fff0f7 100%); } +.tile--mint { background: linear-gradient(135deg, #ffffff 0%, #ecfdf5 100%); } +.tile--amber { background: linear-gradient(135deg, #ffffff 0%, #fff7e8 100%); } + +.tile__badge { + width: 64px; height: 64px; border-radius: 18px; + display: flex; align-items: center; justify-content: center; + color: #fff; font-size: 30px; font-weight: 900; + box-shadow: 0 10px 22px rgba(15, 23, 42, .18); + background: var(--grad-cta); +} +.tile__badge--num { font-size: 18px; letter-spacing: .02em; padding: 0 6px; text-align: center; } +.tile__badge--sky { background: var(--grad-sky); } +.tile__badge--purple { background: var(--grad-purple); } +.tile__badge--pink { background: var(--grad-pink); } +.tile__badge--mint { background: var(--grad-mint); } +.tile__badge--amber { background: var(--grad-amber); } + +.tile__body { min-width: 0; } +.tile__title { + margin: 0 0 4px; font-size: 1rem; font-weight: 800; color: var(--ink); + line-height: 1.3; + overflow: hidden; text-overflow: ellipsis; display: -webkit-box; + -webkit-line-clamp: 2; -webkit-box-orient: vertical; +} +.tile__meta { + margin: 0 0 8px; font-size: .82rem; color: var(--ink-muted); + overflow: hidden; text-overflow: ellipsis; white-space: nowrap; +} +.tile__chips { display: flex; flex-wrap: wrap; gap: 6px; } +.tile__arrow { + font-size: 1.4rem; color: var(--muted); font-weight: 700; + transition: transform .18s ease, color .18s ease; +} +.tile:hover .tile__arrow { color: var(--purple-700); transform: translateX(4px); } + +@media (max-width: 720px) { + .page-hero { padding: 32px 22px 28px; } + .page-hero__title { font-size: 1.8rem; } + .tile { grid-template-columns: 56px 1fr; padding: 14px; } + .tile__badge { width: 52px; height: 52px; font-size: 24px; border-radius: 14px; } + .tile__arrow { display: none; } +} + +/* ============ Route detail hero ============ */ +.route-hero { padding-top: 38px; } +.route-hero__top { + display: grid; + grid-template-columns: 96px 1fr; + gap: 20px; + align-items: center; + position: relative; z-index: 1; +} +.route-hero__badge { + width: 96px; height: 96px; + border-radius: 26px; + background: linear-gradient(135deg,#7c3aed,#ec4899 55%,#f59e0b); + color: #fff; + font-weight: 900; font-size: 1.9rem; + letter-spacing: .5px; + display: flex; align-items: center; justify-content: center; + box-shadow: 0 18px 38px rgba(124,58,237,.35), inset 0 1px 0 rgba(255,255,255,.4); + border: 3px solid rgba(255,255,255,.7); +} +.route-hero__title-wrap { min-width: 0; } +.route-hero__chips { + display: flex; flex-wrap: wrap; gap: 6px; + margin-bottom: 8px; +} +.route-hero__actions { + margin-top: 18px; + display: flex; flex-wrap: wrap; gap: 12px; + position: relative; z-index: 1; +} +.route-hero__cta { + display: inline-flex; align-items: center; gap: 8px; + padding: 12px 22px; + border-radius: 999px; + background: linear-gradient(135deg,#7c3aed,#ec4899); + color: #fff !important; font-weight: 800; font-size: .95rem; + text-decoration: none; + box-shadow: 0 12px 28px rgba(124,58,237,.32); + transition: transform .18s ease, box-shadow .18s ease; +} +.route-hero__cta:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(124,58,237,.42); } +.route-hero__back { + display: inline-flex; align-items: center; gap: 6px; + padding: 12px 18px; + border-radius: 999px; + background: rgba(255,255,255,.72); + border: 1px solid rgba(124,58,237,.18); + color: var(--purple-700) !important; font-weight: 700; font-size: .9rem; + text-decoration: none; + backdrop-filter: blur(6px); + transition: background .18s ease; +} +.route-hero__back:hover { background: #fff; } + +/* ============ Route map section ============ */ +.route-map-section { margin-top: 28px; } +.route-map-section__head { + display: flex; align-items: center; justify-content: space-between; + gap: 14px; flex-wrap: wrap; + margin-bottom: 10px; +} +.route-map-section__head .section-title { margin: 0; } +.route-map-section__legend { + display: inline-flex; flex-wrap: wrap; gap: 14px; + font-size: .85rem; color: var(--ink-muted); font-weight: 600; +} +.route-map-section__legend span { display: inline-flex; align-items: center; gap: 6px; } +.dot { + width: 12px; height: 12px; border-radius: 50%; + display: inline-block; + border: 2px solid #fff; + box-shadow: 0 0 0 1px rgba(0,0,0,.08); +} +.dot--start { background: linear-gradient(135deg,#34d399,#10b981); } +.dot--mid { background: linear-gradient(135deg,#a78bfa,#7c3aed); } +.dot--end { background: linear-gradient(135deg,#fb7185,#e11d48); } +.route-map { + height: 460px; + border: 1px solid rgba(124,58,237,.12); +} +.route-map-empty { + padding: 28px; + text-align: center; + border-radius: 20px; + background: linear-gradient(135deg,#fdf4ff,#eef2ff); + border: 1px dashed rgba(124,58,237,.25); +} + +/* ============ Stops timeline ============ */ +.stop-timeline { + list-style: none; + padding: 0; margin: 14px 0 0; + display: flex; flex-direction: column; gap: 10px; + position: relative; +} +.stop-node { + position: relative; + display: grid; + grid-template-columns: 56px 1fr auto; + align-items: center; + gap: 14px; + padding: 14px 16px; + border-radius: 18px; + background: linear-gradient(135deg,#ffffff 0%,#fbfaff 100%); + border: 1px solid rgba(124,58,237,.10); + box-shadow: 0 6px 16px rgba(31,28,68,.05); + transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; +} +.stop-node:hover { + transform: translateY(-1px); + border-color: rgba(124,58,237,.25); + box-shadow: 0 10px 24px rgba(124,58,237,.12); +} +.stop-node__line { + position: absolute; + left: 43px; top: 100%; + width: 2px; height: 10px; + background: linear-gradient(180deg, rgba(124,58,237,.35), rgba(124,58,237,0)); +} +.stop-node:last-child .stop-node__line { display: none; } +.stop-node__bullet { + width: 44px; height: 44px; + border-radius: 14px; + background: linear-gradient(135deg,#a78bfa,#7c3aed); + color: #fff; + font-weight: 800; font-size: 1.05rem; + display: flex; align-items: center; justify-content: center; + border: 3px solid #fff; + box-shadow: 0 6px 14px rgba(124,58,237,.30); +} +.stop-node__bullet.is-start { background: linear-gradient(135deg,#34d399,#10b981); box-shadow: 0 6px 14px rgba(16,185,129,.30); } +.stop-node__bullet.is-end { background: linear-gradient(135deg,#fb7185,#e11d48); box-shadow: 0 6px 14px rgba(225,29,72,.28); } +.stop-node--sky .stop-node__bullet:not(.is-start):not(.is-end) { background: linear-gradient(135deg,#7dd3fc,#0284c7); } +.stop-node--pink .stop-node__bullet:not(.is-start):not(.is-end) { background: linear-gradient(135deg,#fda4af,#db2777); } +.stop-node--mint .stop-node__bullet:not(.is-start):not(.is-end) { background: linear-gradient(135deg,#6ee7b7,#059669); } +.stop-node--amber .stop-node__bullet:not(.is-start):not(.is-end) { background: linear-gradient(135deg,#fcd34d,#d97706); } +.stop-node__body { min-width: 0; } +.stop-node__head { + display: flex; flex-wrap: wrap; align-items: center; gap: 8px; + margin-bottom: 4px; +} +.stop-node__title { + font-weight: 800; font-size: 1.02rem; + color: var(--ink, #1f1c44); + text-decoration: none; +} +.stop-node__title:hover { color: var(--purple-700); } +.stop-node__meta { + display: flex; flex-wrap: wrap; gap: 8px; + align-items: center; + font-size: .85rem; color: var(--ink-muted); +} +.stop-node__loc { font-size: .82rem; } +.stop-node__warn { + font-size: .75rem; font-weight: 700; + padding: 2px 8px; border-radius: 999px; + background: #fff7ed; color: #c2410c; + border: 1px solid #fed7aa; +} +.stop-node__arrow { + font-size: 1.4rem; color: var(--muted); + font-weight: 700; text-decoration: none; + transition: transform .18s ease, color .18s ease; +} +.stop-node:hover .stop-node__arrow { color: var(--purple-700); transform: translateX(4px); } + +@media (max-width: 720px) { + .route-hero__top { grid-template-columns: 76px 1fr; gap: 14px; } + .route-hero__badge { width: 76px; height: 76px; font-size: 1.5rem; border-radius: 22px; } + .route-map { height: 360px; } + .stop-node { grid-template-columns: 48px 1fr; padding: 12px 14px; } + .stop-node__bullet { width: 40px; height: 40px; font-size: .95rem; border-radius: 12px; } + .stop-node__line { left: 37px; } + .stop-node__arrow { display: none; } +} + + + +/* ===================== */ +/* Static showcase extras */ +/* ===================== */ +.showcase-shell { + background: linear-gradient(180deg, #f4f7ff 0%, #fff8fc 45%, #fffdf4 100%); + min-height: 100vh; +} +.showcase-main { + max-width: 1280px; + margin: 0 auto; + padding: 32px 28px 64px; +} +.showcase-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); + gap: 20px; +} +.showcase-card { + background: rgba(255,255,255,.92); + border: 1px solid rgba(124,58,237,.12); + border-radius: 24px; + overflow: hidden; + box-shadow: 0 22px 40px rgba(76, 29, 149, .12); +} +.showcase-card__head { + padding: 18px 20px 14px; + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; +} +.showcase-card__head h2 { + margin: 0; + font-size: 1.05rem; +} +.showcase-card__meta { + font-size: .84rem; + color: var(--muted); +} +.showcase-card__actions { + display: flex; + flex-wrap: wrap; + gap: 10px; + padding: 0 20px 16px; +} +.showcase-card__actions a { + display: inline-flex; + align-items: center; + justify-content: center; + min-height: 40px; + padding: 0 14px; + border-radius: 999px; + background: var(--grad-cta); + color: #fff; + font-weight: 700; + font-size: .85rem; +} +.showcase-frame { + width: 100%; + height: 360px; + border: 0; + background: #fff; + border-top: 1px solid var(--line); +} +.mock-map, +.mock-gallery, +.mock-hero-media, +.mock-inline-banner { + position: relative; + overflow: hidden; + border-radius: 22px; +} +.mock-map { + min-height: 320px; + background: + radial-gradient(circle at 18% 26%, rgba(59,130,246,.35), transparent 18%), + radial-gradient(circle at 74% 28%, rgba(236,72,153,.28), transparent 16%), + radial-gradient(circle at 60% 74%, rgba(16,185,129,.26), transparent 18%), + linear-gradient(135deg, #eef4ff 0%, #ffffff 34%, #fff4fb 100%); + border: 1px solid rgba(124,58,237,.12); +} +.mock-map::before, +.mock-map::after { + content: ''; + position: absolute; + inset: 0; +} +.mock-map::before { + background-image: + linear-gradient(rgba(59,130,246,.08) 1px, transparent 1px), + linear-gradient(90deg, rgba(59,130,246,.08) 1px, transparent 1px); + background-size: 40px 40px; +} +.mock-map::after { + background: + linear-gradient(120deg, transparent 0 8%, rgba(124,58,237,.18) 8% 10%, transparent 10% 26%, rgba(236,72,153,.18) 26% 28%, transparent 28% 70%, rgba(16,185,129,.18) 70% 72%, transparent 72% 100%), + linear-gradient(180deg, transparent 0 14%, rgba(59,130,246,.12) 14% 16%, transparent 16% 52%, rgba(245,158,11,.12) 52% 54%, transparent 54% 100%); +} +.mock-map__pin, +.mock-map__line, +.mock-map__legend { + position: absolute; + z-index: 2; +} +.mock-map__pin { + width: 18px; + height: 18px; + border-radius: 50%; + border: 3px solid #fff; + box-shadow: 0 6px 16px rgba(15,23,42,.18); +} +.mock-map__pin--start { background: #10b981; } +.mock-map__pin--mid { background: #8b5cf6; } +.mock-map__pin--end { background: #ec4899; } +.mock-map__line { + left: 14%; + right: 12%; + top: 42%; + height: 4px; + border-radius: 999px; + background: linear-gradient(90deg, #10b981 0%, #8b5cf6 50%, #ec4899 100%); + transform: rotate(-11deg); + box-shadow: 0 8px 16px rgba(124,58,237,.18); +} +.mock-map__legend { + right: 18px; + bottom: 18px; + background: rgba(255,255,255,.88); + backdrop-filter: blur(10px); + border: 1px solid rgba(124,58,237,.12); + border-radius: 16px; + padding: 10px 12px; + font-size: .78rem; + color: var(--ink-muted); + display: grid; + gap: 6px; +} +.mock-map__legend b { color: var(--ink); } +.mock-gallery { + min-height: 320px; + background: linear-gradient(135deg, #f7f0ff 0%, #ffffff 45%, #fff0f8 100%); + border: 1px solid var(--line); + display: grid; + place-items: center; +} +.mock-gallery__grid { + width: 100%; + display: grid; + grid-template-columns: 2fr 1fr; + gap: 10px; + padding: 12px; +} +.mock-gallery__hero, +.mock-gallery__stack > div { + border-radius: 16px; + min-height: 140px; + position: relative; + overflow: hidden; +} +.mock-gallery__hero { + background: linear-gradient(135deg, #312e81 0%, #7c3aed 38%, #ec4899 100%); +} +.mock-gallery__stack { + display: grid; + gap: 10px; +} +.mock-gallery__stack > div:nth-child(1) { background: linear-gradient(135deg, #0ea5e9, #22d3ee); } +.mock-gallery__stack > div:nth-child(2) { background: linear-gradient(135deg, #10b981, #84cc16); } +.mock-gallery__stack > div:nth-child(3) { background: linear-gradient(135deg, #f59e0b, #fb7185); } +.mock-gallery__label { + position: absolute; + left: 16px; + bottom: 16px; + background: rgba(255,255,255,.16); + color: #fff; + border: 1px solid rgba(255,255,255,.24); + border-radius: 999px; + padding: 6px 12px; + font-size: .78rem; + font-weight: 700; + backdrop-filter: blur(8px); +} +.mock-inline-banner { + min-height: 220px; + background: linear-gradient(135deg, #1e1b4b 0%, #4c1d95 38%, #be185d 100%); + border: 1px solid rgba(255,255,255,.08); +} +.mock-inline-banner::after { + content: 'AT Transit Preview'; + position: absolute; + left: 20px; + bottom: 20px; + color: rgba(255,255,255,.92); + font-weight: 800; + letter-spacing: .04em; + font-size: 1.1rem; +} +.mock-empty { + display: grid; + place-items: center; + min-height: 220px; + border: 1px dashed rgba(124,58,237,.18); + border-radius: 22px; + background: linear-gradient(135deg, rgba(255,255,255,.8) 0%, rgba(243,232,255,.9) 100%); + color: var(--muted); + font-weight: 700; +} +.redirect-demo { + min-height: 100vh; + display: grid; + place-items: center; + background: linear-gradient(180deg, #f3e8ff 0%, #fdf2f8 55%, #fff7ed 100%); + padding: 32px; +} +.redirect-demo__card { + max-width: 720px; + width: 100%; + background: rgba(255,255,255,.92); + border-radius: 28px; + box-shadow: 0 22px 50px rgba(124,58,237,.14); + border: 1px solid rgba(124,58,237,.12); + padding: 32px; +} +.redirect-demo__code { + display: inline-flex; + align-items: center; + gap: 8px; + padding: 8px 12px; + background: #111827; + color: #fff; + border-radius: 999px; + font-size: .82rem; + font-weight: 700; +} +.kv-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); + gap: 12px; +} +.kv-card { + background: rgba(255,255,255,.78); + border: 1px solid var(--line); + border-radius: 16px; + padding: 14px 16px; +} +.kv-card small { + display: block; + color: var(--muted); + margin-bottom: 8px; +} +.code-block { + background: #0f172a; + color: #e2e8f0; + border-radius: 18px; + padding: 18px 20px; + overflow: auto; + font-size: .84rem; +} +.tile-grid--compact { + grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); +} +@media (max-width: 900px) { + .showcase-main { padding: 24px 18px 56px; } + .showcase-frame { height: 300px; } + .showcase-card__head { align-items: flex-start; flex-direction: column; } +} diff --git a/at-transit/web-design/html/home.html b/at-transit/web-design/html/home.html new file mode 100644 index 0000000..21be493 --- /dev/null +++ b/at-transit/web-design/html/home.html @@ -0,0 +1,138 @@ + + + + + + AT Transit - Home Preview + + + + + + + + +
+ +
+ +
+
+
+
+
+ ✨ ยินดีต้อนรับ +

+ สถานีขนส่งผู้โดยสารภายใน
+ จังหวัดอ่างทอง +

+

+ หน้า mockup นี้อิงจาก src/app/page.tsx เพื่อใช้ preview หน้า Home โดยไม่ต้องรัน Next.js หรือ backend +

+ +
+
+
+
+
+
+ กรุงเทพมหานคร +

เส้นทางเชื่อมต่อกรุงเทพมหานคร · 2 เส้นทาง

+
+ +
+
+
+ เชื่อมต่อจังหวัดใกล้เคียง +

เส้นทางเชื่อมต่อจังหวัดใกล้เคียง · 3 เส้นทาง

+
+ +
+
+
+ + + + + + diff --git a/at-transit/web-design/html/index.html b/at-transit/web-design/html/index.html new file mode 100644 index 0000000..206d55d --- /dev/null +++ b/at-transit/web-design/html/index.html @@ -0,0 +1,67 @@ + + + + + + AT Transit Showcase + + + + + + + +
+
+
+
+
+
+
+ 🗂️ Static HTML Showcase +

รวมหน้าเว็บตัวอย่างทั้งหมดของ AT Transit Frontend

+

Bundle นี้สรุป routes/page files จากโปรเจกต์ Next.js แล้วแปลงเป็น static HTML ที่เปิดดูได้ทันทีในโฟลเดอร์เดียว

+ +
+
+
+ + +
+

Route detail

src/app/routes/[routeId]/page.tsx
/routes/101
+ + +
+ +
+

Stop detail

src/app/stops/details/page.tsx
/stops/details?code=AT001
+ + +
+ +
+
+
+ + + diff --git a/at-transit/web-design/html/route-detail-101.html b/at-transit/web-design/html/route-detail-101.html new file mode 100644 index 0000000..a0d3018 --- /dev/null +++ b/at-transit/web-design/html/route-detail-101.html @@ -0,0 +1,171 @@ + + + + + + AT Transit - Route 101 Preview + + + + + + + + +
+ +
+ +
+
+ + + +
+
101
+
+
+ REGIONAL + minibus + 2 จังหวัด +
+

อ่างทอง → อยุธยา

+

เส้นทางหมายเลข 101 · ผ่าน 5 จุดจอด · 3 รอบเวลา

+
+
+
+ 5 จุดจอด + 3 รอบเวลา + 2 จังหวัด +
+ +
+

ภาพประกอบ

+ +
+
+

ติดต่อ

+
    +
  • โทร: +66 64 963 9025
  • +
  • LINE: @attransit
  • +
  • Facebook: AT Transit Angthong
  • +
+
+
+

เมตาดาตา

+
{
+  "operator": "AT Transit Demo",
+  "route_group_code": "REGIONAL",
+  "vehicle_type": "minibus",
+  "wheelchair_access": false,
+  "preview_mode": true
+}
+
+
+
+
+

เส้นทางวิ่ง

+ + ต้นทาง + จุดผ่าน + ปลายทาง + +
+
+
+
+
+
+
+
+
Preview mapอิง layout จาก LazyMapViewไม่เรียก Leaflet / backend
+
+
+
+

จุดจอดตามลำดับ (5)

+
    +
  1. 1
    terminal📍 เมืองอ่างทอง · อ่างทอง
    →
  2. +
  3. 2
    market📍 วิเศษชัยชาญ · อ่างทอง
    →
  4. +
  5. 3
    pickup📍 บางบาล · พระนครศรีอยุธยา
    →
  6. +
  7. 4
    landmark📍 พระนครศรีอยุธยา
    →
  8. +
  9. 5
    station📍 พระนครศรีอยุธยา
    →
  10. +
+
+
+

ตารางเวลา (3)

+
+
สถานีขนส่งอ่างทองจุดต้นทาง
เที่ยวเช้าวันจันทร์ - ศุกร์
🕒 06:00🕒 07:30🕒 09:00
+
สถานีขนส่งอ่างทองจุดต้นทาง
เที่ยวกลางวันวิ่งทุกวัน
🕒 11:00🕒 12:30🕒 14:00
+
สถานีขนส่งอ่างทองจุดต้นทาง
เที่ยวเย็นรอบสุดท้ายก่อนปิดบริการ
🕒 16:00🕒 17:30🕒 19:00
+
+
+
+ + + + + + diff --git a/at-transit/web-design/html/route-expanded.html b/at-transit/web-design/html/route-expanded.html new file mode 100644 index 0000000..39e3032 --- /dev/null +++ b/at-transit/web-design/html/route-expanded.html @@ -0,0 +1,29 @@ + + + + + + AT Transit - Expanded Route Redirect Preview + + + + + + + +
+
+ /routes/[routeId]/expanded +

Expanded Route Page

+

ใน source จริง หน้า src/app/routes/[routeId]/expanded/page.tsx ทำหน้าที่ redirect ไปยัง /routes/[routeId]

+
+
ตัวอย่าง routeId101
+
Redirect targetroute-detail-101.html
+
Behaviorserver-side redirect
+
+

เปิดหน้าเป้าหมาย

+
+
+ + + diff --git a/at-transit/web-design/html/routes.html b/at-transit/web-design/html/routes.html new file mode 100644 index 0000000..6064405 --- /dev/null +++ b/at-transit/web-design/html/routes.html @@ -0,0 +1,189 @@ + + + + + + AT Transit - Routes Preview + + + + + + +
+ +
+ +
+
+
+
+
+
+ 🛣️ ROUTE NETWORK +

เส้นทางเดินรถแยกตามประเภท

+

Preview layout ใหม่ของ routes listing โดยแบ่งเส้นทางเป็น 4 หมวดหลักตามประเภทการวิ่ง

+
+ 12 เส้นทางทั้งหมด + 4 หมวดที่มีข้อมูล + 4 หมวดการแสดงผล +
+
+
+ +
+ +
+ หมวดเส้นทางภายใน อบต เทศบาล · 3 + หมวดเส้นทางเข้ากรุงเทพฯ · 2 + หมวดเส้นทางระหว่างจังหวัด · 4 + หมวดเส้นทางภายในจังหวัด · 3 +
+
+ +
+
+
LOCAL LOOP
+

หมวดเส้นทางภายใน อบต เทศบาล

+

รถวิ่งระยะใกล้ในชุมชน เน้นการเชื่อมตลาด หน่วยงานท้องถิ่น และย่านบริการหลัก

+ 3 เส้นทาง +
+
+
BANGKOK CONNECT
+

หมวดเส้นทางเข้ากรุงเทพฯ

+

แสดงเฉพาะเส้นทางที่มุ่งหน้าเข้ากรุงเทพฯ เพื่อให้ผู้ใช้งานเลือกเส้นทางเข้าเมืองได้ง่าย

+ 2 เส้นทาง +
+
+
INTERPROVINCIAL
+

หมวดเส้นทางระหว่างจังหวัด

+

รวมเส้นทางเชื่อมต่อจังหวัดข้างเคียงและ hub การเดินทางสำคัญ

+ 4 เส้นทาง +
+
+
IN-PROVINCE
+

หมวดเส้นทางภายในจังหวัด

+

เหมาะสำหรับการค้นหาเส้นทางที่วิ่งระหว่างอำเภอ ตลาด และชุมชนในจังหวัดเดียวกัน

+ 3 เส้นทาง +
+
+ +
+
+
+
+ LOCAL LOOP +

หมวดเส้นทางภายใน อบต เทศบาล

+

รถวิ่งในพื้นที่ชุมชน เน้นการเชื่อมจุดเศรษฐกิจ ตลาดเทศบาล และหน่วยงานท้องถิ่น

+
+
3 เส้นทาง
+
+ +
+ +
+
+
+ BANGKOK CONNECT +

หมวดเส้นทางเข้ากรุงเทพฯ

+

แยกกลุ่มชัดเจนสำหรับผู้โดยสารที่ต้องการเดินทางเข้ากรุงเทพฯ หรือเชื่อมต่อสถานีหลัก

+
+
2 เส้นทาง
+
+ +
+ +
+
+
+ INTERPROVINCIAL +

หมวดเส้นทางระหว่างจังหวัด

+

รวมเส้นทางที่เชื่อมหลายจังหวัดและเส้นทางระยะกลางถึงไกล เพื่อให้เทียบตัวเลือกได้ในกลุ่มเดียว

+
+
4 เส้นทาง
+
+ +
+ +
+
+
+ IN-PROVINCE +

หมวดเส้นทางภายในจังหวัด

+

รวมเส้นทางที่เชื่อมอำเภอและชุมชนสำคัญภายในจังหวัดเดียวกัน เพื่อให้หาง่ายขึ้นกว่าการรวมทุกเส้นทางไว้ grid เดียว

+
+
3 เส้นทาง
+
+ +
+
+
+ + + + diff --git a/at-transit/web-design/html/stop-detail-at001.html b/at-transit/web-design/html/stop-detail-at001.html new file mode 100644 index 0000000..f99ca8c --- /dev/null +++ b/at-transit/web-design/html/stop-detail-at001.html @@ -0,0 +1,106 @@ + + + + + + AT Transit - Stop AT001 Preview + + + + + + + + +
+ +
+ +
+
+ terminal +

สถานีขนส่งอ่างทอง

+

📍 เมืองอ่างทอง / อ่างทอง · 14.5890, 100.4551

+
+
+ +
+
+
Single stop previewแทนแผนที่ Leaflet จริง
+
+
+

ตารางเวลาที่จุดนี้

+
+
เส้นทาง101
🧭 ไปอยุธยา📝 รถออกทุก 90 นาที
🕒 06:00🕒 07:30🕒 09:00
+
เส้นทาง15
🧭 ไปตลาดโพธิ์ทอง📝 เสริมรอบเช้า
🕒 05:45🕒 08:15🕒 10:45
+
+
+ + + + + + diff --git a/at-transit/web-design/html/stop-redirect-at001.html b/at-transit/web-design/html/stop-redirect-at001.html new file mode 100644 index 0000000..ad82dba --- /dev/null +++ b/at-transit/web-design/html/stop-redirect-at001.html @@ -0,0 +1,29 @@ + + + + + + AT Transit - Stop Redirect Preview + + + + + + + +
+
+ /stops/[stopId] +

Stop Redirect Page

+

ใน source จริง หน้า src/app/stops/[stopId]/page.tsx จะ redirect ไป /stops/details?code=...

+
+
ตัวอย่าง stopIdAT001
+
Redirect targetstop-detail-at001.html
+
BehaviornotFound ถ้าไม่มี code
+
+

เปิดหน้าเป้าหมาย

+
+
+ + + diff --git a/at-transit/web-design/html/stops.html b/at-transit/web-design/html/stops.html new file mode 100644 index 0000000..e3baa8e --- /dev/null +++ b/at-transit/web-design/html/stops.html @@ -0,0 +1,119 @@ + + + + + + AT Transit - Stops Preview + + + + + + + + +
+ +
+ +
+
+
+
+
+
+ 🚏 STOP DIRECTORY +

จุดจอดทั่วประเทศ

+

ค้นหาป้าย / สถานีขนส่ง พร้อมแผนที่และเส้นทางที่ผ่าน

+
+ 12 จุดจอด + 10 มีพิกัด + 5 ประเภท +
+
+
+
+
+
+
+
+
+
Stop map previewMock cluster + route markers
+
+
+ +
+ 🚍 สถานีขนส่ง · 2 + 🚏 ป้ายหลัก · 4 + 🛣️ จุดรับส่ง · 3 + 🏪 ตลาด/ชุมชน · 2 + 📍 จุดสังเกต · 1 +
+
+ +
+ + + + + + diff --git a/at-transit/web-design/images/extras/boat-market2transta.jpg b/at-transit/web-design/images/extras/boat-market2transta.jpg new file mode 100644 index 0000000..74c7291 Binary files /dev/null and b/at-transit/web-design/images/extras/boat-market2transta.jpg differ diff --git a/at-transit/web-design/images/extras/boat.jpeg b/at-transit/web-design/images/extras/boat.jpeg new file mode 100644 index 0000000..be57062 Binary files /dev/null and b/at-transit/web-design/images/extras/boat.jpeg differ diff --git a/at-transit/web-design/images/icons/minibus-256x256.ico b/at-transit/web-design/images/icons/minibus-256x256.ico new file mode 100644 index 0000000..61443f4 Binary files /dev/null and b/at-transit/web-design/images/icons/minibus-256x256.ico differ diff --git a/at-transit/web-design/images/icons/minibus-512x512.png b/at-transit/web-design/images/icons/minibus-512x512.png new file mode 100644 index 0000000..46855f2 Binary files /dev/null and b/at-transit/web-design/images/icons/minibus-512x512.png differ diff --git a/at-transit/web-design/images/landmarks/market.png b/at-transit/web-design/images/landmarks/market.png new file mode 100644 index 0000000..9105698 Binary files /dev/null and b/at-transit/web-design/images/landmarks/market.png differ diff --git a/at-transit/web-design/images/landmarks/riverbank.jpg b/at-transit/web-design/images/landmarks/riverbank.jpg new file mode 100644 index 0000000..ff936a4 Binary files /dev/null and b/at-transit/web-design/images/landmarks/riverbank.jpg differ diff --git a/at-transit/web-design/images/landmarks/temple.png b/at-transit/web-design/images/landmarks/temple.png new file mode 100644 index 0000000..619b3b5 Binary files /dev/null and b/at-transit/web-design/images/landmarks/temple.png differ diff --git a/at-transit/web-design/images/landmarks/waterpark.png b/at-transit/web-design/images/landmarks/waterpark.png new file mode 100644 index 0000000..7e7b8b2 Binary files /dev/null and b/at-transit/web-design/images/landmarks/waterpark.png differ diff --git a/at-transit/web-design/images/network/overview-map.png b/at-transit/web-design/images/network/overview-map.png new file mode 100644 index 0000000..a2c9b71 Binary files /dev/null and b/at-transit/web-design/images/network/overview-map.png differ diff --git a/at-transit/web-design/images/partners/7-11.png b/at-transit/web-design/images/partners/7-11.png new file mode 100644 index 0000000..19c8f15 Binary files /dev/null and b/at-transit/web-design/images/partners/7-11.png differ diff --git a/at-transit/web-design/images/partners/airasia-move.png b/at-transit/web-design/images/partners/airasia-move.png new file mode 100644 index 0000000..54f0f55 Binary files /dev/null and b/at-transit/web-design/images/partners/airasia-move.png differ diff --git a/at-transit/web-design/images/partners/bus-pingraow.jpg b/at-transit/web-design/images/partners/bus-pingraow.jpg new file mode 100644 index 0000000..0b87375 Binary files /dev/null and b/at-transit/web-design/images/partners/bus-pingraow.jpg differ diff --git a/at-transit/web-design/images/partners/busonlineticket.png b/at-transit/web-design/images/partners/busonlineticket.png new file mode 100644 index 0000000..4e0ff2d Binary files /dev/null and b/at-transit/web-design/images/partners/busonlineticket.png differ diff --git a/at-transit/web-design/images/partners/lazada.png b/at-transit/web-design/images/partners/lazada.png new file mode 100644 index 0000000..ccf1a2f Binary files /dev/null and b/at-transit/web-design/images/partners/lazada.png differ diff --git a/at-transit/web-design/images/partners/shopee.png b/at-transit/web-design/images/partners/shopee.png new file mode 100644 index 0000000..0d123b9 Binary files /dev/null and b/at-transit/web-design/images/partners/shopee.png differ diff --git a/at-transit/web-design/images/partners/tcl999-angthong.jpg b/at-transit/web-design/images/partners/tcl999-angthong.jpg new file mode 100644 index 0000000..e836852 Binary files /dev/null and b/at-transit/web-design/images/partners/tcl999-angthong.jpg differ diff --git a/at-transit/web-design/images/partners/trip.jpg b/at-transit/web-design/images/partners/trip.jpg new file mode 100644 index 0000000..aa98af9 Binary files /dev/null and b/at-transit/web-design/images/partners/trip.jpg differ diff --git a/at-transit/web-design/images/partners/truck2hand.png b/at-transit/web-design/images/partners/truck2hand.png new file mode 100644 index 0000000..dca8117 Binary files /dev/null and b/at-transit/web-design/images/partners/truck2hand.png differ diff --git a/at-transit/web-design/images/qrcode/101.png b/at-transit/web-design/images/qrcode/101.png new file mode 100644 index 0000000..605ca65 Binary files /dev/null and b/at-transit/web-design/images/qrcode/101.png differ diff --git a/at-transit/web-design/images/qrcode/15.JPG b/at-transit/web-design/images/qrcode/15.JPG new file mode 100644 index 0000000..5dd2984 Binary files /dev/null and b/at-transit/web-design/images/qrcode/15.JPG differ diff --git a/at-transit/web-design/images/qrcode/464.jpeg b/at-transit/web-design/images/qrcode/464.jpeg new file mode 100644 index 0000000..a45f0d2 Binary files /dev/null and b/at-transit/web-design/images/qrcode/464.jpeg differ diff --git a/at-transit/web-design/images/qrcode/902.png b/at-transit/web-design/images/qrcode/902.png new file mode 100644 index 0000000..7294b61 Binary files /dev/null and b/at-transit/web-design/images/qrcode/902.png differ diff --git a/at-transit/web-design/images/routes/101/car.jpeg b/at-transit/web-design/images/routes/101/car.jpeg new file mode 100644 index 0000000..eaa6d8e Binary files /dev/null and b/at-transit/web-design/images/routes/101/car.jpeg differ diff --git a/at-transit/web-design/images/routes/101/hero.jpeg b/at-transit/web-design/images/routes/101/hero.jpeg new file mode 100644 index 0000000..acfe305 Binary files /dev/null and b/at-transit/web-design/images/routes/101/hero.jpeg differ diff --git a/at-transit/web-design/images/routes/1011/car.jpeg b/at-transit/web-design/images/routes/1011/car.jpeg new file mode 100644 index 0000000..b87cfb8 Binary files /dev/null and b/at-transit/web-design/images/routes/1011/car.jpeg differ diff --git a/at-transit/web-design/images/routes/1011/hero.jpeg b/at-transit/web-design/images/routes/1011/hero.jpeg new file mode 100644 index 0000000..b87cfb8 Binary files /dev/null and b/at-transit/web-design/images/routes/1011/hero.jpeg differ diff --git a/at-transit/web-design/images/routes/15/car.jpg b/at-transit/web-design/images/routes/15/car.jpg new file mode 100644 index 0000000..2083c8c Binary files /dev/null and b/at-transit/web-design/images/routes/15/car.jpg differ diff --git a/at-transit/web-design/images/routes/15/hero.jpg b/at-transit/web-design/images/routes/15/hero.jpg new file mode 100644 index 0000000..08f99a9 Binary files /dev/null and b/at-transit/web-design/images/routes/15/hero.jpg differ diff --git a/at-transit/web-design/images/routes/2194/car.jpg b/at-transit/web-design/images/routes/2194/car.jpg new file mode 100644 index 0000000..1e0008a Binary files /dev/null and b/at-transit/web-design/images/routes/2194/car.jpg differ diff --git a/at-transit/web-design/images/routes/2231/car.jpg b/at-transit/web-design/images/routes/2231/car.jpg new file mode 100644 index 0000000..51d5fe7 Binary files /dev/null and b/at-transit/web-design/images/routes/2231/car.jpg differ diff --git a/at-transit/web-design/images/routes/324/car.jpg b/at-transit/web-design/images/routes/324/car.jpg new file mode 100644 index 0000000..74e8e26 Binary files /dev/null and b/at-transit/web-design/images/routes/324/car.jpg differ diff --git a/at-transit/web-design/images/routes/324/hero.jpg b/at-transit/web-design/images/routes/324/hero.jpg new file mode 100644 index 0000000..74e8e26 Binary files /dev/null and b/at-transit/web-design/images/routes/324/hero.jpg differ diff --git a/at-transit/web-design/images/routes/464/car.jpeg b/at-transit/web-design/images/routes/464/car.jpeg new file mode 100644 index 0000000..7df8a0a Binary files /dev/null and b/at-transit/web-design/images/routes/464/car.jpeg differ diff --git a/at-transit/web-design/images/routes/641/car.jpeg b/at-transit/web-design/images/routes/641/car.jpeg new file mode 100644 index 0000000..c33e19d Binary files /dev/null and b/at-transit/web-design/images/routes/641/car.jpeg differ diff --git a/at-transit/web-design/images/routes/902/car.jpg b/at-transit/web-design/images/routes/902/car.jpg new file mode 100644 index 0000000..02ea3c9 Binary files /dev/null and b/at-transit/web-design/images/routes/902/car.jpg differ diff --git a/at-transit/web-design/images/routes/902/hero.jpg b/at-transit/web-design/images/routes/902/hero.jpg new file mode 100644 index 0000000..02ea3c9 Binary files /dev/null and b/at-transit/web-design/images/routes/902/hero.jpg differ diff --git a/at-transit/web-design/images/routes/951/car.jpg b/at-transit/web-design/images/routes/951/car.jpg new file mode 100644 index 0000000..b3b4e56 Binary files /dev/null and b/at-transit/web-design/images/routes/951/car.jpg differ diff --git a/at-transit/web-design/images/routes/952/car.jpg b/at-transit/web-design/images/routes/952/car.jpg new file mode 100644 index 0000000..032161d Binary files /dev/null and b/at-transit/web-design/images/routes/952/car.jpg differ diff --git a/at-transit/web-design/images/routes/952/car.webp b/at-transit/web-design/images/routes/952/car.webp new file mode 100644 index 0000000..d66e876 Binary files /dev/null and b/at-transit/web-design/images/routes/952/car.webp differ diff --git a/at-transit/web-design/images/routes/952/hero.webp b/at-transit/web-design/images/routes/952/hero.webp new file mode 100644 index 0000000..d66e876 Binary files /dev/null and b/at-transit/web-design/images/routes/952/hero.webp differ diff --git a/at-transit/web-design/images/stops/36020.jpg b/at-transit/web-design/images/stops/36020.jpg new file mode 100644 index 0000000..4248ed3 Binary files /dev/null and b/at-transit/web-design/images/stops/36020.jpg differ diff --git a/at-transit/web-design/images/stops/39321.jpg b/at-transit/web-design/images/stops/39321.jpg new file mode 100644 index 0000000..3881f88 Binary files /dev/null and b/at-transit/web-design/images/stops/39321.jpg differ diff --git a/at-transit/web-design/images/stops/42110.jpg b/at-transit/web-design/images/stops/42110.jpg new file mode 100644 index 0000000..82a7bb4 Binary files /dev/null and b/at-transit/web-design/images/stops/42110.jpg differ diff --git a/at-transit/web-design/images/stops/42250.jpg b/at-transit/web-design/images/stops/42250.jpg new file mode 100644 index 0000000..e282daa Binary files /dev/null and b/at-transit/web-design/images/stops/42250.jpg differ diff --git a/at-transit/web-design/images/stops/54950.jpg b/at-transit/web-design/images/stops/54950.jpg new file mode 100644 index 0000000..bfe68d9 Binary files /dev/null and b/at-transit/web-design/images/stops/54950.jpg differ diff --git a/at-transit/web-design/screenshots/busDetail.png b/at-transit/web-design/screenshots/busDetail.png new file mode 100644 index 0000000..6ad32aa Binary files /dev/null and b/at-transit/web-design/screenshots/busDetail.png differ diff --git a/at-transit/web-design/screenshots/busDetailExpanded.png b/at-transit/web-design/screenshots/busDetailExpanded.png new file mode 100644 index 0000000..6ad32aa Binary files /dev/null and b/at-transit/web-design/screenshots/busDetailExpanded.png differ diff --git a/at-transit/web-design/screenshots/busStop.png b/at-transit/web-design/screenshots/busStop.png new file mode 100644 index 0000000..5f86e3b Binary files /dev/null and b/at-transit/web-design/screenshots/busStop.png differ diff --git a/at-transit/web-design/screenshots/index.png b/at-transit/web-design/screenshots/index.png new file mode 100644 index 0000000..147a5ea Binary files /dev/null and b/at-transit/web-design/screenshots/index.png differ diff --git a/at-transit/web-design/screenshots/stopDetail.png b/at-transit/web-design/screenshots/stopDetail.png new file mode 100644 index 0000000..c4fddd3 Binary files /dev/null and b/at-transit/web-design/screenshots/stopDetail.png differ diff --git a/at-transit/web-design/screenshots/stopDetailExpanded.png b/at-transit/web-design/screenshots/stopDetailExpanded.png new file mode 100644 index 0000000..c4fddd3 Binary files /dev/null and b/at-transit/web-design/screenshots/stopDetailExpanded.png differ diff --git a/at-transit/web-design/seed_images.sql b/at-transit/web-design/seed_images.sql new file mode 100644 index 0000000..c2e1981 --- /dev/null +++ b/at-transit/web-design/seed_images.sql @@ -0,0 +1,96 @@ +-- Auto-generated by upload_seed_images.py +-- Run this AFTER 0003_seed.sql is applied. +-- ON CONFLICT (fid) DO NOTHING → safe to re-run. + +-- extras/boat-market2transta.jpg +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('d24014c5-a97b-4723-bbf3-4f32f40465cc', 'misc', 'boat-market2transta', 'photo', '/buckets/transit/misc/boat-market2transta/boat-market2transta.jpg', '/misc/boat-market2transta/boat-market2transta.jpg', 0, '{"mime":"image/jpeg","size_bytes":1362964,"sha256":"0e09c1458ccef6ba9c4cd1b7c10f222f468888a7ad38f30ed732deb558551a9f","width":2048,"height":1536}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- extras/boat.jpeg +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('db884929-1c96-41da-bcb4-bdc90eb46a4b', 'misc', 'boat', 'photo', '/buckets/transit/misc/boat/boat.jpeg', '/misc/boat/boat.jpeg', 0, '{"mime":"image/jpeg","size_bytes":689077,"sha256":"a4598e486bbb8a907d4fbec43828de7d13c6b4cdd4181bd7c14d42b2ab9dbd72","width":3023,"height":1863}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- icons/minibus-256x256.ico +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('33187d1d-6e06-4c16-968f-e2719d8cce37', 'misc', 'minibus-256x256', 'icon', '/buckets/transit/misc/minibus-256x256/minibus-256x256.ico', '/misc/minibus-256x256/minibus-256x256.ico', 0, '{"mime":"image/x-icon","size_bytes":270398,"sha256":"39a3c902f4308412a3ac2cc6893818de03cfbab096f1b10d3f407b572db6cc0d","width":256,"height":256}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- icons/minibus-512x512.png +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('13539d22-b617-45ea-a338-0b8ed68aa533', 'misc', 'minibus-512x512', 'icon', '/buckets/transit/misc/minibus-512x512/minibus-512x512.png', '/misc/minibus-512x512/minibus-512x512.png', 0, '{"mime":"image/png","size_bytes":41183,"sha256":"e56b483a93401d0c3da654eae1236fea74de4c1c4be69a334327db559636e820","width":512,"height":511}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- landmarks/market.png +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('0f0fc957-1992-4362-a49d-10933d4fff79', 'misc', 'market', 'photo', '/buckets/transit/misc/market/market.png', '/misc/market/market.png', 0, '{"mime":"image/png","size_bytes":1993133,"sha256":"960f7612b46cf89e941e4529d7dfc113986763169df4cdcc7e8540f24354f8f8","width":1888,"height":772}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- landmarks/riverbank.jpg +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('b9e7ea71-8161-499b-81cb-13f20ba98494', 'misc', 'riverbank', 'photo', '/buckets/transit/misc/riverbank/riverbank.jpg', '/misc/riverbank/riverbank.jpg', 0, '{"mime":"image/jpeg","size_bytes":86824,"sha256":"dca1bcf90e73f2c5c1fb9eaa6a4da009556987b06353bc4f3bed8ed544b7c7cf","width":960,"height":720}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- landmarks/temple.png +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('b63c6e28-ab1a-481a-a3f1-55367c21eeec', 'misc', 'temple', 'photo', '/buckets/transit/misc/temple/temple.png', '/misc/temple/temple.png', 0, '{"mime":"image/png","size_bytes":1646584,"sha256":"968553163cb8ec35d63345e8968e93f55b5689d60f640a32c3c08929d1b98bcc","width":1910,"height":567}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- landmarks/waterpark.png +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('144ff6ed-6852-4f90-ac4c-1e85fe3fc0e9', 'misc', 'waterpark', 'photo', '/buckets/transit/misc/waterpark/waterpark.png', '/misc/waterpark/waterpark.png', 0, '{"mime":"image/png","size_bytes":1391729,"sha256":"c368d33ad02eafddc63358125d25da5ca7b694c310ca873890b0c8c29039c14c","width":1410,"height":590}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- network/overview-map.png +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('ca5ecf03-ad19-4025-8ece-8b30a38a1cb6', 'misc', 'overview-map', 'map', '/buckets/transit/misc/overview-map/overview-map.png', '/misc/overview-map/overview-map.png', 0, '{"mime":"image/png","size_bytes":3611925,"sha256":"cb9faf131bd98f931ed384a7d3bad84dd88dab85d7c375777f94f45700f4d070","width":2480,"height":3508}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- partners/7-11.png +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('2935df60-9733-4ebb-8b1a-4ef939dd69b9', 'sponsor', '7-11', 'logo', '/buckets/transit/sponsor/7-11/7-11.png', '/sponsor/7-11/7-11.png', 0, '{"mime":"image/png","size_bytes":24009,"sha256":"b6051acf2a3652b0fb9d00be6a00d5e3c0bd9a2e66d1a139e06a523149d0f0f5","width":512,"height":512}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- partners/airasia-move.png +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('0f08c5c2-2eb9-4f1e-97ec-d6a69d25e409', 'sponsor', 'airasia-move', 'logo', '/buckets/transit/sponsor/airasia-move/airasia-move.png', '/sponsor/airasia-move/airasia-move.png', 0, '{"mime":"image/png","size_bytes":21748,"sha256":"ce1f2b2a878baf39b022162d06bc12ed8218049b634d439499cbe47e4c05c2a4","width":512,"height":512}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- partners/bus-pingraow.jpg +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('0df5842a-dbd0-408c-9853-b1ebab067c3d', 'sponsor', 'bus-pingraow', 'logo', '/buckets/transit/sponsor/bus-pingraow/bus-pingraow.jpg', '/sponsor/bus-pingraow/bus-pingraow.jpg', 0, '{"mime":"image/jpeg","size_bytes":100789,"sha256":"ffecf2ed4353fa8f3dba181d4cf2ee1dbfcfc3f16db41860952f0987b0584480","width":959,"height":959}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- partners/busonlineticket.png +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('a18030e7-24d2-4518-b369-09e1b401f865', 'sponsor', 'busonlineticket', 'logo', '/buckets/transit/sponsor/busonlineticket/busonlineticket.png', '/sponsor/busonlineticket/busonlineticket.png', 0, '{"mime":"image/png","size_bytes":26910,"sha256":"1e10a2fb0ea132bf9453199a4cc6e0afa73f070a25d348357299aea807e950de","width":512,"height":512}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- partners/lazada.png +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('28659116-2c07-4092-af55-e21d6e1c3684', 'sponsor', 'lazada', 'logo', '/buckets/transit/sponsor/lazada/lazada.png', '/sponsor/lazada/lazada.png', 0, '{"mime":"image/png","size_bytes":38435,"sha256":"537d48d6964be1bed56ea489ef8ffffc4f69269125bf6fc87ebef82e26fbd327","width":1000,"height":1000}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- partners/shopee.png +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('e9bf7dd2-2d85-494e-9be9-db285408b2e4', 'sponsor', 'shopee', 'logo', '/buckets/transit/sponsor/shopee/shopee.png', '/sponsor/shopee/shopee.png', 0, '{"mime":"image/png","size_bytes":96641,"sha256":"35fb268ed2e8e3ecf2bf5123396f1558bbd53c3c6701ae191f070dcd374a93db","width":512,"height":512}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- partners/tcl999-angthong.jpg +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('902170bc-38d6-48bd-a2d7-4f303e6cb434', 'sponsor', 'tcl999-angthong', 'logo', '/buckets/transit/sponsor/tcl999-angthong/tcl999-angthong.jpg', '/sponsor/tcl999-angthong/tcl999-angthong.jpg', 0, '{"mime":"image/jpeg","size_bytes":2640044,"sha256":"952b9a3571324981a6df0d6183a0b4acc36a160c7fb8c9ad3ccc6c9f943a3e31","width":4032,"height":3024}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- partners/trip.jpg +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('12a3a61c-c4bf-4d89-ae2f-6c64b992b321', 'sponsor', 'trip', 'logo', '/buckets/transit/sponsor/trip/trip.jpg', '/sponsor/trip/trip.jpg', 0, '{"mime":"image/jpeg","size_bytes":3945,"sha256":"afa87e8a2c47d72118d053a2924a9fcefa2e5cfd916dfe49f5e8774819d57638","width":225,"height":225}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- partners/truck2hand.png +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('36e5c42c-8775-4373-8adb-6378ddef7298', 'sponsor', 'truck2hand', 'logo', '/buckets/transit/sponsor/truck2hand/truck2hand.png', '/sponsor/truck2hand/truck2hand.png', 0, '{"mime":"image/png","size_bytes":3761,"sha256":"4245f16ed45f52f3ea17c4ee95076ad50c2a7222dcd886302eae4f4a7abbc237","width":225,"height":225}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- qrcode/101.png +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('40d5a177-f94a-4388-ab21-0374da2de296', 'route', '101', 'map', '/buckets/transit/route/101/101.png', '/route/101/101.png', 9, '{"mime":"image/png","size_bytes":90889,"sha256":"fba0c55aeddb8c8f7b679130513e0b72e755a1246559cbd29c28edac7aba9e05","width":600,"height":600}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- qrcode/15.JPG +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('f4560621-c002-432e-b9a6-edf1cc30895c', 'route', '15', 'map', '/buckets/transit/route/15/15.JPG', '/route/15/15.JPG', 9, '{"mime":"image/jpeg","size_bytes":82619,"sha256":"a8220b5ee86105b801b46361e9fd166f8dbbec013178d7f6b55e4e250217d9f3","width":389,"height":389}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- qrcode/464.jpeg +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('1715ed50-a675-4182-a022-6de247ecc43c', 'route', '464', 'map', '/buckets/transit/route/464/464.jpeg', '/route/464/464.jpeg', 9, '{"mime":"image/jpeg","size_bytes":138467,"sha256":"21a3d653a17db64b3941cdff5a6d01ab14bc56ebf2c9de517908ade9f7ba383f","width":600,"height":600}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- qrcode/902.png +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('d24bdffa-51a0-4b65-88e0-c4df8b67049e', 'route', '902', 'map', '/buckets/transit/route/902/902.png', '/route/902/902.png', 9, '{"mime":"image/png","size_bytes":24035,"sha256":"689569e55d907757b74622ab35c10a20794d12ed81ab8323ded6f58bba4f1598","width":360,"height":360}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- routes/101/car.jpeg +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('164a63f0-ffa4-4d2a-90a6-30b77f5bed12', 'route', '101', 'photo', '/buckets/transit/route/101/car.jpeg', '/route/101/car.jpeg', 0, '{"mime":"image/jpeg","size_bytes":2171446,"sha256":"9f7e11df3184a5a59e72fb4e67d4fc387ad57a344492f95aa5786f339d69fc99","width":4032,"height":3024}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- routes/101/hero.jpeg +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('8b875289-2410-4117-9981-143a5fd39605', 'route', '101', 'hero', '/buckets/transit/route/101/hero.jpeg', '/route/101/hero.jpeg', 1, '{"mime":"image/jpeg","size_bytes":2608208,"sha256":"6b2fd71bd6977aba294457770235c89d43f53e914f83e9e8307d4711df497cab","width":4032,"height":3024}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- routes/1011/car.jpeg +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('a6bab7ca-c66b-4cd5-817a-c0ee750770b7', 'route', '1011', 'photo', '/buckets/transit/route/1011/car.jpeg', '/route/1011/car.jpeg', 0, '{"mime":"image/jpeg","size_bytes":1540789,"sha256":"dc4684bc682fcd8c107521c294b9cdbf9e608e2d7c0d961837db8f9a171011ca","width":3024,"height":3024}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- routes/1011/hero.jpeg +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('f21013dd-bbc5-433f-8dc6-00faa1464f6b', 'route', '1011', 'hero', '/buckets/transit/route/1011/hero.jpeg', '/route/1011/hero.jpeg', 1, '{"mime":"image/jpeg","size_bytes":1540789,"sha256":"dc4684bc682fcd8c107521c294b9cdbf9e608e2d7c0d961837db8f9a171011ca","width":3024,"height":3024}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- routes/15/car.jpg +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('a6890ab9-2678-4b84-a7ef-2cb59d364ce7', 'route', '15', 'photo', '/buckets/transit/route/15/car.jpg', '/route/15/car.jpg', 0, '{"mime":"image/jpeg","size_bytes":238232,"sha256":"b538249de22e80d79020c8347521c83d15dca663e853b1c3e45d6a895f2fb1e5","width":1477,"height":865}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- routes/15/hero.jpg +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('02f16f6d-1f26-4817-ad7a-a8a41d13bf6d', 'route', '15', 'hero', '/buckets/transit/route/15/hero.jpg', '/route/15/hero.jpg', 1, '{"mime":"image/jpeg","size_bytes":75238,"sha256":"e61a69975fd4fa4d7c632cac86ee4802e631674e50dfd406c300347ff7b01399","width":1422,"height":640}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- routes/2194/car.jpg +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('2d962c82-a5aa-4027-9b3a-e7f34269b860', 'route', '2194', 'photo', '/buckets/transit/route/2194/car.jpg', '/route/2194/car.jpg', 0, '{"mime":"image/jpeg","size_bytes":144932,"sha256":"33c2d6bb108aebdced8baf92ff34839f31fb0665c2650748c2969eec5383ea24","width":800,"height":530}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- routes/2231/car.jpg +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('17b58685-f374-4f81-8f05-da9ead7cd5ba', 'route', '2231', 'photo', '/buckets/transit/route/2231/car.jpg', '/route/2231/car.jpg', 0, '{"mime":"image/jpeg","size_bytes":2240408,"sha256":"09c7d96003b7a58d51571cb2cb85ab7aa8f7c5600dce0e75e2dd9ca415f1c5e8","width":4032,"height":3024}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- routes/324/car.jpg +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('6fc147e9-722f-4755-8832-55546c1a3abe', 'route', '324', 'photo', '/buckets/transit/route/324/car.jpg', '/route/324/car.jpg', 0, '{"mime":"image/jpeg","size_bytes":91014,"sha256":"a2564f8af7c5b4a8cbcf6a6064dbfe7444ff129df3fe94fce23d8409f7d25a7f","width":581,"height":380}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- routes/324/hero.jpg +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('0827dc28-41b1-498a-985e-3cf2dfa50e49', 'route', '324', 'hero', '/buckets/transit/route/324/hero.jpg', '/route/324/hero.jpg', 1, '{"mime":"image/jpeg","size_bytes":91014,"sha256":"a2564f8af7c5b4a8cbcf6a6064dbfe7444ff129df3fe94fce23d8409f7d25a7f","width":581,"height":380}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- routes/464/car.jpeg +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('2bee7e3a-7e95-4644-82f1-4ee9bd56582e', 'route', '464', 'photo', '/buckets/transit/route/464/car.jpeg', '/route/464/car.jpeg', 0, '{"mime":"image/jpeg","size_bytes":2842693,"sha256":"42b426e27ab5be215d972611eea4ff03ee9f09b6b8d66470ab0e463f30a01a15","width":4032,"height":3024}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- routes/641/car.jpeg +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('4db1332b-9ec2-4bdc-bfaa-8cc1dee71e5a', 'route', '641', 'photo', '/buckets/transit/route/641/car.jpeg', '/route/641/car.jpeg', 0, '{"mime":"image/jpeg","size_bytes":1521733,"sha256":"320ba83c6b140a7a8c1825442691e16cd048fff16505434579a69883e7b6c1de","width":4032,"height":3024}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- routes/902/car.jpg +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('e42397eb-ffdc-4db4-ad5e-6635eb95986e', 'route', '902', 'photo', '/buckets/transit/route/902/car.jpg', '/route/902/car.jpg', 0, '{"mime":"image/jpeg","size_bytes":221869,"sha256":"49cc989caef34199ed0423fae6bae12f48be7ac8062d35df3bef0112bca5152d","width":1440,"height":1080}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- routes/902/hero.jpg +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('156a66e4-328b-4247-9672-2beac99f7212', 'route', '902', 'hero', '/buckets/transit/route/902/hero.jpg', '/route/902/hero.jpg', 1, '{"mime":"image/jpeg","size_bytes":221869,"sha256":"49cc989caef34199ed0423fae6bae12f48be7ac8062d35df3bef0112bca5152d","width":1440,"height":1080}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- routes/951/car.jpg +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('f7a1a791-ca3f-4d27-af6d-87ceb2738a42', 'route', '951', 'photo', '/buckets/transit/route/951/car.jpg', '/route/951/car.jpg', 0, '{"mime":"image/jpeg","size_bytes":83984,"sha256":"bcaf1832d74f82137e700d5b707ece5921817054adeedbd1395ce0bfdf2ba3b7","width":960,"height":720}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- routes/952/car.jpg +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('fb8dc247-a9d7-421b-bee7-322dee5e7c60', 'route', '952', 'photo', '/buckets/transit/route/952/car.jpg', '/route/952/car.jpg', 0, '{"mime":"image/jpeg","size_bytes":130413,"sha256":"8dd23770f4e67daaaff655c5c0b241b3320b841e13f2fa48ed15b69291239508","width":1046,"height":804}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- routes/952/car.webp +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('f6ed9fcd-2366-44ff-8abb-581229bd4553', 'route', '952', 'photo', '/buckets/transit/route/952/car.webp', '/route/952/car.webp', 0, '{"mime":"image/webp","size_bytes":532788,"sha256":"4b70fb180bbeb078ba2235b550a3e717509a885aa8a7681ce1b79f5223726354","width":1046,"height":804}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- routes/952/hero.webp +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('84fbd120-e848-496c-9d96-d6f88bfc5d47', 'route', '952', 'hero', '/buckets/transit/route/952/hero.webp', '/route/952/hero.webp', 1, '{"mime":"image/webp","size_bytes":532788,"sha256":"4b70fb180bbeb078ba2235b550a3e717509a885aa8a7681ce1b79f5223726354","width":1046,"height":804}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- stops/36020.jpg +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('6aae67a3-d13e-4e1f-b9a6-93e290dd242f', 'station', '36020', 'photo', '/buckets/transit/station/36020/36020.jpg', '/station/36020/36020.jpg', 0, '{"mime":"image/jpeg","size_bytes":192818,"sha256":"4487760ddc46831cc88019d718f32267eaa28be25d8151e28418a2da4c3ba183","width":852,"height":741}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- stops/39321.jpg +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('f87fda06-5a77-4a32-96d6-1a17d05bf5f5', 'station', '39321', 'photo', '/buckets/transit/station/39321/39321.jpg', '/station/39321/39321.jpg', 0, '{"mime":"image/jpeg","size_bytes":259460,"sha256":"fa0d05e218625df67590f657aa8fd23d5bcb46e122ea224084ebfbc63bdb6ecf","width":1090,"height":868}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- stops/42110.jpg +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('94b30a45-d783-4c01-8c12-7fdf32b8c877', 'station', '42110', 'photo', '/buckets/transit/station/42110/42110.jpg', '/station/42110/42110.jpg', 0, '{"mime":"image/jpeg","size_bytes":256778,"sha256":"2a455fd50a250903de34208c8ed1027a3136c05cf1957e3ca68842f44954dfe1","width":962,"height":797}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- stops/42250.jpg +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('18476e9e-e836-4ebb-a49a-835f7b503503', 'station', '42250', 'photo', '/buckets/transit/station/42250/42250.jpg', '/station/42250/42250.jpg', 0, '{"mime":"image/jpeg","size_bytes":230708,"sha256":"a4bdb8dc08b70229c28b87f79dcb3a656c96ea3aad7271ea81677e56d397facc","width":1001,"height":853}'::jsonb) ON CONFLICT (fid) DO NOTHING; +-- stops/54950.jpg +INSERT INTO images (id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES ('8c2fe77a-c08a-4b17-9502-ab0e81678088', 'station', '54950', 'photo', '/buckets/transit/station/54950/54950.jpg', '/station/54950/54950.jpg', 0, '{"mime":"image/jpeg","size_bytes":163400,"sha256":"b4638961997dba7622ea97f61969c5eb13697b16dd18a5ca7eadfcbd0cd0444b","width":1092,"height":558}'::jsonb) ON CONFLICT (fid) DO NOTHING; + +-- done: ok=45, skip=0, err=0 diff --git a/at-transit/web-design/src/app/routes/page.tsx b/at-transit/web-design/src/app/routes/page.tsx new file mode 100644 index 0000000..d6534c0 --- /dev/null +++ b/at-transit/web-design/src/app/routes/page.tsx @@ -0,0 +1,186 @@ +"use client" + +import React, { useMemo, useState } from 'react' +import './styles.css' + +type RouteItem = { + id: string + number: string + title: string + category: 'local' | 'bkk' | 'interprov' | 'in-province' + vehicle: string + tags: string[] + stopsCount?: number + image?: string + nextDepartures?: string[] +} + +const MOCK_ROUTES: RouteItem[] = [ + { id: '101', number: '101', title: 'ตลาดอ่างทอง → ศาลากลางจังหวัด', category: 'local', vehicle: 'songthaew', tags: ['ภายใน อบต / เทศบาล', 'shuttle'], stopsCount: 12, nextDepartures: ['08:00', '09:30'] }, + { id: '902', number: '902', title: 'อ่างทอง → กรุงเทพฯ (ปิ่นเกล้า)', category: 'bkk', vehicle: 'coach', tags: ['เข้ากรุงเทพฯ', 'coach'], stopsCount: 18, nextDepartures: ['06:30', '12:00'] }, + { id: '464', number: '464', title: 'สุพรรณบุรี → สระบุรี', category: 'interprov', vehicle: 'coach', tags: ['ระหว่างจังหวัด', 'coach'], stopsCount: 25, nextDepartures: ['07:00', '13:00'] }, + { id: '15', number: '15', title: 'สถานีอ่างทอง → ตลาดโพธิ์ทอง', category: 'in-province', vehicle: 'van', tags: ['ภายในจังหวัด', 'van'], stopsCount: 9, nextDepartures: ['07:30', '10:10'] }, +] + +const CATEGORY_META = [ + { id: 'all', label: 'ทุกรายการ' }, + { id: 'local', label: 'Local Loop' }, + { id: 'bkk', label: 'Bangkok Connect' }, + { id: 'interprov', label: 'Interprovincial' }, + { id: 'in-province', label: 'In-Province' }, +] + +export default function RoutesPage() { + const [query, setQuery] = useState('') + const [category, setCategory] = useState<'all' | RouteItem['category']>('all') + const [openRoute, setOpenRoute] = useState(null) + + const groups = useMemo(() => { + const visible = MOCK_ROUTES.filter(r => { + const q = query.trim().toLowerCase() + const matchQuery = !q || r.number.includes(q) || r.title.toLowerCase().includes(q) + const matchCategory = category === 'all' || r.category === category + return matchQuery && matchCategory + }) + // group by category order + const order: RouteItem['category'][] = ['local', 'bkk', 'interprov', 'in-province'] + return order.map(cat => ({ + category: cat, + label: CATEGORY_META.find(m => m.id === cat)?.label ?? cat, + routes: visible.filter(r => r.category === cat), + })) + }, [query, category]) + + return ( +
+
+
+
+ AT +
+
AT Transit
+
เส้นทางเดินรถ — Routes
+
+
+
+ +
+
+
+ +
+
+
+

เส้นทางเดินรถ

+

ค้นหา เลือกหมวด แล้วคลิกสายเพื่อดูรายละเอียด (drawer)

+
+
+ +
+
+ 🔍 + setQuery(e.target.value)} placeholder="ค้นหาเลขสาย หรือชื่อเส้นทาง…" aria-label="ค้นหาเส้นทาง" /> +
+ +
+ {CATEGORY_META.map(m => ( + + ))} +
+
+ +
+
+ {groups.map(g => ( +
+
+

{g.label}

+
{g.routes.length}
+
+
+ {g.routes.length === 0 &&
ไม่มีเส้นทางในหมวดนี้
} + {g.routes.map(r => ( +
setOpenRoute(r)} onKeyDown={(e)=>{ if(e.key === 'Enter') setOpenRoute(r)}}> +
{r.number}
+
+
{r.title}
+
{r.vehicle} · {r.stopsCount} ป้าย
+
+ {r.tags.slice(0,2).map(t => {t})} +
+
+
›
+
+ ))} +
+
+ ))} +
+ + +
+ +
+ +
© 2026 AT Transit — static preview
+ + {openRoute && ( +
+
+
+
+
{openRoute.number}
+

{openRoute.title}

+
{openRoute.vehicle} · {openRoute.stopsCount} ป้าย
+
+
+ +
+
+ +
+
+

ตารางเวลา (ตัวอย่าง)

+
+ {openRoute.nextDepartures?.map(t =>
{t}
)} +
+
+ +
+

ป้ายหยุด ({openRoute.stopsCount})

+
    + {Array.from({length: openRoute.stopsCount ?? 0}).map((_,i)=>
  1. ป้ายที่ {i+1}
  2. )} +
+
+ +
+

แชร์ / QR

+
QR และลิงก์แชร์จะแสดงที่นี่ (mockup)
+
+
+ + +
+
+ )} + +
+ ) +} diff --git a/at-transit/web-design/src/app/routes/styles.css b/at-transit/web-design/src/app/routes/styles.css new file mode 100644 index 0000000..e70a12f --- /dev/null +++ b/at-transit/web-design/src/app/routes/styles.css @@ -0,0 +1,78 @@ +:root{ + --bg: linear-gradient(135deg,#0f172a,#1e1b34,#1b2332); + --surface: rgba(255,255,255,0.03); + --muted: #94a3b8; + --accent: linear-gradient(135deg,#7c83ff,#b06bff,#ff6b9d); +} + +*{box-sizing:border-box} +body,html,#root{height:100%} +body{font-family: 'Prompt', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans Thai', sans-serif;background:var(--bg);color:#f8fafc;margin:0} + +.rg-topbar{backdrop-filter: blur(6px);border-bottom:1px solid rgba(255,255,255,0.04)} +.rg-topbar-inner{max-width:1100px;margin:0 auto;display:flex;align-items:center;justify-content:space-between;padding:12px 16px} +.rg-brand{display:flex;gap:12px;align-items:center} +.rg-brand img{width:44px;height:44px;border-radius:8px} +.rg-brand-title{font-weight:700} +.rg-brand-sub{font-size:13px;color:var(--muted)} +.rg-cta{background:linear-gradient(90deg,#7c83ff,#b06bff);color:white;border:0;padding:8px 12px;border-radius:10px} + +.rg-container{max-width:1100px;margin:18px auto;padding:0 16px} +.rg-hero{padding:24px 0} +.rg-hero-inner h1{margin:0;font-size:28px} +.muted{color:var(--muted)} + +.rg-toolbar{display:flex;gap:12px;align-items:center} +.search{flex:1;display:flex;align-items:center;background:var(--surface);padding:10px;border-radius:12px} +.search input{flex:1;background:transparent;border:0;color:inherit;padding-left:8px;outline:none} +.search .icon{opacity:0.9} + +.categories{display:flex;gap:8px} +.cat{background:transparent;border:1px solid rgba(255,255,255,0.04);padding:8px 10px;border-radius:999px;color:var(--muted)} +.cat--active{background:linear-gradient(90deg,#1f2540,rgba(255,255,255,0.02));border-color:transparent;color:#fff} + +.rg-grid{display:grid;grid-template-columns:1fr 320px;gap:18px;margin-top:18px} +.rg-list{min-width:0} +.category{margin-bottom:24px} +.category-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px} +.category-head h2{margin:0;font-size:16px} +.count{opacity:0.8} +.cards{display:flex;flex-direction:column;gap:8px} +.empty{padding:12px;border-radius:10px;background:rgba(255,255,255,0.02);color:var(--muted)} + +.card{display:flex;align-items:center;gap:12px;padding:12px;border-radius:12px;background:linear-gradient(180deg,rgba(255,255,255,0.02),rgba(255,255,255,0.01));border:1px solid rgba(255,255,255,0.03);cursor:pointer} +.card:focus{outline:2px solid rgba(124,131,255,0.14)} +.badge{width:56px;height:56px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-weight:700} +.badge--local{background:linear-gradient(90deg,#7c83ff,#b06bff);color:#000} +.badge--bkk{background:linear-gradient(90deg,#44bff1,#7c83ff);color:#000} +.badge--interprov{background:linear-gradient(90deg,#ff8a65,#ff6b9d);color:#000} +.badge--in-province{background:linear-gradient(90deg,#a78bfa,#7c83ff);color:#000} +.card-body{flex:1} +.title{font-weight:600} +.meta{font-size:13px;color:var(--muted);margin-top:4px} +.chips{margin-top:8px;display:flex;gap:6px} +.chip{background:rgba(255,255,255,0.02);padding:4px 8px;border-radius:8px;font-size:12px} +.chev{color:var(--muted);font-size:20px} + +.rg-summary{position:sticky;top:18px} +.summary-card{background:linear-gradient(135deg,rgba(255,255,255,0.02),rgba(255,255,255,0.01));padding:12px;border-radius:12px;border:1px solid rgba(255,255,255,0.03)} +.summary-list{padding-left:18px} +.small{font-size:13px} + +.rg-footer{text-align:center;padding:18px;color:var(--muted)} + +/* Drawer */ +.drawer{position:fixed;right:0;top:0;bottom:0;width:420px;background:linear-gradient(180deg,#0f172a,#131827);box-shadow:-24px 0 40px rgba(0,0,0,0.6);border-left:1px solid rgba(255,255,255,0.04);display:flex;flex-direction:column} +.drawer-inner{display:flex;flex-direction:column;height:100%} +.drawer-head{display:flex;justify-content:space-between;align-items:center;padding:18px;border-bottom:1px solid rgba(255,255,255,0.02)} +.drawer-body{padding:16px;overflow:auto;flex:1} +.drawer-foot{padding:12px;border-top:1px solid rgba(255,255,255,0.02);display:flex;gap:8px} +.btn{padding:8px 12px;border-radius:8px;border:1px solid rgba(255,255,255,0.06);background:transparent;color:inherit} +.btn.primary{background:linear-gradient(90deg,#7c83ff,#b06bff);color:#000;border:0} +.btn.ghost{background:transparent;border:0;color:var(--muted);font-size:18px} + +@media(max-width:900px){ + .rg-grid{grid-template-columns:1fr} + .rg-summary{display:none} + .drawer{width:100%;} +} diff --git a/at-transit/web-design/upload_seed_images.py b/at-transit/web-design/upload_seed_images.py new file mode 100644 index 0000000..b0a8247 --- /dev/null +++ b/at-transit/web-design/upload_seed_images.py @@ -0,0 +1,218 @@ +#!/usr/bin/env python3 +""" +Upload images from script/images/ to SeaweedFS filer and generate +seed_images.sql with INSERT statements for the images table. + +Usage: + python script/upload_seed_images.py --filer-url http://VPS_IP:3103 + python script/upload_seed_images.py --filer-url http://VPS_IP:3103 --dry-run + +Output: + script/seed_images.sql (always written) +""" + +import argparse +import hashlib +import mimetypes +import os +import sys +import uuid +from pathlib import Path + +try: + import requests +except ImportError: + print("pip install requests", file=sys.stderr) + sys.exit(1) + +SCRIPT_DIR = Path(__file__).parent +IMAGES_DIR = SCRIPT_DIR / "images" +OUTPUT_SQL = SCRIPT_DIR / "seed_images.sql" + +# --------------------------------------------------------------------------- # +# folder → (entity_type, kind, display_order_hint) +# --------------------------------------------------------------------------- # +FOLDER_MAP = { + "stops": ("station", "photo", 0), + "qrcode": ("route", "map", 9), + "partners": ("sponsor", "logo", 0), + "landmarks": ("misc", "photo", 0), + "network": ("misc", "map", 0), + "extras": ("misc", "photo", 0), + "icons": ("misc", "icon", 0), +} + +def classify(rel: Path): + """Return (entity_type, entity_id, kind, display_order) or None to skip.""" + parts = rel.parts # e.g. ('routes', '902', 'car.jpeg') + folder = parts[0] + + if folder == "routes" and len(parts) == 3: + route_id = parts[1] + stem = Path(parts[2]).stem.lower() + kind = "hero" if stem == "hero" else "photo" + order = 1 if kind == "hero" else 0 + return "route", route_id, kind, order + + if folder in FOLDER_MAP and len(parts) == 2: + entity_type, kind, order = FOLDER_MAP[folder] + entity_id = Path(parts[1]).stem + return entity_type, entity_id, kind, order + + return None + + +def get_mime(path: Path) -> str: + # mimetypes doesn't know .webp by default on some platforms + ext = path.suffix.lower() + if ext == ".webp": + return "image/webp" + mime, _ = mimetypes.guess_type(str(path)) + return mime or "application/octet-stream" + + +def sha256_of(path: Path) -> str: + h = hashlib.sha256() + with open(path, "rb") as f: + for chunk in iter(lambda: f.read(65536), b""): + h.update(chunk) + return h.hexdigest() + + +def get_dimensions(path: Path): + try: + from PIL import Image + with Image.open(path) as img: + return img.size # (width, height) + except Exception: + return None, None + + +def upload(filer_url: str, entity_type: str, entity_id: str, + filename: str, mime: str, data: bytes) -> dict: + """ + PUT raw bytes to filer — mirrors seaweed.rs upload logic. + Returns {"fid": ..., "url_path": ...} + """ + key = (f"/buckets/transit/{sanitize(entity_type)}" + f"/{sanitize(entity_id)}/{sanitize_name(filename)}") + url = filer_url.rstrip("/") + key + resp = requests.put(url, data=data, + headers={"Content-Type": mime}, timeout=30) + resp.raise_for_status() + body = {} + try: + body = resp.json() + except Exception: + pass + fid = body.get("fid") or key # fallback: path itself (matches Rust code) + url_path = key.removeprefix("/buckets/transit") # stored in DB without prefix + return {"fid": fid, "url_path": url_path} + + +def sanitize(s: str) -> str: + return "".join(c if c.isalnum() or c in "-_" else "_" for c in s) + + +def sanitize_name(s: str) -> str: + return "".join(c if c.isalnum() or c in "-_." else "_" for c in s) + + +def q(s: str) -> str: + """SQL single-quote escape.""" + return s.replace("'", "''") + + +# --------------------------------------------------------------------------- # + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("--filer-url", default="http://localhost:3103", + help="SeaweedFS filer base URL (default: http://localhost:3103)") + parser.add_argument("--dry-run", action="store_true", + help="Skip actual upload; use path as fid placeholder") + args = parser.parse_args() + + filer_url = args.filer_url.rstrip("/") + dry_run = args.dry_run + + sql_lines = [ + "-- Auto-generated by upload_seed_images.py", + "-- Run this AFTER 0003_seed.sql is applied.", + "-- ON CONFLICT (fid) DO NOTHING → safe to re-run.", + "", + ] + + image_files = sorted(p for p in IMAGES_DIR.rglob("*") if p.is_file()) + ok = skip = 0 + errors = [] + + for img_path in image_files: + rel = img_path.relative_to(IMAGES_DIR) + meta = classify(rel) + if meta is None: + print(f" SKIP {rel}") + skip += 1 + continue + + entity_type, entity_id, kind, display_order = meta + mime = get_mime(img_path) + file_size = img_path.stat().st_size + sha = sha256_of(img_path) + width, height = get_dimensions(img_path) + img_id = str(uuid.uuid4()) + + if dry_run: + safe_key = (f"/buckets/transit/{sanitize(entity_type)}" + f"/{sanitize(entity_id)}/{sanitize_name(img_path.name)}") + fid = safe_key # use path as pseudo-fid + url_path = safe_key.removeprefix("/buckets/transit") + print(f" DRY {rel}") + else: + try: + data = img_path.read_bytes() + result = upload(filer_url, entity_type, entity_id, + img_path.name, mime, data) + fid = result["fid"] + url_path = result["url_path"] + print(f" OK {rel} fid={fid}") + ok += 1 + except Exception as exc: + print(f" ERR {rel} {exc}", file=sys.stderr) + errors.append((str(rel), str(exc))) + continue + + # Build meta JSONB inline + meta_kv = [f'"mime":"{q(mime)}"', f'"size_bytes":{file_size}', + f'"sha256":"{sha}"'] + if width is not None: + meta_kv.append(f'"width":{width}') + meta_kv.append(f'"height":{height}') + meta_json = "{" + ",".join(meta_kv) + "}" + + sql_lines.append(f"-- {rel}") + sql_lines.append( + f"INSERT INTO images " + f"(id, entity_type, entity_id, kind, fid, url_path, display_order, meta) VALUES (" + f"'{img_id}', '{entity_type}', '{q(entity_id)}', '{kind}', " + f"'{q(fid)}', '{q(url_path)}', {display_order}, " + f"'{meta_json}'::jsonb" + f") ON CONFLICT (fid) DO NOTHING;" + ) + + sql_lines += [ + "", + f"-- done: ok={ok if not dry_run else 'DRY'}, skip={skip}, err={len(errors)}", + ] + + OUTPUT_SQL.write_text("\n".join(sql_lines) + "\n", encoding="utf-8") + print(f"\nSQL written → {OUTPUT_SQL.relative_to(SCRIPT_DIR.parent)}") + if errors: + print(f"Errors ({len(errors)}):") + for r, e in errors: + print(f" {r}: {e}") + sys.exit(1) + + +if __name__ == "__main__": + main()