Carshare Indigo
v1.0A city car-share operator's app laid out as indigo bento tiles, its hero a live city map of every bay with the cars on trips moving along the streets.
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
carshare-indigoReact
- carshare-indigo.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.
- bookings.tsxBookings: one day at a time, a bay's timeline to drag bookings to a new hour, and every booking of the day to open, extend or cancel.
- cleaning.tsxCleaning: this week's rota of every bay, who cleans it on which day, ticked done or missed; today's round on top.
- damage.tsxDamage: every report with where on the car it is, how far its repair has got and what it costs; a report opens on the car drawing to mark it up.
- fleet.tsxThe Fleet: every car with where it is and what it is doing (out on a trip, charging, free, in the workshop or being cleaned), filtered by status and bay.
- members.tsxMembers: everyone who can drive, by plan and by driving check, searched by name or email; a member opens their trips, fines and plan.
- overview.tsxThe Overview: a bento of the city right now, its hero the map of every bay with the cars on trips moving along the streets; a bay opens into its booking timeline.
- reports.tsxReports: income by day, the busiest hours of the day and how much each car is used, over the last 7, 30 or 90 days.
- settings.tsxThe settings page: Appearance (style, theme and language), then prices and plans, then the bays.
- sign-in.tsxThe sign-in page (#/sign-in): the form on one card beside a tinted panel with the city's numbers, without the sidebar and top bar.
- 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).
- bay-focus.tsxOne bay opened from the city map: its cars, their charge and today's bookings on a timeline you drag to move a booking to another hour.
- booking-dialog.tsxThe booking dialog: book a car for a member by the half hour (checked against the car's other bookings), or open one to extend or cancel it; plus the move a dragged booking saves.
- car-detail.tsxOne car: its status and charge, holding it for the workshop or a clean, its bookings, its open damage on the car drawing, and changing or removing it.
- car-form.tsxThe car dialog: add a car to the fleet or change one (plate, model, class, power and home bay), the plate checked for gaps and doubles.
- fleet-settings.tsxThe operator's own settings: the hourly rate of each car class, each plan's price and discount, and the bays (add, rename, remove an empty one).
- member-detail.tsxOne member: their driving check (approve or turn it down), plan, trips and fines (add one, mark it paid or waive it), and closing the account.
- member-form.tsxThe member dialog: sign up a new member (name, email, plan), who waits for their driving papers to be checked before they can book.
- overview-tiles.tsxThe Overview's live tiles: cars on trips now, today's income, the cars charging, the next pick-ups and today's busy hours, all counted from the bookings at the demo's now.
- report-detail.tsxOne damage report: the car drawing to mark where it is (click the body to add a mark, pick one to change or remove it), its repair steps and the cost.
- sidebar.tsxThe sidebar: logo, search with the command palette shortcut, and the page links in three groups, with a tinted pill that glides to the current page; collapsed, only the icons show.
- 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 menu button on narrow screens, where you are, the city clock, search, the theme switch and the account menu; it frosts itself once the page scrolls.
- partsWhat several sections share.
- buildWhat several sections share.
- cardsWhat several sections share.
- wave.tsThe wave card style: cards arrive in a wave by grid position from the top-left.
- rowsWhat several sections share.
- mask.tsThe mask row motion: each part of a row on screen (its children) slides up from behind its own mask.
- 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 Glass style's backdrop: what shows through the see-through panels, faded out in Solid; with followBackground it paints your background instead.
- bay-timeline.tsxA bay's booking timeline: one row per car from 06:00 to midnight, a now line, and bookings you drag (or move with the arrow keys) to a new half hour.
- bento.tsxThe bento grid every page is laid out on: one grid of tiles in mixed sizes, its areas named per width, plus the tile, the page heading, the status chip, the meter and the live dot they share.
- car-diagram.tsxThe drawn car seen from above, front to the left: damage marks sit on it where they were found, and a click on the body adds a new one there.
- chart-path.tsA chart's line and area paths in each curve Chart Studio has (straight, smooth, step), and the classes that let a Chart Studio curve swap them in CSS.
- charts.tsxThe charts: rounded bars (muted, the current one in the primary), a smooth line with a soft area under it, and a ring; each grows in with the page.
- city-map.tsxThe drawn city map: streets, blocks, the park and the river, a pin on every bay with the cars parked there now, and every car on a trip driving its loop through the streets on the shared clock.
- clock.tsThe demo's one clock: today from 17:40, a demo minute every two seconds, so trips start and end while you watch; paused in a hidden tab, still with reduced motion.
- 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).
- 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).
- save.tsOne way every page saves: run the fake API call, put its answer in the loaded data, and say what happened in a toast (with Undo when there is one); a failed save says why and changes nothing.
- 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.
- 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-data.tsWhat most pages stand on, loaded together: the fleet, the bookings and the members, as one answer (loading, error or ready).
- 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.
- fleet.tsThe pretend fleet: 25 bays on the city map and the 80 cars parked in them, with their models, hourly rates and plans.
- ops.tsThe pretend upkeep: damage reports with their marks on the car drawing, and this week's cleaning rota per bay.
- people.tsThe pretend people: 4,000 members with their driving check, plan, trips and fines, and the cleaning crew.
- rules.tsThe rules every page and the fake API count by: a booking's state at the demo's now, a car's state and charge, trips now and today's income.
- trips.tsThe pretend bookings (yesterday to two days ahead, every car, every hour from 06:00) and the longer history the reports read.
- 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}).
carshare-indigo.tsx
The page: the sections in order.
Yükleniyor…
- Şunlar için uygun
- Car-share, car-club and fleet operators who run cars from bays across a city and book them out by the hour.
- Nasıl çalışır
- Cars on trips move along the map; open a bay and its tile grows into a timeline where you drag a booking to a new hour.
- Nasıl kullanılır
- Edit words in locales/ and colors in theme.ts, and swap the bodies in data/api.ts for calls to your backend.