Files
bus_sg_app/public/index.html
T

89 lines
2.8 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Bus SG Control Deck</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=Chakra+Petch:wght@600;700&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="/styles.css" />
</head>
<body>
<div class="bg-grid"></div>
<main class="app-shell">
<header class="hero">
<p class="kicker">Singapore Transit</p>
<h1>Bus Control Deck</h1>
<p class="subtitle">
Live explorer for the bus gateway API at <span id="gateway-origin">localhost:8067</span>.
</p>
</header>
<section class="panel query-panel">
<div class="panel-header">
<h2>Endpoint Explorer</h2>
<button id="send-request" class="btn-accent">Run Request</button>
</div>
<div class="grid-two">
<label>
Endpoint
<select id="endpoint"></select>
</label>
<label>
Request Method
<input id="method" value="GET" readonly />
</label>
</div>
<div class="params-head">
<h3>Query Params</h3>
<button id="add-param" class="btn-ghost">Add Param</button>
</div>
<div id="params" class="params-list"></div>
</section>
<section class="panel quick-panel">
<div class="panel-header">
<h2>Quick Arrival Check</h2>
<button id="run-arrival" class="btn-accent">Get Arrivals</button>
</div>
<div class="grid-two">
<label>
Bus Stop Code
<input id="bus-stop-code" placeholder="e.g. 83139" />
</label>
<label>
Service No (optional)
<input id="service-no" placeholder="e.g. 14" />
</label>
</div>
<p class="hint">Uses /api/v1/bus-arrival with DataMall-style query parameters.</p>
</section>
<section class="panel">
<div class="panel-header">
<h2>Response</h2>
<span id="status-pill" class="status-pill">Idle</span>
</div>
<div id="arrival-board" class="arrival-board hidden"></div>
<pre id="response" class="response">No request yet.</pre>
</section>
</main>
<template id="param-template">
<div class="param-row">
<input class="param-key" placeholder="Key" />
<input class="param-value" placeholder="Value" />
<button class="remove-param" type="button">Remove</button>
</div>
</template>
<script src="/app.js"></script>
</body>
</html>