Skip to content

Add static Kaohsiung parking site with filtering, district grouping, and thumbnail rules#3

Merged
ethan-CCY merged 1 commit intomainfrom
codex/create-static-web-page-for-kaohsiung-parking-194rg4
Dec 30, 2025
Merged

Add static Kaohsiung parking site with filtering, district grouping, and thumbnail rules#3
ethan-CCY merged 1 commit intomainfrom
codex/create-static-web-page-for-kaohsiung-parking-194rg4

Conversation

@ethan-CCY
Copy link
Owner

Motivation

  • Provide a lightweight, framework-free static site to browse 高雄市停車場資訊 with search and filters.
  • Use the provided schema JSON as primary data source and fall back to the curated JSON to ensure robust loading.
  • Show card-style records grouped by行政區 and include Google Maps links and thumbnail selection rules without requiring API keys.
  • Keep the code modular and readable with functions suitable for direct use on GitHub Pages.

Description

  • Added index.html, assets/styles.css, and assets/app.js implementing the UI and logic per requirements.
  • Implemented modular functions loadData(), normalizeItem(), getThumbnailUrl(), applyFilters(), and renderList() and normalization to handle both schema and curated JSON formats.
  • Data loading attempts kaohsiung_parking_lots_2025-12-25_schema_placephoto_fallback.json first and falls back to kaohsiung_parking_lots_2025-12-25_curated.json, and the footer includes download links for CSV/JSON.
  • UI features: search by name/address, vehicle-type dropdown (全部/汽車/機車/汽車+機車), quick filters for 平假日差異 and 含月租/上限, sorting by name or crude 平日費率, district grouping, copy-address button, and map button using google.maps_url or a generated search URL; thumbnail selection follows the specified rules (use thumbnail.place_photo.url, else use photo_reference or photo_resource_name templates leaving YOUR_API_KEY, else thumbnail.street_view.url, else a gray “No Image” placeholder).

Testing

  • Started a local server with python -m http.server and loaded http://127.0.0.1:8000/index.html via Playwright, which successfully rendered the page and produced a screenshot artifact.
  • Verified that the page loads the primary schema JSON and that filters, grouping, copy-address and Google Maps links function in the browser screenshot run.
  • No automated unit tests were added for this static site change.
  • Manual automated smoke run (HTTP server + Playwright screenshot) succeeded.

Codex Task

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1 to +3
const DATA_SOURCES = [
"kaohsiung_parking_lots_2025-12-25_schema_placephoto_fallback.json",
"kaohsiung_parking_lots_2025-12-25_curated.json",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Point fallback loader to a file that exists

The fallback source kaohsiung_parking_lots_2025-12-25_curated.json is referenced here, but this repo only contains the CSV and the schema JSON (there is no curated JSON file at all). That means any time the primary JSON fails to load (e.g., renamed/moved file or a transient fetch error), the fallback will deterministically 404 and the page will show “資料載入失敗” instead of recovering. Consider either adding the curated JSON file or pointing the fallback at a file that actually exists.

Useful? React with 👍 / 👎.

@ethan-CCY ethan-CCY merged commit de9689f into main Dec 30, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant