تخطَّ إلى المحتوى

Marina Berth

v1.0

A harbour office app on navy glass with coral light: a drawn pontoon map of 220 berths, visitor arrivals timed to the tide, the fuel dock, the boatyard and reports.

$69

عنوان الصفحة: /

مدمج

ما تحصل عليه
  • فاتح وداكنيستخدم ألوان سمتك
  • سطح المكتب والجهاز اللوحي والهاتفالشاشات المصمّم لها
  • الحزم…
  • حجم الكود…
  • خفيف على البطارية30 إطارًا في الثانية، ويهدأ حين يسكن
  • يتوقّف حين يُخفىخارج الشاشة أو في تبويب آخر
  • تقليل الحركةهادئ لمن يطلب ذلك

يُفحص مع كل تغيير

فُحص أمنيًا في 3 ديسمبر
  • فحص الأنواعTypeScript strict
  • التدقيق والتنسيقESLint · Prettier
  • الاختبارات والبناءلقطات شاشة بالوضعين الفاتح والداكن
  • تدقيق أمنيلا تحذيرات عالية أو حرجة
  • عمر الحزمكل إصدار منشور منذ أكثر من 7 أيام
  • المعالج عند السكونأقل من نصف نواة عند السكون، ≤ 30 إطارًا في الثانية

الكود

marina-berthReact
  • marina-berth.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.
    • arrivals.tsxVisitors: the week as a strip of days, the tide against the sill with each ETA on it, and the day's arrivals (check in to a free berth that fits) and departures (check out with the bill); bookings added, changed and cancelled here.
    • berths.tsxThe berths: the drawn pontoon map (or a list) filtered by pontoon and status, the glass side panel for the picked berth, and the tray of boats still waiting, dragged straight onto a free berth that fits.
    • boat.tsxOne boat's page: the vessel with its berth and today's windows over the sill, the owner, the contract, the insurance and its yard work, each a tab kept in the address; edit and delete on top.
    • boats.tsxThe register of boats and owners: search, type and where-it-is filters kept in the address, renewals due, and each row opening the boat's own page.
    • fuel.tsxThe fuel dock: both tanks as gauges with days left at the current rate, the pump's sale form, today's takings and prices, fourteen days of litres, the sales log (void a mistake) and the tanker deliveries.
    • job.tsxOne yard job: the boat, who has it and when it's due, its stage as a slipway of four steps with the next one a press away, then the quote (lines to add, change and remove, with VAT) and the log, each a tab kept in the address.
    • overview.tsxThe harbour office's start page: today's four figures, the live pontoon map beside today's movements over the sill, then the tanks, the yard and six months of money — every card a way into the list behind it.
    • reports.tsxThe reports: six or twelve months of occupancy, revenue by stream and fuel sold — four figures on top, then the charts, the current month lit.
    • settings.tsxThe settings page: the marina's rates and limits, then Appearance (style, theme and language).
    • sign-in.tsxThe sign-in page (#/sign-in): the logo and the form on one card over the backdrop, without the rail and the header.
    • yard.tsxThe boatyard: repair jobs on a board from quote to done (each moved on with one press, or opened for its quote), and the travel lift's next six days as a grid of slots to book.
  • 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).
    • berth-overview.tsxThe side panel with no berth picked: the hint, each pontoon's berths taken and free (a row filters the map to it), and the boats coming and going next, stretched to the map's height.
    • berth-panel.tsxThe glass side panel for the picked berth (with none picked, berth-overview.tsx): who is in it (the boat and owner, or the visitor), a boat to moor there when it's free, and the berth itself to change or remove.
    • berth-tray.tsxThe tray under the map: visitors due and berth holders still without a berth, each a card you lift and drop on a free berth.
    • boat-form.tsxAdd a boat to the register (or change one): the vessel and its owner in one dialog, checked by the app before saving; a new boat gets an annual contract from today and opens on its own page.
    • boat-terms.tsxA boat's paperwork, each tab its own small form: the berth contract (term, dates, price, days left) and the insurance (insurer, policy, cover, expiry).
    • booking-form.tsxA visitor booking, new or changed: boat, skipper, where from, the day, nights and ETA; the app checks each field, and warns when the ETA misses the boat's window over the sill.
    • fuel-forms.tsxThe fuel dock's forms: a sale at the pump (boat, fuel, litres, card or account, the total as you type), a tanker delivery, and the price a litre.
    • header.tsxThe glass header: the menu button on narrow screens, the day's tide drawn across the middle with a coral marker that moves on the shared clock (height, flooding or ebbing, the next turn), then search, Pause (stills the water), the theme switch and the account menu.
    • marina-settings.tsxThe marina's own settings: its name, the berth and visitor rates, power a night, the sill height the tide windows use, and when a tank counts as low.
    • sidebar.tsxThe rail: the mark and the marina, search with the palette shortcut, and the pages as berth slots off a walkway; a glass hull glides into the current one on the liquid spring and squishes as it moors.
    • 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.
    • tide-card.tsxThe day's tide against the sill: the curve, the depth a typical keel needs drawn across it, the stretches when it's clear lit, and each arriving boat's ETA as a coral bead on the curve (amber when it would be outside its window).
    • yard-forms.tsxThe boatyard's dialogs: a new repair job (the work, the boat, who does it, when it's due — it starts as a quote) and a travel-lift booking (boat, day, slot, lift out / launch / hold), changed or removed from the same dialog.
  • partsWhat several sections share.
    • buildWhat several sections share.
      • cardsWhat several sections share.
        • sheen.tsThe sheen card style: cards rise, plus one soft light sweep across each card as it lands.
      • rowsWhat several sections share.
        • slide.tsThe slide row motion: each row on screen slides 12px in from the nav side, from faint.
      • 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 over deep harbour water (coral dusk light, harbour blue, navy, a pale foam), dusky in dark and pastel in light, drifting very slowly. With followBackground it paints your background instead.
    • charts.tsxThe charts, each plotted in a recessed glass well: pill bars (the current one in coral), stacked pill columns, a glowing line over a soft area, and a ring. Lines draw in with the kit's BuildLine; bars grow from the floor.
    • clock.tsThe one shared clock every live part runs on: at most 30 ticks a second, none while the tab is hidden, and each part asks only as often as it needs (the tide marker once a few seconds).
    • command-palette.tsxThe command palette (⌘K or Ctrl K): type to find a page or an action, then Enter.
    • confirm.tsxAsks before something that can't be taken back (remove a berth, delete a boat, void a sale): the question, Keep it, and the red action.
    • 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.
    • drag-berth.tsDrag a waiting boat from the tray onto a free berth on the map: mouse and pen at once, touch after a short press (a swipe still scrolls), the lifted copy kept under the grab point and following 1:1, the page and the map scrolling near their edges, Escape to cancel. On a drop that fits, the copy glides into the exact slot and shrinks to it; otherwise it glides home.
    • 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."), plus money, litres, metres and times.
    • 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 water: the rail's glass hull, the segmented switches and the tab rows share 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.
    • pontoon-map.tsxThe drawn pontoon map, the app's signature: the quay, the breakwater and the harbour mouth, eight pontoons with a slot for every berth, and in each slot the boat in it (teal for annual holders, coral for visitors, dashed when away or expected). Light drifts over the water under the pontoons; a boat dropped on a slot settles into it.
    • 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.
    • tide.tsToday's tide at the harbour mouth: the height through the day (two highs, two lows), its turning points, whether it is flooding or ebbing, and the windows when a boat of a given draft clears the sill. Swap in your own tide station's figures, or read them from a tide service.
    • toasts.tsxThe toasts: short notes that confirm what just happened, at the bottom end.
    • ui.tsxThe small shared pieces every page is built from: glass panels, a card's heading row, the page heading, segmented switches and tab rows on the liquid marker, status chips, stat tiles, meters, and attempt (every save with its toast and catch).
    • 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 harbour-office half: the fuel dock, the boatyard, the reports and the marina's settings. Same rules as data/api.ts: swap each body for a call to your backend.
    • api.tsThe fake API: every page loads and saves through these functions (and data/api-ops.ts), so wiring a real backend happens here only.
    • db.tsThe pretend database the fake API reads and writes: the tables made from the seed once per visit, and the reads that join them (what the pages show). Replace it with your backend; data/api.ts is the only caller.
    • seed-ops.tsThe pretend harbour office: visitor bookings, the fuel dock, the boatyard's jobs and lifts, a year of monthly figures and the marina's settings. Swap in your own, or load them from your backend.
    • seed.tsThe pretend marina: 220 berths on eight pontoons, the annual boats in them and their owners, contracts and insurance. Swap in your own, or load them from your backend in data/api.ts.
  • 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}).

marina-berth.tsx

The page: the sections in order.

جارٍ التحميل…
مناسب لـ
A marina's harbour office: berths and berth holders, visitors over the sill, fuel sales and tanks, yard jobs and the travel lift.
كيف يعمل
Light drifts under the pontoons, the tide marker moves on the header's curve, and a waiting boat dragged to a free berth settles in.
طريقة الاستخدام
Edit words in locales/, colors and fonts in theme.ts, and swap the bodies in data/api.ts and data/api-ops.ts for calls to your backend.