diff --git a/README.md b/README.md index 9b339a6..f895769 100644 --- a/README.md +++ b/README.md @@ -41,9 +41,13 @@ trips** into one view for the Fireside Communications / Tracksolid fleet. (vehicle / cost centre / city) plus the **first trip** and **last trip** — each with its **reverse-geocoded location and timestamp** — alongside the KPI totals (trips, km, driving/idle hours, vehicles, drivers, date range). -- **Fixed chrome (no floating panels).** Filters are a **fixed dock on the right**; - in trips view the trips are **cards in a fixed bottom bar** (horizontally - scrollable) that mirrors the top bar. Click a card to fit + animate that route. +- **Fixed chrome (no floating panels).** Filters are a **slim, content-height dock + on the right**; in trips view the trips are **cards in a fixed bottom bar** + (horizontally scrollable) that mirrors the top bar. Click a card to fit + + animate that route. +- **Plate picker is a searchable combobox** — type to filter, click to add a + removable chip (multi-select), instead of a tall scrolling list. Cost centre / + city / time stay single-line; date pickers appear only for a custom range. Live: diff --git a/index.html b/index.html index c0467a6..9fd2f7e 100644 --- a/index.html +++ b/index.html @@ -128,8 +128,8 @@ grid-row: 3; min-height: 0; display: grid; /* minmax(0,…) so the horizontal trip-card scroller can't blow out the track */ - grid-template-columns: minmax(0, 1fr) 270px; /* map | fixed filter dock */ - grid-template-rows: minmax(0, 1fr) auto; /* map | fixed trips bar */ + grid-template-columns: minmax(0, 1fr) 224px; /* map | slim filter dock */ + grid-template-rows: minmax(0, 1fr) auto; /* map | fixed trips bar */ } #map { grid-column: 1; grid-row: 1; position: relative; min-height: 0; } .placeholder { @@ -138,32 +138,58 @@ pointer-events: none; z-index: 1; } - /* Fixed right filter dock (full body height) */ + /* Slim, content-height filter card — docked in the right column (top-aligned, + so no dead space below the button), part of the layout (won't drift). */ .filters { - grid-column: 2; grid-row: 1 / span 2; - background: var(--panel); border-left: 1px solid var(--border); - padding: 16px 16px 18px; overflow-y: auto; + grid-column: 2; grid-row: 1 / span 2; align-self: start; + margin: 12px 12px 0 0; max-height: calc(100% - 24px); overflow-y: auto; + background: var(--panel); border: 1px solid var(--border); border-radius: 10px; + padding: 13px 13px 14px; } .filters h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; - color: var(--muted); margin: 0 0 14px; font-weight: 600; + color: var(--muted); margin: 0 0 12px; font-weight: 600; } - .field { display: flex; flex-direction: column; margin-bottom: 13px; } + .field { display: flex; flex-direction: column; margin-bottom: 11px; } .field label { - font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; + font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 4px; } select, input[type=date] { - padding: 8px 10px; background: var(--bg); color: var(--text); + padding: 7px 9px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 6px; font: 13px system-ui; width: 100%; } select:focus, input:focus { outline: 2px solid var(--accent); outline-offset: -1px; } - select[multiple] { min-height: 120px; max-height: 200px; padding: 5px; } - select[multiple] option { padding: 4px 6px; border-radius: 3px; } - select[multiple] option:checked { background: var(--accent); color: #1a1009; } .hint { font-size: 9.5px; color: var(--muted); margin-top: 3px; line-height: 1.3; } .custom { display: none; } - .custom.show { display: block; } + .custom.show { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } + .custom .field { margin-bottom: 0; } + .custom input[type=date] { padding: 6px 6px; font-size: 11.5px; } + + /* Searchable plate combobox + chips (replaces the tall multi-select) */ + .plate-box { position: relative; } + .plate-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 5px; } + .plate-chips:empty { display: none; } + .plate-chip { + display: inline-flex; align-items: center; gap: 5px; + background: var(--accent); color: #1a1009; font: 600 11px system-ui; + padding: 2px 4px 2px 8px; border-radius: 999px; + } + .plate-chip button { background: none; border: 0; color: #1a1009; cursor: pointer; font-size: 13px; line-height: 1; padding: 0 2px; opacity: .75; } + .plate-chip button:hover { opacity: 1; } + .plate-search { width: 100%; padding: 7px 9px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 6px; font: 13px system-ui; } + .plate-search:focus { outline: 2px solid var(--accent); outline-offset: -1px; } + .plate-results { + display: none; position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin-top: 3px; + max-height: 200px; overflow-y: auto; background: var(--panel-2); + border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 22px rgba(0,0,0,.5); + } + .plate-results.show { display: block; } + .plate-opt { padding: 7px 10px; font-size: 12.5px; cursor: pointer; color: var(--text); } + .plate-opt:hover, .plate-opt.hi { background: rgba(232,149,74,.18); } + .plate-opt.sel { color: var(--accent); } + .plate-opt .pd { color: var(--muted); font-size: 11px; } + .plate-none { padding: 8px 10px; color: var(--muted); font-size: 11.5px; } .btn { width: 100%; padding: 10px; margin-top: 6px; background: var(--accent); color: #1a1009; border: 0; border-radius: 6px; font: 600 13px system-ui; cursor: pointer; @@ -367,8 +393,14 @@