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

Donor Crimson

v1.0

A blood donation centre workspace in a crimson bento: eight blood-type drops fill to their days of supply and rise with a wave when a donation is logged.

$69

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

Вбудовано

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

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

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

Код

donor-crimsonReact
  • donor-crimson.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.
    • donor.tsxOne donor: their blood type, how long since their last gift against the gap between donations, their donations and next gift, then tabs for past donations, appointments and recall invites.
    • donors.tsxDonors: the donor base by blood type (a type filters the register), the register's size, who can give now and who joined this month, then the register itself with search, type and status filters kept in the address.
    • drive.tsxOne mobile drive: venue, day and progress to its target, units collected, then tabs for its crew (add or take someone off) and the bookings of its mobile session.
    • drives.tsxDrives: the next mobile drive with its countdown, units the drives brought in this month, the crew out this week and every drive, past and ahead.
    • overview.tsxOverview: the centre's day at a glance. The stock hero (eight drops), today's sessions, units collected, what is under target, new donors, donors due back and the next mobile drive.
    • recalls.tsxRecalls: donors who can give again and haven't been asked, by type with the most needed first (a type filters the list), invites sent, booked and the response, then pick donors to invite by SMS or email and follow up the invites.
    • reports.tsxReports: units collected a week over 12 or 26 weeks (the range in the address), units by blood type, new donors a month and the days of supply of all types together over 30 days.
    • session.tsxOne session: where and when with its live countdown, who has checked in and who is still to come, then tabs for the booked donors (check in, remove) and the free times (book one).
    • sessions.tsxSessions: the running or next session with its countdown, today's slots, the week's bookings and two weeks of centre and mobile sessions, filtered by kind (the filter lives in the address, so Back keeps it).
    • settings.tsxSettings: the centre's name and the days between donations (who is due back follows it), and 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 sidebar and top bar.
    • stock.tsxStock: one type's days of supply over 30 days (the type in the address), a tile per blood type with its drop, units, daily use and target, issuing units to hospitals and the latest movements in and out.
  • 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).
    • confirm-dialog.tsxAsks before a delete: what goes with it, Cancel, and the delete as a red pill that says it is working.
    • dock.tsxThe phone's bottom tab bar: a framed floating pill with the four daily pages and More (the sidebar in a sheet). Framed, so it adds nothing on scroll.
    • donor-dialog.tsxAdd or edit a donor: name, blood type, phone, email and town, each checked with its own message.
    • donor-picker.tsxA donor picker for dialogs: type a name or town, pick one of the first six matches; the picked donor shows as a row with their blood type.
    • drive-dialog.tsxAdd or edit a mobile drive: venue, town, day, times and the units it aims to collect; its mobile session follows it.
    • log-dialog.tsxLog a donation: one donor's unit (their type, and their last gift moves to today) or a session batch of one type. Saving pours into the matching drop wherever it shows; the toast can undo it. Opened from anywhere with openLog().
    • overview-tiles.tsxThe Overview's smaller tiles: today's sessions with live countdowns, units collected (today's count live, the last week as bars), the types under target, new donors, donors due back and the next mobile drive.
    • page-head.tsxWhat every page starts with: its heading and one line under it, its actions at the end; the still tiles a bento shows while it loads; and the not-found note a detail page shows.
    • session-dialogs.tsxThe session dialogs: add or edit a session (kind, place, day, times, slots) and book a donor into one of a session's free times. Both check their fields themselves and say what to fix.
    • sidebar.tsxThe sidebar: logo, search with the command palette shortcut and the page links in two groups; the current page's tinted pill glides to the link you pick. 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.
    • stock-forms.tsxThe stock forms: issue units of a type to a hospital (in its tile, so it is always one step away) and set a type's target days of supply and daily use (a dialog).
    • stock-hero.tsxThe Overview hero: the eight blood-type drops, each filled to its days of supply, with what is under target in words and the day's main action, Log donation. A drop opens the log with its type picked.
    • top-bar.tsxThe top bar: the menu button on narrow screens, where you are, search, the theme switch and the account menu. Clear at rest; once the page scrolls it frosts over what passes under it.
  • partsWhat several sections share.
    • buildWhat several sections share.
      • cardsWhat several sections share.
        • draw.tsThe draw card style: cards just fade in, and the data does the show.
      • rowsWhat several sections share.
        • avatar.tsThe avatar row motion: each row's face (data-build="face") pops first, then the row's other parts follow 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 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 latest in the primary, and a smooth line with a soft area under it; each grows or draws in as the page builds.
    • clock.tsxThe one live clock every moving tile shares: at most 30 ticks a second, only while a tile that listens is on screen and the tab is visible, and never under reduced motion (the tiles then show still values).
    • 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.
    • drop.tsxA blood-type drop: liquid filled to the type's days of supply (a full drop is 10 days) with a dashed target line. On the shared clock its surface sways gently; when a donation for its type is logged (the pour signal) the level glides up and the surface swells into a wave that settles; an urgent type's halo breathes until it passes its target. Under reduced motion it is drawn still.
    • 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 (2 columns), tablet and 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).
    • 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.
    • tabs.tsxA detail page's tab bar: one link per tab (?tab= in the address, so Back returns to it), the current one a filled pill with its count.
    • 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.
    • 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.
    • api.tsThe fake API's reads: every page loads through these functions, so wiring a real backend happens here and in data/save.ts only.
    • db.tsThe fake API's memory: the seeded centre, made on first use, plus the helpers reads and saves share (find a donor, a type's level, when a donor can give again) and the pour signal the drops listen to.
    • names.tsThe pretend region's words: first and last names (every donor a unique pair), towns, venues, hospitals and the staff.
    • save.tsThe fake API's saves: log a donation, issue units, book and check in donors, add and edit donors, sessions and drives, send recall invites and the live check-ins at today's running session.
    • seed.tsThe pretend blood centre, built once from the real date so "today" always has sessions running: 8,000 donors, two weeks of sessions either side of today, stock by type, recall invites, mobile drives and six months of collections.
    • types.tsThe shapes the fake API answers with: donors, sessions and their bookings, stock by blood type, recall invites, mobile drives and their staff.
  • 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}).

donor-crimson.tsx

The page: the sections in order.

Завантаження…
Підходить для
Blood centres and donor teams running centre and mobile sessions, stock by blood type, recalls and mobile drives.
Як це працює
Each type's drop fills to its days of supply; a logged donation pours into its drop with a gentle wave, and an urgent type pulses.
Як користуватися
Edit words in locales/ and colors in theme.ts, and swap the bodies in data/api.ts and data/save.ts for calls to your backend.