Перейти до вмісту

Transit Loop

v1.0

A city transit control room in signal-yellow glass: a metro-style line map with vehicles moving on one clock, a flip-chip delay board, a disruption composer and drag-to-swap rosters.

$69

Адреса сторінки: /

Вбудовано

Що ви отримуєте
  • Світла й темнаВикористовує кольори вашої теми
  • Комп’ютер, планшет і телефонЕкрани, для яких його створено
  • Пакети…
  • Розмір коду…
  • Економить батарею30 fps, у спокої не навантажує
  • Пауза, коли прихованоПоза екраном або в іншій вкладці
  • Зменшення рухуСпокійно для тих, хто цього просить

Перевіряється після кожної зміни

Безпеку перевірено 3 груд.
  • Перевірка типівСтрогий TypeScript
  • Лінтер і форматESLint · Prettier
  • Тести й збіркаСкриншоти у світлій і темній темах
  • Аудит безпекиБез високих чи критичних загроз
  • Вік пакетівКожна версія публічна 7+ днів
  • Процесор у спокоїМенше половини ядра у спокої, ≤ 30 fps

Код

transit-loopReact
  • transit-loop.tsxThe page: the sections in order.
  • content.tsEvery word and number: brand, nav links, each section's copy and lists.
  • theme.tsThe colors as CSS variables, and the shared class strings.
  • README.mdHow to install it, and where to change the text, colors and form.
  • pagesOne file per page: the sections it shows, in order.
    • alerts.tsxRider alerts: the messages each line's riders got, will get or that wait as drafts, where they went and how many riders they reached. Filter by status (and by line from the top bar), both in the address; the composer opens from here and from ?new=.
    • disruption.tsxOne disruption: what happened and the rider message, then three tabs: Details (kind, cause, window and the actions: tell riders, mark cleared, edit, delete), Diversion (the lines hit on the map, with the stops skipped crossed out) and Notices (every message riders got, in order).
    • disruptions.tsxDisruptions: everything live, coming up and cleared, filtered in the address so Back keeps it. Each row shows the lines hit, how bad, why and when, and whether riders were told. The composer opens from here (and from ?new= anywhere in the app).
    • driver.tsxOne driver: name, depot and contact, then three tabs: Shifts (this week's, each with its line and times, and a swap waiting if there is one), Hours (hours driven each day this week against the 9-hour cap) and the driving permit (what it covers and when it runs out).
    • drivers.tsxDrivers: everyone who drives, with their depot, driving permit, this week's shifts and when the permit runs out. Filter by depot, search by name; both kept in the address. The driver form adds one or edits one.
    • line.tsxOne line: its badge, ends and numbers, then three tabs: Route (the strip map with live vehicles and the stops to edit), Timetable (departures and the service plan) and Alerts (what riders of this line were told, and a new alert).
    • network.tsxLines and stops: the whole network map, then every line as a card (its ends, how often it runs, on-time and the vehicles out now) that opens the line. Trams or buses only through the filter, kept in the address so Back returns to it.
    • overview.tsxThe Overview: four counts that link to their filtered lists, the live line map beside the delay board, on-time by line with the live disruptions and today's roster cover, and today's riders against an average day with the latest rider alerts. A line picked in the top bar narrows the map and the board.
    • reports.tsxReports: on-time over the last 12 days and by line, riders over a week, a month or a quarter, what caused disruptions and how many there were each week; the riders series downloads as a CSV. The range lives in the address so Back keeps it.
    • rosters.tsxRosters: this week's shifts for one depot as a grid to drag shifts around in, and the swap requests drivers sent, to approve or decline. The depot and the tab live in the address so Back keeps them.
    • settings.tsxThe settings page: Appearance (style and theme) beside the operator's own settings: its name, when a vehicle counts as late or early, and whether riders are told about new disruptions by default, and where; the language across the full width under both.
    • sign-in.tsxThe sign-in page (#/sign-in): the form on a glass card beside a drawn tram gliding along an overhead-wire street, without the rail and top bar. On a phone the card shows alone.
    • vehicle.tsxOne vehicle: its number, line and status, then three tabs: Live (where it is on the map now, its delay, load and driver), Trips (today's runs end to end) and Notes (what the depot and controllers wrote). Edit it or take it off the fleet from here.
    • vehicles.tsxVehicles: the whole fleet with each one's line, next stop, live delay (the same chip that flips on the board), how full it is and its driver. Filter by status or late, search by number or driver, sort by delay; every filter lives in the address so Back keeps it. The vehicle form adds one or edits one.
  • sectionsOne file per page section.
    • account-menu.tsxThe account menu under the avatar in the top bar: who is signed in, Settings and Sign out; the arrow keys move through it, Escape, Tab or a click outside closes it.
    • alert-composer.tsxThe rider alert composer: one line, a title and a short message, where it goes (app, stop displays, text) and when; a drawn phone shows the notification as riders will get it.
    • appearance.tsxSettings → Appearance: the style (Glass or Solid) and the theme (System, Dark or Light), each choice shown as a small preview; and the language (System or one of locales/list.ts), shown on its own.
    • delay-board.tsxThe delay board: the vehicles running latest, like a station departure board. Each delay is a chip that flips when it changes (on the shared 4-second tick, the same rule the map and the table read), and a row lights its line on the map while hovered.
    • disruption-composer.tsxThe disruption composer: pick the lines hit, the kind, how bad and why, the time window and the stops a diversion skips; the rider message previews as riders will see it, and one switch tells them on save.
    • roster-grid.tsxThe roster: drivers down the side, the week across, one shift a cell. Drag a shift (or lift it with Space and move it with the arrow keys) onto another cell to swap the two: the card starts under your finger, follows it 1:1 and glides into the exact cell on drop.
    • sidebar.tsxThe rail: a full-height glass rail docked to the start edge, the logo on top, the page keys in three groups with the liquid marker gliding behind the current one, and search at the foot. In the phone sheet it shows as rows with their names.
    • sign-in-form.tsxThe sign-in form: email and password with their errors under them, show or hide the password, keep me signed in, and the demo account to fill in; a wrong pair says so above the fields.
    • stop-strip.tsxA line's route as a strip map: every stop on the line's colored rail with its minutes from the start, the vehicles running on it gliding down the rail (one move every 4 seconds), and the stop list to edit: rename, move, remove, add.
    • timetable.tsxA line's timetable: the departures from its first stop hour by hour (every few minutes at the peaks, 7-9 and 16-19, less often between), and the service plan that writes them: peak and off-peak headways, first and last departure.
    • top-bar.tsxThe top bar: the line strip (all 12 line badges as one switcher: hover glows a line on the page, a click filters every page to it, the marker glides to the lit one), the network status, a ticker that flips through live disruptions, the clock, the theme switch and the account menu.
  • partsWhat several sections share.
    • buildWhat several sections share.
      • cardsWhat several sections share.
        • spotlight.tsThe spotlight card style: the page shows dim, then each card lights up in turn, 50ms apart, with a brief primary edge.
      • rowsWhat several sections share.
        • cols.tsThe cols row motion, a column wave: the parts of each row on screen (its children) arrive left to right, 35ms apart.
      • core.tsxThe page's build-in: on first load and on every page switch the cards arrive in the app's card style and their contents build: bars grow, lines draw, rings fill, the list rows on screen ripple in in the app's row motion, numbers count. The two picks are wired in ./index.ts.
      • index.tsThe app's two build-in picks, wired here and nowhere else: its card style (cards/) and its row motion (rows/). npm run new-app copies only the two it is given (--cards, --rows).
    • appearance.tsHow the app looks right now: dark or light, Glass or Solid, from Settings → Appearance, the page around it and the Style setting.
    • avatar.tsxA person's initials in a round badge, tinted with the primary.
    • backdrop.tsxThe backdrop: a drawn mesh of four big soft clouds in signal amber and slate behind the glass, with a faint drawn loop track, dusky in dark and pale butter in light, drifting very slowly. With followBackground it paints your background instead.
    • charts.tsxThe charts, each in a recessed glass well: pill bars with the current one in signal yellow, smooth lines with a soft glow and a fill, a donut, and the small sparkline on the number cards. Every series is a chart shade of the theme.
    • command-palette.tsxThe command palette (⌘K or Ctrl K): type to find a page or an action, then Enter.
    • dialog.tsxA centered modal dialog (a form, a confirm): rises in, plays its way out, Escape or a tap outside closes it, and the focus goes back where it was.
    • field.tsxA labeled form field (a text input or a select) with its error line under it, tied together for screen readers.
    • format.tsHow numbers and dates are written: by Intl, the current language's way ("1,240", "1.240"; "Nov 19", "19 nov."). Add a helper here when a page needs money, times or a list.
    • icons.tsxThe logo and the line icons, drawn on a 24-unit grid with round ends.
    • language.tsThe app's language: the words every page reads (useWords), how dates and numbers are written (parts/format.ts) and the reading direction. Picked in Settings → Appearance (or System: the page's own language) and kept in this browser; English is built in, any other language loads only when it shows (locales/list.ts).
    • line-map.tsxThe live line map: the network drawn as fine lit lines over a fine street grid, a softly shaded river with a slow sheen and faintly textured parks; glass stations, glass capsules where lines cross, and every vehicle in service a small light point with a short fading trail, moving on the shared clock, late ones ringed in red. Hovering a line lights it here and in the line strip; it pauses off screen, in hidden tabs, with Motion off and under reduced motion.
    • liquid-marker.tsThe selected marker that moves like a drop of liquid: shared by the rail, the line strip, segmented controls and tab rows.
    • map-ground.tsxThe line map's ground and shared paint: a fine two-level street grid, softly hatched parks, a shaded river with two sheen dashes the map's clock moves, and a depth vignette; plus the glass fill the stations and interchanges use. Every id is prefixed with the map's own, so two maps on a page don't clash.
    • moments.tsThe animations the sidebar, the sign-in card, menus, dialogs, the phone sheet and toasts play, timed by their moments in theme.ts.
    • motion.tsMotion helpers: the reduced-motion check, live, and run-once-in-view.
    • roster-drag.tsDrag a shift onto another driver's day in the roster grid; a shift already there swaps back into the cell it came from. Mouse and pen at once, touch after a short press (a swipe still scrolls), the lifted copy kept under the grab point, the displaced shift sliding across (FLIP), the page and the grid scrolling near their edges, Escape to cancel, and a keyboard path (Space lifts, arrows move, Space drops).
    • router.tsThe page switcher: reads the app's page from the address hash (#/settings, #/?status=open).
    • scroll-to-view.tsScrolls an element into view moving only its own scroll container, never the page around it.
    • select-box.tsxA native select dressed to match the app: no browser arrow, a drawn chevron instead.
    • session.tsWhether someone is signed in: a first visit is signed in as the demo account; Sign out holds until the next sign-in, and a sign-in without Keep me signed in lasts only this tab.
    • sheet.tsxThe phone sheet: a modal panel that springs in from the left with the sidebar; Escape, a tap outside or its close button slides it away.
    • sim.tsThe live network on one shared clock: where each vehicle is along its line, its delay as it drifts, and which line is highlighted. One loop for every map, at most 30 draws a second, stopped in hidden tabs and when nothing watches.
    • states.tsxThe data states every page shares: a calm skeleton while loading, an error with Try again, and an empty note with a way out.
    • store.tsThe app-wide state several parts share: the theme mode and style (kept in the browser) and the toasts.
    • ticker.tsxA number that counts up while its page builds in, and rolls to its new value whenever it changes.
    • toasts.tsxThe toasts: short notes that confirm what just happened, at the bottom end.
    • ui.tsxThe shared pieces every page is made of: the glass panel, segmented controls and tab rows with the liquid marker, line badges, delay chips that flip, occupancy bars, status chips, card headers and the save helper.
    • use-api.tsLoads data through the fake API with loading, error and retry, remembering each answer so a page you come back to shows at once.
    • use-dialog.tsOpens and closes a native <dialog> as a modal; on close it plays its way out first (data-closing), so dialogs, sheets and the palette never vanish in one frame.
  • dataThe pretend data and the fake API: swap it for your backend.
    • account.tsThe demo account: who is signed in (the account menu shows them) and the email and password the sign-in page takes.
    • api.tsThe fake API: every page loads and saves through these functions, so wiring a real backend happens here only.
    • desk.tsThe control desk's records: disruptions with their diversions and notices, rider alerts per line, ridership and the operator's settings. Dates are set from the moment the app loads, so the demo always reads as today.
    • network.tsThe network: 12 lines (4 tram, 8 bus), their drawn routes on the map (a 1000 x 600 plan, straight runs at 0, 45 and 90 degrees), their stops and service plans. Swap these for your network's GTFS.
    • ops.tsThe fleet and the people: 48 vehicles on the 12 lines, 48 drivers in three depots, this week's shifts and the swap requests between drivers.
  • localesEvery word the app shows, one JSON file a language; list.ts names them.
    • en.jsonOne language's words, with the keys of en.json.
    • es.jsonOne language's words, with the keys of en.json.
    • list.tsThe languages the app offers, in the picker's order: one JSON file each, en.json the source. To remove one, delete its file and its line; to add one, copy es.json, translate it and add a line. English is built in; the rest load only when picked. TypeScript checks each file has en.json's keys, scripts/check/check-locales.mjs the rest (no extra keys, plural forms, {slots}).

transit-loop.tsx

The page: the sections in order.

Завантаження…
Підходить для
Bus and tram operators, dispatch desks and mobility startups that run lines, vehicles, drivers and rider alerts.
Як це працює
Vehicles glide along a line map on a shared clock, delay chips flip as they change, and a hovered line glows on every page.
Як користуватися
Edit words in locales/ and colors in theme.ts, and swap the bodies in data/api.ts for calls to your backend or GTFS feed.