Aller au contenu

Laundry Lather

v1.0

A laundromat front desk on a bento grid: a live floor of 40 spinning drums, wash-and-fold orders you drag onto free washers, loyalty cards, faults, stock and takings.

$69

Adresse de la page : /

Intégré

Ce que vous obtenez
  • Clair et sombreUtilise les couleurs de votre thème
  • Ordinateur, tablette et téléphoneLes écrans pour lesquels il est conçu
  • Paquets…
  • Taille du code…
  • Économe en batterie30 i/s, au repos quand rien ne bouge
  • Pause quand masquéHors écran ou autre onglet
  • Mouvement réduitCalme pour ceux qui le demandent

Vérifié à chaque modification

Sécurité vérifiée le 3 déc.
  • Vérification des typesTypeScript strict
  • Lint et formatESLint · Prettier
  • Tests et buildCaptures claires et sombres
  • Audit de sécuritéAucune vulnérabilité élevée ou critique
  • Ancienneté des paquetsChaque version publique depuis 7 jours ou plus
  • CPU au reposMoins d’un demi-cœur au repos, ≤ 30 i/s

Code

laundry-latherReact
  • laundry-lather.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.
    • customer.tsxOne customer (#/customer/c03): their loyalty card as the hero (add a stamp, use a free wash), their orders and spend, and tabs for their orders and their details.
    • customers.tsxCustomers (#/customers): loyalty cards close to a free wash as the hero, how many customers, free washes owed, visits and average spend, then every customer with their card, orders and spend, found by name or phone.
    • faults.tsxFaults (#/faults): machines in service as the hero, open, out of order, the average fix and this week's reports, then the faults (?show=open, repaired or all) to repair, take out of service or put back.
    • machine.tsxOne machine (#/machine/W07): its drum counting down as the hero with what you can do now (start, stop, unload, out of order, report), its cycles today and price, and tabs for its last cycles, its faults and its details.
    • machines.tsxMachines (#/machines): the busy share as the hero, how many are free, running, nearly done and out of order, and the whole floor, filtered by type and status in the address (?kind=, ?status=).
    • order.tsxOne wash-and-fold order (#/order/WF-2049): its stages as the hero with the next step, its price and due time, and tabs for its details and its timeline.
    • orders.tsxWash & fold (#/orders): today's loads by stage as the hero, ready, in progress, turnaround and kilos this week, then the board from received to ready; each card moves on a stage, ready ones are collected (that takes the money and stamps the card). ?stage= shows one stage.
    • overview.tsxThe overview (#/): the machine floor as the hero, live busy share and takings, the wash-and-fold queue to drag onto free washers, ready bags, machine use by hour, open faults and low stock.
    • reports.tsxReports (#/reports): takings over 7 or 30 days (?range=) against the days before as the hero, where the money came from, the busiest machines and machine use by hour of the day.
    • settings.tsxSettings (#/settings): the prices (washers by size, dryers, wash and fold, express), the shop (name, hours, the loyalty card) and Appearance (style, theme, language). Forms check their own fields and say what is wrong under each.
    • sign-in.tsxThe sign-in page (#/sign-in): the form on one tile and, from tablet width, a hero tile beside it with a row of the shop's drums and how busy it is now, without the top bar.
    • supplies.tsxSupplies (#/supplies): the coins as the hero (the coin boxes to empty, the change machines to fill), low stock and the items running out soonest, then every item's stock to restock or use.
  • 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).
    • dialogs.tsxEvery dialog of the app in one place: whichever parts/act.ts says is open (a form from sections/forms.tsx, starting a cycle, repairing a fault, a confirm). While one closes it keeps its last content, so its way out plays with the words still in it.
    • dock.tsxThe phone dock: the three busiest pages and More at the bottom of a phone screen; More opens a sheet with the rest. From tablet width the top bar's pills take over.
    • floor.tsxThe machine floor: every washer and dryer as its drum, its id and what it is doing (minutes left, done, free, out), each a link to the machine. Free washers can take a dragged wash-and-fold order (parts/drag-order.ts); items glide when a filter changes.
    • forms.tsxThe add and edit forms the dialogs show: a wash-and-fold order, a customer, a fault, a stock item and a machine. Each checks its own fields (noValidate), says what is wrong under each one, saves through data/api.ts and closes.
    • order-queue.tsxThe wash-and-fold queue: the orders still waiting at the counter, each a chip you drag onto a free washer on the floor. Dropping starts that washer, its ring starts counting down and the order moves to washing (Undo puts it back).
    • 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.
    • top-bar.tsxThe top bar: the logo, the pages as pills with one lit pill gliding to the page you are on (inline from desktop width, a second row on tablets, the phone dock below that), search, the theme switch and the account menu. It sits clear on the page and frosts only once the page scrolls.
  • partsWhat several sections share.
    • buildWhat several sections share.
      • cardsWhat several sections share.
        • iris.tsThe iris card style: each card opens as a circle from its center.
      • 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).
    • act.tsSaving from a click, the one way: run the save, show every page the change, confirm with a toast (with Undo where it can be undone), and say what went wrong when it fails. Plus which dialog is open, so any page or the command palette can open one.
    • 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 Glass style's backdrop: what shows through the see-through panels, faded out in Solid; with followBackground it paints your background instead.
    • charts.tsxThe charts: rounded bars with the current one in the primary, a smooth line with a soft area under it (and a sparkline), a ring gauge and a stacked share bar. Each plot box carries data-chart so the Chart Studio finds it.
    • 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.
    • drag-order.tsDrag a wash-and-fold order onto a free washer: mouse and pen at once, touch after a short press (a swipe still scrolls), the lifted copy kept under the grab point 1:1, the washer under it swelling as a target, then a glide into its drum; Escape or a miss glides it home. Keys: Space lifts, the arrows move between free washers, Space or Enter drops, Escape puts it back.
    • drum.tsxA machine drawn from the front: its round door with the load inside and the time-left ring around it. A running drum tumbles and its ring counts down on the shared clock (parts/live.ts); done, free and out of order drums sit still, each with its own mark so none reads by color alone.
    • 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.
    • grids.tsEach page's bento: the named tile areas at phone and tablet (2 columns), small laptop (4, from a 64rem wide app) and desktop (6, from 80rem). Every row is filled, so the grid closes into a rectangle at each width.
    • 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).
    • live.tsThe one shared clock of the live parts: drawing at most 30 times a second for the spinning drums and rings on screen, once a second for times, busy share and the shop itself; all of it rests while the tab is hidden, and reduced motion keeps only the once-a-second step.
    • 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.
    • page.tsxWhat every page shares: its title row (the h1, a line under it, its actions), its loading and error states while its loads answer, and the FLIP glide when a filter moves its items.
    • 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.
    • tile.tsxA bento tile: one card look on every page, placed in its page grid's named area; the hero is tinted with the primary, a tile with an href is one link. Plus the small pieces tiles share: a meter, the live mark, a stat.
    • toasts.tsxThe toasts: short notes that confirm what just happened, at the bottom end.
    • 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; the laundromat's owner.
    • api.tsThe fake API: every page loads and saves through these functions, so wiring a real backend happens here only.
    • db.tsThe pretend database the fake API reads and saves, and the live shop that runs on it: cycles end, customers start machines and pay, wash-and-fold loads move from washer to dryer. Delete the simulation (step) when you wire a real backend.
    • rules.tsThe laundromat's rules, shared by the fake API, the live floor and the pages: the demo clock, what a machine is doing, how long a program runs and what an order costs.
    • seed.tsThe pretend laundromat on Elm Street: 24 washers, 16 dryers, the wash-and-fold orders, regular customers, faults, supplies and a month of takings, all set around the demo clock (data/rules.ts) so today is always mid-afternoon and busy.
    • types.tsThe shapes of the laundromat's data: machines, wash-and-fold orders, customers, faults, supplies, takings and the shop's settings.
  • 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}).

laundry-lather.tsx

The page: the sections in order.

Chargement…
Idéal pour
Self-service laundromats and wash-and-fold shops that want every washer, dryer, order and dollar on one live screen.
Fonctionnement
Drums spin and count down live; drag a wash-and-fold order onto a free washer and it starts, its ring runs and the order moves on.
Utilisation
Edit words in locales/ and colors in theme.ts, and swap the bodies in data/api.ts for calls to your backend.