Ferry Wake
v1.0A glass operations app for a two-boat ferry line, where vehicles dragged into deck lanes make the ferry list and the deck fill roll up.
Sayfa adresi: /
Yerleşik
Neler alırsınız- Açık ve koyuTema renklerinizi kullanır
- Masaüstü, tablet ve telefonTasarlandığı ekranlar
- Paketler…
- Kod boyutu…
- Pil dostu30 fps, dururken boşta
- Gizliyken dururEkran dışında veya başka sekmede
- Hareketi azaltİsteyenler için sakin
Her değişiklikte kontrol edilir
Güvenlik kontrolü: 3 Ara- Tür denetimiKatı TypeScript
- Lint ve biçimESLint · Prettier
- Testler ve derlemeAçık ve koyu ekran görüntüleri
- Güvenlik denetimiYüksek veya kritik uyarı yok
- Paket yaşıHer sürüm 7+ gündür herkese açık
- Boşta CPUDururken yarım çekirdekten az, ≤ 30 fps
Kod
ferry-wakeReact
- ferry-wake.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.
- boat-detail.tsxOne boat: its state, seats and lanes to change with today's sailings beside them; its maintenance jobs to add, tick off or remove; and its fuel, bunkering log and a form to log fuel taken on.
- boats.tsxThe Boats page: each ferry drawn to scale with its state, fuel and how many crossings it still covers, today's sailings and open jobs; under them the fuel burnt the last two weeks and the maintenance due next.
- crew.tsxThe Crew page: the week's roster (this week or next) with its cover check, the people on both boats, and every certificate by its expiry with renewals.
- crossing-detail.tsxOne sailing: the boat drawn to scale with its loads and times, then its manifest (every ticket, with refunds), how its car deck sits and who crews it.
- crossings.tsxThe Crossings page: one day's timetable for both boats (yesterday to six days ahead, a boat filter in the address), the day's summary on top, and each sailing's state, seats, deck fill and takings, with its status a click away.
- deck.tsxThe Car deck page: pick a sailing still to leave, then drag its booked cars and vans into the four lanes while the ferry shows how she sits.
- overview.tsxThe Overview: the day at a glance (people and vehicles carried, deck fill, on-time), today's sailings, the next car deck to load, the harbour weather, what needs attention and the week's passengers.
- reports.tsxThe Reports page: the last 7, 14 or 30 days (in the address): passengers, deck fill, on-time rate and takings at a glance, passengers a day, the ticket mix, and how full the deck ran and how punctual the boats were.
- settings.tsxThe settings page: the line's fares and timings (every ticket priced from them) beside Appearance (style, theme and language).
- sign-in.tsxThe sign-in page (#/sign-in): over the harbour backdrop, the ferry crossing on the left and the sign-in card on frosted glass beside it, without the sidebar and top bar.
- tickets.tsxThe Tickets page: the day's sales by kind, the fares, the passes running low, then every ticket for the day (filters in the address) with sell, change and refund; the Passes tab lists the season and ten-trip passes.
- 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.
- 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).
- boat-forms.tsxA boat's forms: its state, seats and lane length; a maintenance job (title, kind, due date, hours); and a bunkering (litres taken on, price a litre) that tops up the tank.
- crew-forms.tsxThe crew's dialogs: add or change a person (name, role, boat, phone) and add a certificate (whose, which, its number and expiry).
- crossing-form.tsxThe sailing dialogs: add or move a sailing (boat, day, time, which pier) with a clash check, and set a sailing's status (on time, delayed by some minutes, or cancelled, with the reason).
- deck-balance.tsxHow the ferry sits with the load on the deck board: her stern rolling gently toward the heavier side, the deck fill rolling up, the tonnes each side, and the buttons that balance or clear the deck.
- deck-board.tsxThe car deck board: four lanes, port to starboard, and the marshalling queue of booked vehicles still ashore. Drag a vehicle into a lane (or press 1-4); a lane too short for it refuses it, and every move saves with Undo. The balance panel beside it shows how she sits as you drag.
- overview-cards.tsxThe Overview's cards: today's sailings still to come, the car deck of the next sailing with cars booked (tilting with its load), the harbour weather and tides, and what needs attention.
- passes.tsxThe Passes tab: every resident, monthly and ten-trip pass as a card with its holder, vehicle, trips or days left and expiry; issue, change or withdraw one.
- roster.tsxThe week's roster: each person a row, each day a cell showing their shift on their boat (early, late or off; a click moves it on), and a cover line on top flagging the days a boat sails without a master or mate, an engineer on the early shift or a deckhand.
- sidebar.tsxThe wide glass sidebar: the logo, the live mini map of the crossing, search with the command palette shortcut, the page links with a glass bead gliding to the current one, Settings apart at the foot and the company's name.
- 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.
- ticket-forms.tsxThe ticket desk's dialogs: sell or change a ticket (the sailing, foot / car / van / bike, single, return or on a pass, the plate and length for a vehicle, the price as you go) and issue or change a pass.
- top-bar.tsxThe top bar: the menu button on narrow screens, where you are, today's date, search, the theme switch and the account menu. It floats clear over the page; once the page scrolls the bar frosts itself (blur, a light ground fill, a thin bottom edge).
- partsWhat several sections share.
- buildWhat several sections share.
- cardsWhat several sections share.
- turn.tsThe turn card style: cards swing in like pages, hinged on their left edge.
- rowsWhat several sections share.
- stack.tsThe stack row motion, a drawer: the rows on screen start stacked under the first and spread to their places together.
- 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 soft clouds over the harbour (teal water light and one warm signal-orange glow, dusky in dark and pastel in light) and the faint line of the island and the mainland hills along the foot; with followBackground it paints your background instead.
- charts.tsxThe charts: pill bars, a glowing line and a donut, each plotted in a recessed glass well, the current bar or point lit in the accent, axis labels thinned so they never overlap.
- command-palette.tsxThe command palette (⌘K or Ctrl K): type to find a page or an action, then Enter.
- deck-drag.tsDrag vehicles between the deck lanes and the marshalling queue: mouse and pen at once, touch after a short press (a swipe still scrolls), the lifted copy kept under the grab point and gliding into its exact slot, the others sliding aside (FLIP), the page scrolling near its edges, Escape to cancel, a lane that can't take it refusing the drop, and a keyboard path (Space lifts, arrows move, Space drops).
- 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.
- ferry-art.tsxThe drawn ferries: the stern view on the car deck that rolls with the load (its four lanes filling as cars go on), and the side profile of each boat. Colors from the theme only.
- 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).
- liquid-marker.tsThe selected marker that moves like a drop of liquid: shared by every segmented control, tab row and the sidebar's nav bead.
- mini-map.tsxThe live mini map in the sidebar: the island, the mainland and the crossing between them, with both ferries where the timetable has them now (a soft wake rippling behind one at sea) and the next departure under it.
- 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.
- 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.
- 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 app's small shared pieces: a glass panel, the segmented control with its liquid bead, a page heading, a card heading, a status chip, a KPI tile with its sparkline, a meter, a confirm dialog and the save helper every page uses.
- 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-ops.tsThe fake API's saves: every create, edit, delete and rearrange goes through here, so wiring a real backend happens here and in data/api.ts only.
- api.tsThe fake API: every page loads through these functions (saves are in data/api-ops.ts), so wiring a real backend happens here only.
- db.tsThe pretend database the fake API reads and writes (data/api.ts, data/api-ops.ts): made once from the seed when the app loads.
- deck.tsThe car deck's arithmetic, shared by the fake API and the deck board: how much of a lane a vehicle takes, the weight on each side, the list it gives the ferry and an even load plan.
- seed-tickets.tsThe pretend tickets and passes: a full manifest for yesterday and today, bookings thinning out over the week ahead, and a load plan for every sailing that has left. data/api.ts is the only reader.
- seed.tsThe pretend ferry line: two boats on one crossing between the island of Skerrow and Port Calder on the mainland, with their timetable, crew, rosters, certificates, maintenance, fuel and 30 days of history. data/api.ts is the only reader.
- 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}).
ferry-wake.tsx
The page: the sections in order.
Yükleniyor…
- Şunlar için uygun
- Small ferry and boat operators running timetables, tickets and passes, the car deck, boats, crew rosters and reports.
- Nasıl çalışır
- Drag cars and vans into deck lanes: a full lane refuses them, the stern view rolls with the load and every move saves with Undo.
- Nasıl kullanılır
- Edit words in locales/ and colors in theme.ts, and swap the bodies in data/api.ts and data/api-ops.ts for calls to your backend.