Add static Kaohsiung parking site (HTML/CSS/JS)#4
Conversation
There was a problem hiding this comment.
💡 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".
| <div class="container footer-content"> | ||
| <span>資料檔下載:</span> | ||
| <a href="/kaohsiung_parking_lots_2025-12-25_curated.csv" download>CSV</a> | ||
| <a href="/kaohsiung_parking_lots_2025-12-25_curated.json" download>JSON</a> |
There was a problem hiding this comment.
Point JSON download to an existing file
The footer links to kaohsiung_parking_lots_2025-12-25_curated.json, but a repo search (rg -n "curated.json") only finds references and no actual file in the tree (only the schema JSON is present). That means this download link will 404 for users, and the fallback fetch in assets/app.js will also fail if the primary fetch fails. Either add the missing JSON file or update the link/fallback to an existing JSON asset.
Useful? React with 👍 / 👎.
| <meta charset="utf-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
| <title>高雄市停車場資訊</title> | ||
| <link rel="stylesheet" href="/assets/styles.css" /> |
There was a problem hiding this comment.
Avoid root-relative asset/data URLs
The stylesheet is referenced with a root-relative URL (/assets/styles.css). When this is deployed as a GitHub Pages project site (e.g., https://user.github.io/repo/), root-relative URLs resolve to the domain root and return 404, so CSS/JS/data fail to load. Use relative paths (or a <base> tag) so assets resolve under the project subpath.
Useful? React with 👍 / 👎.
Motivation
thumbnail(place photo / street view) information while keeping a curated JSON fallback for robustness.YOUR_API_KEYplaceholders in constructed photo URLs so the site can be deployed without an API key.Description
index.html(UI and controls),assets/styles.css(responsive card-based styling), andassets/app.js(client logic) implementing modular functionsloadData(),normalizeItem(),getThumbnailUrl(),applyFilters(), andrenderList().kaohsiung_parking_lots_2025-12-25_schema_placephoto_fallback.jsonand falls back tokaohsiung_parking_lots_2025-12-25_curated.json, withnormalizeItem()unifying both formats into a single internal shape.pricing.weekday), grouping by administrative district, and card rendering that shows name, address (copy button), vehicle types, pricing, Google rating text, thumbnail resolution, and an "Open in Google Maps" link.thumbnail.place_photo.url, or construct a URL fromphoto_referenceviatemplates.classic_photoreference_url_templateor fromphoto_resource_nameviatemplates.new_photo_resource_url_template(both left withYOUR_API_KEY), otherwise usethumbnail.street_view.url, and finally show a placeholder when no image is available.Testing
python -m http.serverto verify static assets are reachable and the page loads (server started successfully).Codex Task