diff --git a/README.md b/README.md index bc97a40..909b8ef 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ In a Security Operations Center (SOC), analysts must often parse through massive - bookings by route and by class; - a bookings table you can sort, search and page through. - It has Export CSV and Print / Save PDF buttons and a light/dark switch, uses the Space Mono font (falling back to the system monospace font offline), and works on a phone. + It has Export CSV and Print / Save PDF buttons and a light/dark switch, uses DM Sans for the interface and Space Mono for compact data labels (with offline system fallbacks), and works on a phone. - **Text report:** `--format txt` (or `both`) writes the same figures as plain text. - **Skipped rows:** listed in the report and saved next to it as `..._skipped_rows.csv`. - **Privacy by default:** passenger names are masked (`Maria Gonzalez` becomes `M. G•••••••`) and full names are never written to the file unless you pass `--show-names`. Spreadsheet text is HTML-escaped, and CSV cells that could run as spreadsheet formulas are neutralised. @@ -65,10 +65,11 @@ python samples/make_sample.py # regenerate the sample workbook `Project.ipynb` is the original notebook version, kept for reference. The maintained code is in `report_tool/`. ### Web app (Vercel) -`app.py` is a small Flask app. The landing page explains the tool, shows a preview built from the sample file, and takes an `.xlsx` upload (up to 4 MB, drag and drop or browse) that returns the HTML dashboard. `/sample` shows the sample report and `/template.xlsx` downloads a blank workbook with the right headers. Upload problems (wrong file type, missing columns, no usable rows) are explained in plain words with how to fix them. The page uses the Space Mono font and has a light/dark switch that remembers your choice. Uploads are processed in a temporary file that is deleted straight away; nothing is stored. Passenger names stay masked unless the "Show full passenger names" box is ticked. +`app.py` is a small Flask app. The landing page explains the tool, shows a preview built from the sample file, and takes an `.xlsx` upload (up to 4 MB, drag and drop or browse) that returns the HTML dashboard. `/sample` shows the sample report and `/template.xlsx` downloads a blank workbook with the right headers. Upload problems (wrong file type, missing columns, no usable rows) are explained in plain words with how to fix them. The page uses a light retro design with warm paper surfaces, muted modular accents and DM Sans typography and has a light/dark switch that remembers your choice. Uploads are processed in a temporary file that is deleted straight away; nothing is stored. Passenger names stay masked unless the "Show full passenger names" box is ticked. ```bash flask --app app run # http://127.0.0.1:5000 ``` On Vercel it deploys with no extra configuration: Vercel finds `app.py` and installs the dependencies from `pyproject.toml`. + diff --git a/assets/railstat-mark.svg b/assets/railstat-mark.svg index 28d7704..86e944b 100644 --- a/assets/railstat-mark.svg +++ b/assets/railstat-mark.svg @@ -1 +1 @@ - + diff --git a/report_tool/templates/_logo.html b/report_tool/templates/_logo.html index 59851dc..0e36415 100644 --- a/report_tool/templates/_logo.html +++ b/report_tool/templates/_logo.html @@ -1,3 +1,3 @@ -{# Railstat logo: a rising rail route (two stations joined by a line that climbs like a trend). #} - -Railstat +{# Small modular locomotive, with understated brick colours. #} + +Railstat diff --git a/report_tool/templates/_theme.html b/report_tool/templates/_theme.html index 246bce6..3edc20a 100644 --- a/report_tool/templates/_theme.html +++ b/report_tool/templates/_theme.html @@ -1,8 +1,8 @@ -{# Shared look: Space Mono, light/dark tokens, and the theme switcher. Included in
. #} - +{# Shared look: warm paper, light modular accents, light/dark tokens, and the theme switcher. Included in . #} + - + + diff --git a/report_tool/templates/report.html.j2 b/report_tool/templates/report.html.j2 index b9b3b1c..26dd0b8 100644 --- a/report_tool/templates/report.html.j2 +++ b/report_tool/templates/report.html.j2 @@ -149,6 +149,56 @@ footer { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-betwee .filters { position: static; } .card, .quality { break-inside: avoid; } } + +/* Light retro: quiet paper surfaces and small modular details. */ +.wrap { max-width: 1360px; padding: 0 32px 48px; gap: 26px; } +.topbar { padding: 20px 0; } +h1 { font-size: clamp(26px, 3vw, 34px); font-weight: 600; letter-spacing: -.035em; } +h2 { font-size: 17px; font-weight: 600; } +.report-subtitle { color: var(--muted); margin-top: 8px; font-size: 16px; } +.file-chip { background: transparent; border-radius: 4px; font: 11px var(--mono); padding: 0; } +button, .button, select { border-color: var(--line); background: transparent; } +button.primary { background: var(--key); color: var(--key-ink); border-color: var(--key); box-shadow: 0 2px 0 var(--key-edge); font-weight: 500; } +.kpis { gap: 0; padding: 12px 0 26px; border-bottom: 1px solid var(--line); grid-template-columns: repeat(4, minmax(0, 1fr)); } +.kpi { background: transparent; border: 0; border-radius: 0; padding: 0 24px; gap: 9px; } +.kpi:first-child { padding-left: 0; } +.kpi + .kpi { border-left: 1px solid var(--line); } +.kpi .label { color: var(--ink); display: flex; align-items: center; gap: 12px; font-size: 14px; } +.kpi .label::before { content: ''; width: 9px; height: 9px; background: var(--brick); box-shadow: 11px 0 var(--brick), 0 -11px var(--brick); margin: 8px 12px 0 0; flex: none; opacity: .8; } +.kpi:nth-child(2) { --brick: #88aabb; } +.kpi:nth-child(3) { --brick: #c9937b; } +.kpi:nth-child(4) { --brick: #98ad83; } +.kpi .value { font-size: clamp(27px, 3.2vw, 42px); font-weight: 500; letter-spacing: -.04em; } +.kpi-spark svg { height: 24px; } +.filters { border: 0; border-radius: 0; padding: 12px 0; background: var(--page); gap: 16px; } +.segmented { border: 0; gap: 4px; } +.segmented button { border-radius: 6px; } +.segmented button + button { border-left: 0; } +.segmented button[aria-pressed="true"] { background: var(--key); color: var(--key-ink); font-weight: 500; } +.card:not(.kpi) { border-radius: 9px; padding: 24px; background: transparent; gap: 18px; } +.row { gap: 22px; } +.quality { padding: 10px 0; border-radius: 0; gap: 10px; } +.quality.ok { background: transparent; border: 0; } +.quality.warn { border: 0; border-left: 3px solid var(--warn-line); padding-left: 14px; background: transparent; color: var(--ink); } +.quality strong { font-weight: 500; } +.quality .button { font-weight: 500; font-size: 12px; } +#trend-title::before, #routes-title::before { content: '01'; font: 11px var(--mono); color: var(--muted); margin-right: 12px; } +#routes-title::before { content: '03'; } +#cancel-title::before, #class-title::before { content: '02'; font: 11px var(--mono); color: var(--muted); margin-right: 12px; } +#class-title::before { content: '04'; } +.table-box { border: 0; } +th { background: var(--head); } +th button { font: 11px var(--mono); } +td { padding: 14px 12px; } +td:first-child, td.num { font-family: var(--mono); font-size: 12px; } +.status::before { background: #86a375; } +.status.cancelled::before { background: var(--series-2); } +.track { height: 15px; } +input[type="search"] { background: transparent; border-color: var(--line); } +svg text { font-family: var(--mono); font-size: 10px; } +@media (max-width: 800px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 28px; } .kpi:nth-child(3) { border-left: 0; padding-left: 0; } } +@media (max-width: 640px) { .wrap { padding: 0 16px 32px; gap: 20px; } .kpi { padding: 0 12px; } .card:not(.kpi) { padding: 16px; } .filters { gap: 10px; } .file-chip { width: 100%; flex-wrap: wrap; } .file-chip strong { max-width: 100%; } .kpi .label { font-size: 12px; } .kpi .sub { font-size: 11px; } } +@media print { .wrap { max-width: none; padding: 0; gap: 14px; } .kpi .value { font-size: 28px; } .filters { position: static; } } @@ -171,34 +221,10 @@ footer { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-betweeA clearer view of your railway bookings.