6 Commits

Author SHA1 Message Date
08f3d30e44 Update favicon 2026-02-07 23:11:00 +00:00
39511dd428 Improve 'branding' and mobile layout 2026-02-07 20:50:52 +00:00
cfcf651e41 Add favicon 2026-02-07 20:50:39 +00:00
cfa1d44dbc Run prettier 2026-02-07 00:38:56 +00:00
ca5e78e2b1 Add OwlBoard styling 2026-02-07 00:31:37 +00:00
6c10cb628e Fix linter warnings 2026-02-06 23:54:50 +00:00
11 changed files with 1707 additions and 1651 deletions

View File

@@ -6,4 +6,4 @@ bun.lock
bun.lockb bun.lockb
# Miscellaneous # Miscellaneous
/static/ #/static/

View File

@@ -23,11 +23,11 @@ fs.readdirSync(inputDir).forEach((file) => {
routeStart: content.routeStart || null, routeStart: content.routeStart || null,
routeEnd: content.routeEnd || null, routeEnd: content.routeEnd || null,
created: content.created || null, created: content.created || null,
checked: content.checked || null, checked: content.checked || null
}); });
} }
}); });
fs.writeFileSync(indexFile, JSON.stringify(mapList)); fs.writeFileSync(indexFile, JSON.stringify(mapList));
console.log(`Generated ${mapList.length} map files and index.`) console.log(`Generated ${mapList.length} map files and index.`);

View File

@@ -1,20 +1,20 @@
import { type HandleFetch } from "@sveltejs/kit"; import { type HandleFetch } from '@sveltejs/kit';
export const handleFetch: HandleFetch = async ({ request, fetch }) => { export const handleFetch: HandleFetch = async ({ request, fetch }) => {
if (request.url.startsWith('https://maps.owlboard.info')) { if (request.url.startsWith('https://maps.owlboard.info')) {
const newUrl = request.url.replace('https://maps.owlboard.info', 'http://localhost:3000'); const newUrl = request.url.replace('https://maps.owlboard.info', 'http://localhost:3000');
const headers = new Headers(request.headers); const headers = new Headers(request.headers);
headers.set('host', 'maps.owlboard.info'); headers.set('host', 'maps.owlboard.info');
request = new Request(newUrl, { request = new Request(newUrl, {
method: request.method, method: request.method,
headers: headers, headers: headers,
body: request.body, body: request.body,
// @ts-ignore - 'duplex' is needed for node fetch with bodies // @ts-expect-error - 'duplex' is needed for node fetch with bodies
duplex: 'half' duplex: 'half'
}); });
} }
return fetch(request); return fetch(request);
} };

View File

@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="107" height="128" viewBox="0 0 107 128"><title>svelte-logo</title><path d="M94.157 22.819c-10.4-14.885-30.94-19.297-45.792-9.835L22.282 29.608A29.92 29.92 0 0 0 8.764 49.65a31.5 31.5 0 0 0 3.108 20.231 30 30 0 0 0-4.477 11.183 31.9 31.9 0 0 0 5.448 24.116c10.402 14.887 30.942 19.297 45.791 9.835l26.083-16.624A29.92 29.92 0 0 0 98.235 78.35a31.53 31.53 0 0 0-3.105-20.232 30 30 0 0 0 4.474-11.182 31.88 31.88 0 0 0-5.447-24.116" style="fill:#ff3e00"/><path d="M45.817 106.582a20.72 20.72 0 0 1-22.237-8.243 19.17 19.17 0 0 1-3.277-14.503 18 18 0 0 1 .624-2.435l.49-1.498 1.337.981a33.6 33.6 0 0 0 10.203 5.098l.97.294-.09.968a5.85 5.85 0 0 0 1.052 3.878 6.24 6.24 0 0 0 6.695 2.485 5.8 5.8 0 0 0 1.603-.704L69.27 76.28a5.43 5.43 0 0 0 2.45-3.631 5.8 5.8 0 0 0-.987-4.371 6.24 6.24 0 0 0-6.698-2.487 5.7 5.7 0 0 0-1.6.704l-9.953 6.345a19 19 0 0 1-5.296 2.326 20.72 20.72 0 0 1-22.237-8.243 19.17 19.17 0 0 1-3.277-14.502 17.99 17.99 0 0 1 8.13-12.052l26.081-16.623a19 19 0 0 1 5.3-2.329 20.72 20.72 0 0 1 22.237 8.243 19.17 19.17 0 0 1 3.277 14.503 18 18 0 0 1-.624 2.435l-.49 1.498-1.337-.98a33.6 33.6 0 0 0-10.203-5.1l-.97-.294.09-.968a5.86 5.86 0 0 0-1.052-3.878 6.24 6.24 0 0 0-6.696-2.485 5.8 5.8 0 0 0-1.602.704L37.73 51.72a5.42 5.42 0 0 0-2.449 3.63 5.79 5.79 0 0 0 .986 4.372 6.24 6.24 0 0 0 6.698 2.486 5.8 5.8 0 0 0 1.602-.704l9.952-6.342a19 19 0 0 1 5.295-2.328 20.72 20.72 0 0 1 22.237 8.242 19.17 19.17 0 0 1 3.277 14.503 18 18 0 0 1-8.13 12.053l-26.081 16.622a19 19 0 0 1-5.3 2.328" style="fill:#fff"/></svg> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 512 512"><defs><radialGradient xlink:href="#a" id="b" cx="256" cy="256" r="254.04401" fx="256" fy="256" gradientUnits="userSpaceOnUse"/><linearGradient id="a"><stop offset="0" stop-color="#2b343c"/><stop offset="1" stop-color="#404c55"/></linearGradient></defs><circle cx="256" cy="256" r="254.04401" fill="url(#b)"/><path fill="#4fd1d1" d="M256 63.429688c-70.95778.000042-128.48044 57.522702-128.48047 128.480472.00022 14.10748 2.32313 28.1184 6.87695 41.4707l-.01-.0156 7.35742 17.3086c1.62516 3.0994 3.37536 6.13147 5.24805 9.08789.32127.56629.64671 1.13007.97656 1.6914L256 448.57031l108.0293-187.11719c.32985-.56133.65528-1.12511.97656-1.6914 1.8727-2.95642 3.62483-5.98849 5.25-9.08789l7.34766-17.28125v-.0117c4.55383-13.3523 6.87674-27.36322 6.87695-41.4707C384.48042 120.95241 326.95774 63.429742 256 63.429688Zm-77.58594 58.457032c.01-.00084.0211-.00045.0312 0 0 0 17.19849 15.57553 33.64258 24.45117 20.19639 10.90092 31.83331 10.07724 43.91211 24.80469 12.0788-14.72745 23.71572-13.90377 43.91211-24.80469 16.44409-8.87564 33.64258-24.45117 33.64258-24.45117 2.60037-.11599 0 42.34071 0 58.96094 0 42.83269-73.74774 87.10937-77.55469 87.04687-3.80695.0625-77.55469-44.21418-77.55469-87.04687 0-16.55531-2.58111-58.74622-.0312-58.96094z"/><path fill="#fd5" d="m256 247.27121-7.4932-25.90681 7.46586 6 7.52054-6z"/></svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -4,7 +4,15 @@
export let feature: { export let feature: {
position: 'over' | 'under'; position: 'over' | 'under';
category: 'rail' |'stream'| 'foot' | 'aroad' | 'minorRoad' | 'motorway' | 'waterway' | 'pipeline'; category:
| 'rail'
| 'stream'
| 'foot'
| 'aroad'
| 'minorRoad'
| 'motorway'
| 'waterway'
| 'pipeline';
roadName?: string; roadName?: string;
}; };
export let activeElec: ElecType; export let activeElec: ElecType;
@@ -98,11 +106,10 @@
{#if isOver} {#if isOver}
<BaseTrack {activeElec} height={64} /> <BaseTrack {activeElec} height={64} />
<!-- White edge, to provide separation between abutment line and bridge content -->
<rect x="0" y={32 - s.width / 2 - 4} width="64" height={s.width + 8} fill="white" />
<!-- White edge, to provide separation between abutment line and bridge content --> <rect x="6" y={32 - s.width / 2} width="52" height={s.width} fill={s.bg} />
<rect x=0 y={32 - (s.width / 2) - 4} width="64" height="{s.width + 8}" fill="white" />
<rect x="6" y={32 - (s.width / 2)} width="52" height={s.width} fill={s.bg} />
{#if s.type === 'road'} {#if s.type === 'road'}
<line <line
@@ -120,15 +127,17 @@
<line x1={xLeft} y1="36" x2={xRight} y2="36" stroke="#cbd5e1" stroke-width="1.5" /> <line x1={xLeft} y1="36" x2={xRight} y2="36" stroke="#cbd5e1" stroke-width="1.5" />
{/if} {/if}
<g fill="none" stroke={s.stroke} stroke-width="2.5" stroke-linecap="square"> <g fill="none" stroke={s.stroke} stroke-width="2.5" stroke-linecap="square">
<path d={`M 20 ${32 - s.width / 2 - 6} L 20 ${32 - s.width / 2 - 4} L 44 ${32 - s.width / 2 - 4} L 44 ${32 - s.width / 2 - 6}`} /> <path
d={`M 20 ${32 - s.width / 2 - 6} L 20 ${32 - s.width / 2 - 4} L 44 ${32 - s.width / 2 - 4} L 44 ${32 - s.width / 2 - 6}`}
/>
<path d={`M 20 ${32 + s.width / 2 + 6} L 20 ${32 + s.width / 2 + 4} L 44 ${32 + s.width / 2 + 4} L 44 ${32 + s.width / 2 + 6}`} /> <path
</g> d={`M 20 ${32 + s.width / 2 + 6} L 20 ${32 + s.width / 2 + 4} L 44 ${32 + s.width / 2 + 4} L 44 ${32 + s.width / 2 + 6}`}
/>
</g>
{:else} {:else}
<rect x="6" y={32 - s.width / 2} width="52" height={s.width} fill={s.bg} />
<rect x="6" y={32 - (s.width / 2)} width="52" height={s.width} fill={s.bg} />
{#if s.type === 'road'} {#if s.type === 'road'}
<line <line
@@ -148,9 +157,13 @@
<rect x="26" y={yTop} width="12" height="64" fill="white" /> <rect x="26" y={yTop} width="12" height="64" fill="white" />
<g stroke={s.stroke} stroke-width="2.5" fill="none" stroke-linecap="square"> <g stroke={s.stroke} stroke-width="2.5" fill="none" stroke-linecap="square">
<path d={`M 24 ${(32 - (s.width / 2)) - 5} L 25 ${(32 - (s.width / 2)) - 5} L 25 ${(32 - (s.width / 2)) + s.width + 5} L 24 ${(32 - (s.width / 2)) + s.width + 5}`} /> <path
d={`M 24 ${32 - s.width / 2 - 5} L 25 ${32 - s.width / 2 - 5} L 25 ${32 - s.width / 2 + s.width + 5} L 24 ${32 - s.width / 2 + s.width + 5}`}
/>
<path d={`M 40 ${(32 - (s.width / 2)) - 5} L 39 ${(32 - (s.width / 2)) - 5} L 39 ${(32 - (s.width / 2)) + s.width + 5} L 40 ${(32 - (s.width / 2)) + s.width + 5}`} /> <path
d={`M 40 ${32 - s.width / 2 - 5} L 39 ${32 - s.width / 2 - 5} L 39 ${32 - s.width / 2 + s.width + 5} L 40 ${32 - s.width / 2 + s.width + 5}`}
/>
</g> </g>
<BaseTrack {activeElec} height={64} /> <BaseTrack {activeElec} height={64} />

View File

@@ -18,7 +18,7 @@
}; };
const getPath = (side: 'left' | 'right') => { const getPath = (side: 'left' | 'right') => {
const yStart = visualUp ? 64 : 0; const yStart = visualUp ? 64 : 8;
const yEnd = visualUp ? 8 : 56; const yEnd = visualUp ? 8 : 56;
const xEnd = side === 'right' ? 56 : 8; const xEnd = side === 'right' ? 56 : 8;
return `M 32 ${yStart} Q 32 32 ${xEnd} ${yEnd}`; return `M 32 ${yStart} Q 32 32 ${xEnd} ${yEnd}`;
@@ -34,7 +34,7 @@
</script> </script>
<svg viewBox="0 0 64 64" width="64" height="64" class="junction"> <svg viewBox="0 0 64 64" width="64" height="64" class="junction">
{#each paths as d} {#each paths as d (d)}
<path {d} fill="none" stroke={branchColour} stroke-width="5" stroke-linecap="round" /> <path {d} fill="none" stroke={branchColour} stroke-width="5" stroke-linecap="round" />
{/each} {/each}
<BaseTrack {activeElec} height={64} /> <BaseTrack {activeElec} height={64} />

View File

@@ -1,283 +1,330 @@
<script lang="ts"> <script lang="ts">
import type { PageData } from './$types'; import type { PageData } from './$types';
export let data: PageData; import { base } from '$app/paths';
export let data: PageData;
let searchTerm = ''; let searchTerm = '';
const formatDate = (dateVal: string | null) => { $: filteredMaps = data.maps.filter(
if (!dateVal) return '---'; (m) =>
const d = new Date(dateVal); m.routeId.toString().includes(searchTerm) ||
return d.toLocaleDateString('en-GB', { day: '2-digit', month: 'short', year: '2-digit' }); m.routeStart.toLowerCase().includes(searchTerm.toLowerCase()) ||
}; m.routeEnd.toLowerCase().includes(searchTerm.toLowerCase())
);
$: filteredMaps = data.maps.filter(m => const vibrate = (patern: number | number[] = 10) => {
m.routeId.toString().includes(searchTerm) || if (typeof window !== 'undefined' && window.navigator.vibrate) {
m.routeStart.toLowerCase().includes(searchTerm.toLowerCase()) || window.navigator.vibrate(pattern);
m.routeEnd.toLowerCase().includes(searchTerm.toLowerCase()) }
); }
const isVerifiedRecently = (dateVal: string | null) => { const isVerifiedRecently = (dateVal: string | null) => {
if (!dateVal) return 'draft'; if (!dateVal) return 'draft';
const checkedDate = new Date(dateVal).getTime(); const checkedDate = new Date(dateVal).getTime();
const oneYearAgo = Date.now() - (365 * 24 * 60 * 60 * 1000); const oneYearAgo = Date.now() - 365 * 24 * 60 * 60 * 1000;
return checkedDate > oneYearAgo ? 'verified' : 'stale'; return checkedDate > oneYearAgo ? 'verified' : 'stale';
}; };
const formatDate = (dateVal: string | null) => {
if (!dateVal) return 'N/A';
const date = new Date(dateVal);
// Check for invalid dates to avoid "NaN/NaN/NaN"
if (isNaN(date.getTime())) return 'Invalid Date';
const d = date.getDate().toString().padStart(2, '0');
const m = (date.getMonth() + 1).toString().padStart(2, '0');
const y = date.getFullYear().toString().slice(-2);
return `${d}/${m}/${y}`;
};
</script> </script>
<div class="page-wrapper"> <div class="page-wrapper">
<header class="main-header"> <header class="main-header">
<div class="brand-container"> <div class="brand-container">
<img src="https://owlboard.info/images/logo/wide_logo.svg" alt="OwlBoard Logo" class="main-logo" /> <img
<div class="brand-text"> src="https://owlboard.info/images/logo/wide_logo.svg"
<h1>Routes</h1> alt="OwlBoard Logo"
<p class="sub-brand">by OwlBoard</p> class="main-logo"
</div> />
<div class="search-container"> <div class="brand-text">
<input <h1>Routes</h1>
type="text" </div>
bind:value={searchTerm} <div class="search-container">
placeholder="Search index..." <input
class="search-input" type="text"
/> bind:value={searchTerm}
</div> placeholder="Search index..."
</header> class="search-input"
/>
</div>
</div>
</header>
<div class="list-container"> <div class="list-container">
{#each filteredMaps as map} <a href="https://owlboard.info" class="button-link">Go to OwlBoard Live Departures & PIS</a>
<a href="/map/{map.routeId.toString().padStart(4, '0')}" class="card"> {#each filteredMaps as map (map.routeId)}
<div class="card-top"> <a href="{base}/map/{map.routeId.toString().padStart(4, '0')}" class="card" on:click={() => vibrate(10)}>
<span class="route-id">{map.routeId.toString().padStart(4, '0')}</span> <div class="card-top">
<span class="status-badge {isVerifiedRecently(map.checked)}"> <span class="route-id">{map.routeId.toString().padStart(4, '0')}</span>
{#if isVerifiedRecently(map.checked) === 'verified'} <span class="status-badge {isVerifiedRecently(map.checked)}">
Reviewed {#if isVerifiedRecently(map.checked) === 'verified'}
{:else if isVerifiedRecently(map.checked) === 'stale'} Reviewed
Needs review {:else if isVerifiedRecently(map.checked) === 'stale'}
{:else} Needs review
Draft {:else}
{/if} Draft
</span> {/if}
</div> </span>
</div>
<div class="card-body"> <div class="card-body">
<div class="location origin">{map.routeStart}</div> <div class="location origin">{map.routeStart}</div>
<div class="path-arrow"></div> <div class="path-arrow">to</div>
<div class="location destination">{map.routeEnd}</div> <div class="location destination">{map.routeEnd}</div>
</div> </div>
<div class="card-footer"> <div class="card-footer">
<span>Created: {formatDate(map.created)}</span> <span>Created on {formatDate(map.created)}</span>
{#if map.checked} {#if map.checked}
<span>• Checked: {formatDate(map.checked)}</span> <span>• Checked & Updated on {formatDate(map.checked)}</span>
{/if} {/if}
</div> </div>
</a> </a>
{:else} {:else}
<div class="empty-state">No maps found.</div> <div class="empty-state">No maps found.</div>
{/each} {/each}
</div> </div>
</div> </div>
<style> <style>
/* Mobile-First Base Styles */ /* Mobile-First Base Styles */
:global(body) { :global(body) {
margin: 0; margin: 0;
background-color: #f8fafc; background-color: #404c55;
color: #0f172a; background-image: radial-gradient(#2b343c, #404c55);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: #0f172a;
} font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.page-wrapper { .page-wrapper {
padding: 1rem; padding: 1rem;
max-width: 800px; max-width: 800px;
margin: 0 auto; margin: 0 auto;
} }
.main-header { .main-header {
margin-bottom: 1.5rem; margin-bottom: 1.5rem;
} position: fixed;
top: 0;
left: 0;
box-sizing: border-box;
width: 100%;
background: #3c6f79;
color: #ebebeb;
z-index: 100;
}
.brand-container { .brand-container {
display: flex; padding: 15px;
align-items: center; display: flex;
gap: 1rem; width: 100%;
margin-bottom: 1.5rem; align-items: center;
} box-sizing: border-box;
gap: 1rem;
}
.main-logo { .main-logo {
/* Adjust height to fit your logo's aspect ratio */ height: 52px;
height: 48px; width: auto;
width: auto; display: block;
display: block; }
}
.brand-text h1 { .brand-text h1 {
font-size: 1.5rem; font-size: 1.5rem;
font-weight: 900; font-weight: 900;
margin: 0; margin: 0;
line-height: 1; line-height: 1;
letter-spacing: -0.05em; letter-spacing: -0.05em;
font-style: italic; font-style: italic;
} }
.sub-brand { .search-container {
font-size: 0.65rem; margin-left: auto;
font-weight: 800; }
color: #94a3b8;
text-transform: uppercase;
letter-spacing: 0.1em;
margin: 0.2rem 0 0 0;
}
/* Desktop layout adjustment */ .search-input {
@media (min-width: 640px) { width: 100%;
.main-header { margin-left: auto;
display: flex; height: 50px;
justify-content: space-between; padding: 0.8rem 1rem;
align-items: center; text-align: center;
margin-bottom: 3rem; text-transform: uppercase;
} border-radius: 30px;
border: none;
font-size: 1rem;
transition: all 0.3s ease;
box-sizing: border-box; /* Ensures padding doesn't break width */
outline: none;
}
.brand-container { .search-input:hover {
margin-bottom: 0; box-shadow: rgba(0, 0, 0, 0.46);
} }
.main-logo { .list-container {
height: 56px; display: flex;
} flex-direction: column;
} gap: 1rem;
padding: 90px 1rem 1rem 1rem;
isolation: isolate;
z-index: 1;
}
.search-input { @media (max-width: 600px) {
width: 100%; .list-container {
padding: 0.8rem 1rem; padding-top: 90px;
border: 2px solid #e2e8f0; gap: 0.75rem;
border-radius: 12px; padding-left: 0.5rem;
font-size: 1rem; padding-right: 0.5rem;
box-sizing: border-box; /* Ensures padding doesn't break width */ }
outline: none;
}
.search-input:focus { .card {
border-color: #3b82f6; padding: 10px 12px;
} margin: 0;
border-radius: 4px;
}
/* Card Layout (Mobile) */ .location {
.list-container { font-size: 1rem;
display: flex; margin-bottom: 0.1rem;
flex-direction: column; font-weight: 500;
gap: 1rem; }
}
.card { .path-arrow {
display: block; color: #fff;
background: white; font-size: 0.8rem;
padding: 1.25rem; margin: 0.1rem 0;
border-radius: 16px; line-height: 0.75;
text-decoration: none; }
color: inherit;
border: 1px solid #e2e8f0;
box-shadow: 0 1px 3px rgba(0,0,0,0.05);
transition: transform 0.1s ease;
}
.card:active { .card-footer {
transform: scale(0.98); /* Tactile feedback for mobile */ font-size: 0.6rem;
} line-height: 0.5;
padding-bottom: 2px;
}
}
.card-top { .card {
display: flex; display: block;
justify-content: space-between; background: #3c6f79;
align-items: center; padding: 1.25rem;
margin-bottom: 0.75rem; border-radius: 35px;
} text-decoration: none;
color: #4fd1d1;
text-shadow: 2px 1px 10px rgba(0, 0, 0, 0.29);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.482);
transition: transform 0.1s ease;
cursor: pointer;
}
.route-id { .card:hover {
font-family: ui-monospace, SFMono-Regular, Menlo, monospace; transform: scale(1.01);
font-weight: 800; z-index: 5;
color: #3b82f6; }
background: #eff6ff;
padding: 0.2rem 0.5rem;
border-radius: 6px;
}
.card-body { .card:active {
margin-bottom: 1rem; transform: scale(0.99); /* Tactile feedback for mobile */
} }
.location { .card-top {
font-size: 1.125rem; display: flex;
font-weight: 700; justify-content: space-between;
letter-spacing: -0.02em; align-items: center;
} margin-bottom: 0.75rem;
}
.path-arrow { .route-id {
color: #cbd5e1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
font-size: 0.9rem; font-weight: 800;
margin: 0.2rem 0; color: #fff;
} background: #2d2d2d;
text-shadow: none;
padding: 0.2rem 0.5rem;
border-radius: 6px;
}
.card-footer { .card-body {
font-size: 0.7rem; margin-bottom: 1rem;
color: #64748b; }
text-transform: uppercase;
font-weight: 600;
letter-spacing: 0.05em;
border-top: 1px solid #f1f5f9;
padding-top: 0.75rem;
}
/* Update your existing badge styles */ .location {
.status-badge { font-size: 1.125rem;
font-size: 0.65rem; font-weight: 700;
font-weight: 800; letter-spacing: -0.02em;
text-transform: uppercase; }
padding: 0.3rem 0.6rem;
border-radius: 999px;
white-space: nowrap; /* Prevents label snapping on small screens */
}
.verified { .path-arrow {
background: #dcfce7; color: #fff;
color: #166534; font-size: 0.9rem;
} margin: 0.2rem 0;
}
.stale { .card-footer {
background: #fef3c7; /* Amber/Yellow background */ font-size: 0.7rem;
color: #92400e; /* Dark brown/gold text */ color: #e2ebeb;
border: 1px solid #fcd34d; text-transform: uppercase;
} font-weight: 600;
letter-spacing: 0.05em;
padding-top: 0;
}
.draft { .status-badge {
background: #f1f5f9; font-size: 0.65rem;
color: #475569; font-weight: 800;
} text-shadow: none;
text-transform: uppercase;
padding: 0.3rem 0.6rem;
border-radius: 999px;
white-space: nowrap;
}
/* Desktop Adjustments */ .verified {
@media (min-width: 640px) { background: #dcfce7;
.page-wrapper { color: #166534;
padding: 3rem 1.5rem; }
}
.main-header { .stale {
display: flex; background: #fef3c7;
justify-content: space-between; color: #92400e;
align-items: center; border: 1px solid #fcd34d;
} }
.search-input { .draft {
width: 300px; background: #f1f5f9;
} color: #475569;
}
.path-arrow { .button-link {
display: inline-block; text-decoration: none;
margin: 0 0.5rem; border: none;
transform: rotate(-90deg); /* Turn down arrow into right arrow */ background: #3c6f79;
} max-width: 360px;
padding: 8px 25px;
margin: auto;
text-align: center;
border-radius: 25px;
width: auto;
color: #e2ebeb;
transition: 0.3s all ease;
font-weight: 620;
}
.card-body { .button-link:hover {
display: flex; background: #2b2b2b;
align-items: center; }
}
}
</style> </style>

View File

@@ -1,17 +1,17 @@
import type { PageLoad } from "./$types"; import type { PageLoad } from './$types';
export const load: PageLoad = async ({ fetch }) => { export const load: PageLoad = async ({ fetch }) => {
const response = await fetch('map-index.json'); const response = await fetch('map-index.json');
if (!response.ok) { if (!response.ok) {
return { maps: [] }; return { maps: [] };
} }
const maps = await response.json(); const maps = await response.json();
return { return {
maps: maps.sort((a: any, b: any) => { maps: maps.sort((a: any, b: any) => {
return Number(a.routeId) - Number(b.routeId); return Number(a.routeId) - Number(b.routeId);
}) })
}; };
}; };

View File

@@ -2,6 +2,7 @@
import RouteRow from '$lib/components/RouteRow.svelte'; import RouteRow from '$lib/components/RouteRow.svelte';
import RouteEndLink from '$lib/components/mapIcons/RouteEndLink.svelte'; import RouteEndLink from '$lib/components/mapIcons/RouteEndLink.svelte';
import { slide } from 'svelte/transition'; import { slide } from 'svelte/transition';
import { base } from '$app/paths';
// data.route contains: routeStart, routeEnd, routeId, elecStart, elecEnd, routeDetail[] // data.route contains: routeStart, routeEnd, routeId, elecStart, elecEnd, routeDetail[]
export let data; export let data;
@@ -58,31 +59,31 @@
</script> </script>
<div class="map-layout"> <div class="map-layout">
<header class="top-nav"> <header class="top-nav">
<div class="nav-cluster"> <div class="nav-cluster">
<a href="/" class="home-link" title="Back to Index"> <a href="{base}/" class="home-link" title="Back to Index">
<span class="home-icon"></span> <span class="home-icon"></span>
</a> </a>
<div class="route-stack"> <div class="route-stack">
{#if data?.route} {#if data?.route}
<h1 class="primary-station"> <h1 class="primary-station">
{reversed ? data.route.routeEnd : data.route.routeStart} {reversed ? data.route.routeEnd : data.route.routeStart}
</h1> </h1>
<span class="secondary-station"> <span class="secondary-station">
to {reversed ? data.route.routeStart : data.route.routeEnd} to {reversed ? data.route.routeStart : data.route.routeEnd}
</span> </span>
{/if} {/if}
</div> </div>
</div> </div>
<div class="quick-actions"> <div class="quick-actions">
<button class="icon-btn" on:click={() => (reversed = !reversed)}> <button class="icon-btn" on:click={() => (reversed = !reversed)}>
{reversed ? 'UP' : 'DN'} {reversed ? 'UP' : 'DN'}
</button> </button>
<button class="icon-btn" on:click={() => (showFilters = !showFilters)}> Settings </button> <button class="icon-btn" on:click={() => (showFilters = !showFilters)}> Settings </button>
</div> </div>
</header> </header>
{#if showFilters} {#if showFilters}
<div class="backdrop" on:click={() => (showFilters = false)}></div> <div class="backdrop" on:click={() => (showFilters = false)}></div>
@@ -106,7 +107,7 @@
<div class="drawer-content"> <div class="drawer-content">
<div class="filter-flex"> <div class="filter-flex">
{#each Object.keys(visibleTypes) as type} {#each Object.keys(visibleTypes) as type (type)}
<button <button
class="filter-chip" class="filter-chip"
class:active={visibleTypes[type]} class:active={visibleTypes[type]}
@@ -143,93 +144,79 @@
padding-top: 0; padding-top: 0;
} }
.top-nav { .top-nav {
display: flex; position: fixed;
align-items: center; width: 100%;
justify-content: space-between; box-sizing: border-box;
padding: 0.5rem 1rem; top: 0;
background: #0f172a; left: 0;
color: white; display: flex;
gap: 1rem; align-items: center;
} justify-content: space-between;
padding: 0.5rem 1rem;
background: #3c6f79;
color: #e1ebeb;
gap: 1rem;
z-index: 10000;
}
.nav-cluster { .nav-cluster {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 1rem; gap: 1rem;
min-width: 0; /* Prevents flex children from overflowing */ min-width: 0; /* Prevents flex children from overflowing */
} }
.home-link { .home-link {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 36px; width: 36px;
height: 36px; height: 36px;
background: #1e293b; background: #404c55;
border: 1px solid #334155; border: 1px solid #334155;
border-radius: 8px; border-radius: 8px;
color: #94a3b8; color: #e1ebeb;
text-decoration: none; text-decoration: none;
font-size: 1.2rem; font-size: 1.2rem;
flex-shrink: 0; /* Keeps button from squishing on mobile */ flex-shrink: 0;
} transition: all 0.3s ease;
}
.home-link:hover { .home-link:hover {
background: #334155; background: #2d2d2d;
color: white; }
border-color: #475569;
}
.route-stack { .route-stack {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
min-width: 0; min-width: 0;
} }
.primary-station { .primary-station {
font-size: 1rem; font-size: 1rem;
font-weight: 800; font-weight: 800;
margin: 0; margin: 0;
white-space: nowrap; white-space: nowrap;
overflow: hidden; color: #cce9e9;
text-overflow: ellipsis; overflow: hidden;
} text-overflow: ellipsis;
.secondary-station {
font-size: 0.7rem;
color: #94a3b8;
text-transform: uppercase;
font-weight: 600;
}
.quick-actions {
display: flex;
gap: 0.5rem;
}
.icon-btn {
background: #1e293b;
border: 1px solid #334155;
color: white;
padding: 0.4rem 0.6rem;
border-radius: 6px;
font-size: 0.75rem;
font-weight: bold;
cursor: pointer;
white-space: nowrap;
}
.map-spine {
padding-top: 72px;
} }
.secondary-station { .secondary-station {
font-size: 0.85rem; font-size: 0.7rem;
font-weight: 500; color: #cce9e9;
color: #64748b; text-transform: uppercase;
letter-spacing: 0.025em; font-weight: 600;
margin-top: 2px; }
.quick-actions {
display: flex;
gap: 0.5rem;
}
.map-spine {
padding-top: 72px;
} }
@media (min-width: 768px) { @media (min-width: 768px) {
@@ -267,6 +254,7 @@
inset: 0; inset: 0;
background: rgba(0, 0, 0, 0.4); background: rgba(0, 0, 0, 0.4);
z-index: 150; z-index: 150;
transition: all 0.3s ease;
} }
.filter-drawer { .filter-drawer {
@@ -274,7 +262,7 @@
bottom: 0; bottom: 0;
left: 0; left: 0;
right: 0; right: 0;
background: white; background: #3c6f79;
z-index: 200; z-index: 200;
border-radius: 20px 20px 0 0; border-radius: 20px 20px 0 0;
box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.15); box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.15);
@@ -287,17 +275,17 @@
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 1.25rem 1.5rem 0.75rem; padding: 1.25rem 1.5rem 0.75rem;
border-bottom: 1px solid #f1f5f9; border-bottom: 1px solid #e1ebeb;
} }
.drawer-header h3 { .drawer-header h3 {
margin: 0; margin: 0;
font-size: 1rem; font-size: 1rem;
color: #1e293b; color: #e1ebeb;
} }
.close-icon { .close-icon {
background: #f1f5f9; background: #404c55;
border: none; border: none;
border-radius: 50%; border-radius: 50%;
width: 32px; width: 32px;
@@ -306,7 +294,12 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
cursor: pointer; cursor: pointer;
color: #64748b; color: #e1ebeb;
transition: all 0.3s ease;
}
.close-icon:hover {
background: #2d2d2d;
} }
.drawer-content { .drawer-content {
@@ -323,14 +316,14 @@
padding: 0.5rem 1rem; padding: 0.5rem 1rem;
border-radius: 999px; border-radius: 999px;
border: 1px solid #e2e8f0; border: 1px solid #e2e8f0;
background: #f8fafc; background: #ff6060;
font-size: 0.875rem; font-size: 0.875rem;
cursor: pointer; cursor: pointer;
transition: all 0.2s; transition: all 0.2s;
} }
.filter-chip.active { .filter-chip.active {
background: #1e293b; background: #00725b;
color: white; color: white;
border-color: #1e293b; border-color: #1e293b;
} }
@@ -345,23 +338,22 @@
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
gap: 0.4rem; gap: 0.4rem;
border: none;
padding: 0.5rem 0.8rem; padding: 0.5rem 0.8rem;
border-radius: 12px; border-radius: 12px;
border: 1px solid #e2e8f0; background: #404c55;
background: #f8fafc; color: #e1ebeb;
color: #475569;
font-size: 0.75rem; font-size: 0.75rem;
font-weight: 700; font-weight: 700;
cursor: pointer; cursor: pointer;
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
text-transform: uppercase; text-transform: uppercase;
letter-spacing: 0.02em; letter-spacing: 0.02em;
transition: all 0.3s ease;
} }
.icon-btn:hover { .icon-btn:hover {
background: #f1f5f9; background: #2d2d2d;
border-color: #cbd5e1;
color: #1e293b;
} }
.icon-btn:active { .icon-btn:active {

File diff suppressed because it is too large Load Diff

View File

@@ -11,8 +11,11 @@ elecStart:
elecEnd: elecEnd:
elec: none elec: none
routeDetail: routeDetail:
- type: crossovers - type: continues
name: Scours Lane Junction routeName: Paddington - Reading West Jn
description: Line diverges routeId: '0001'
miles: 38 - type: crossovers
chains: 90 name: Scours Lane Junction
description: Line diverges
miles: 38
chains: 90