Museum Vitrine
v1.0A city museum's front-of-house and collection app in frosted gallery glass: timed tickets filling live from the door, objects in tilting glass cases you drag between galleries.
Адрес страницы: /
Уже внутри
Что вы получаете- Светлая и тёмнаяБерёт цвета вашей темы
- ПК, планшет и телефонЭкраны, для которых сделано
- Пакеты…
- Размер кода…
- Бережёт батарею30 кадров/с, в покое простаивает
- Пауза в фонеВне экрана или в другой вкладке
- Меньше анимацииСпокойно для тех, кто просит
Проверяется при каждом изменении
Безопасность проверена 3 дек.- Проверка типовСтрогий TypeScript
- Линтер и форматESLint · Prettier
- Тесты и сборкаСкриншоты в светлой и тёмной теме
- Аудит безопасностиНет уязвимостей высокого и критического уровня
- Возраст пакетовКаждая версия опубликована 7+ дней назад
- Загрузка в покоеМеньше половины ядра в покое, ≤ 30 кадров/с
Код
museum-vitrineReact
- museum-vitrine.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.
- exhibitions.tsxExhibitions: the shows on now, coming and closed, each with its dates, galleries and how far through its run it is; one exhibition's page shows its objects in their cases and the loans it rests on.
- home.tsxThe overview: who is in the building now, today's entry slots filling live from the door, the four galleries, loans that arrive or leave soon, today's tours and three objects in their cases.
- loans.tsxLoans: what the museum borrows and lends, by direction and step (requested, agreed, in transit, on site, returned), with the insured value on loan; one loan's page walks it to its next step.
- object.tsxOne object: its case, the record (accession, material, where it stands, value, the exhibitions it is in) with a move to any gallery, its condition reports with a new one, and every move it has made.
- objects.tsxThe collection: every catalogued object in its glass case (or as a list), found by words, gallery and condition; drag a case onto a gallery in the dock (or press its handle and use the arrows) to move the object there, with Undo.
- reports.tsxReports: visitors per day over a week, a month or a quarter, the busiest day and slot, the weekday-by-slot heatmap, the ticket mix and which galleries draw the most feet.
- settings.tsxThe settings page: the museum (its name, opening hours, people per entry slot and how long a visit lasts) and Appearance (style, theme and language).
- sign-in.tsxThe sign-in page (#/sign-in): the form on a glass card beside an astrolabe in its lit case, over the gallery backdrop, without the top bar.
- tickets.tsxTickets: a week of timed-entry days; per day its slots (sold, scanned and free, sell into one), its orders (find one by code or buyer, scan, move, refund) and the ticket types with their prices.
- tours.tsxTours: the week's guided tours by day (time, group, guide, language, galleries; book, change, cancel or remove one) and the guides with the languages they lead in.
- 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).
- exhibition-form.tsxThe exhibition form: title, curator, the dates it runs, the galleries it fills, a line about it and the objects it shows.
- loan-form.tsxThe loan form: in or out, which object, the other museum and its contact, the dates, the insured value, a courier, and the exhibition it serves.
- object-form.tsxThe object form, to catalogue a new object or edit one: title, maker and date, kind and material, where it stands, its condition, accession number and insured value.
- sidebar.tsxThe page list in the menu sheet (narrower screens): the logo, search with the command palette shortcut, every page with its icon, and the museum's name at the foot.
- 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-dialogs.tsxThe ticket desk's dialogs: sell tickets for a slot (the total adds up as you count), scan a code at the door (the groups waiting are one tap away), change an order's buyer or slot, and add or edit a ticket type.
- top-bar.tsxThe top bar, framed like a display case: the logo, the pages under a glass bead (a menu key on narrower screens), how many people are in now, search, the theme switch and the account menu; under a hairline, the case label: today, opening hours and the slot entering now.
- tour-forms.tsxThe tour and guide forms: book a tour (day, time, guide, group, size, language, kind, galleries), and add or edit a guide with the languages they speak.
- partsWhat several sections share.
- buildWhat several sections share.
- cardsWhat several sections share.
- spotlight.tsThe spotlight card style: the page shows dim, then each card lights up in turn, 50ms apart, with a brief primary edge.
- rowsWhat several sections share.
- unfold.tsThe unfold row motion: each row on screen opens down from its top edge, 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 soft stone and teal clouds under a gallery skylight, dusky in dark and near-white in light, drifting very slowly for half an hour, then still. With followBackground it paints your background instead.
- case-drag.tsDrag a vitrine case onto a gallery dock to move its object there: mouse and pen at once, touch after a short press (a swipe still scrolls), the lifted copy kept under the grab point 1:1, gliding into the dock it lands on (or back home), the page scrolling near its edges, Escape to cancel, and a keyboard path on each case's handle (Space lifts, arrows pick a dock, Space drops).
- charts.tsxThe charts: the day's entry slots as pill bars in a glass well (sold in bronze, scanned in teal, filling as people come through the door, the slot entering now aglow), a line of visitors per day with a hover readout, and the week-by-slot heatmap of the busiest times.
- 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).
- liquid-marker.tsThe selected marker that moves like a drop of liquid: shared by the top bar's nav bead and every segmented control and tab row.
- live-scans.tsxThe door, live: every few seconds the next ticket is scanned (the demo's pretend visitors), the slot bars fill and "in now" rolls up. It runs only while its card is on screen and the tab is shown, and the Pause key stops it for good.
- 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.
- object-art.tsxThe drawn objects that stand in the cases (no photos): an amphora, a bust, a framed painting, a coin, a mask, an astrolabe, a bracket clock and a chair, each lit from above with a soft floor shadow. Colors come from the theme: gilt is a turn of the primary, stone and bronze are mixed from the tint.
- 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 shared pieces every page is built from: glass panels, the segmented switch with its liquid bead, card heads, "See all" keys, status chips, meters, page heads and the confirm dialog.
- 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.
- vitrine-case.tsxAn object in its glass case: the drawn object under a ceiling light, a pane that tilts toward the pointer and catches a light band that glides with it, settling back on a soft spring, and the wall label on the plinth (title, maker, date, accession, condition). The case is the handle of the move-by-drag (parts/case-drag.ts).
- 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.
- clock.tsThe demo's "now": today's real date with the clock pinned at 11:20, mid-morning, so today always has visitors in the building, slots filling and some still to come.
- collection.tsThe pretend collection of the Halden City Museum: four galleries, the catalogued objects on show and in store, the exhibitions and the loans in and out.
- types.tsThe shapes the fake API answers with: galleries, objects, exhibitions, loans, tickets, orders, tours and guides.
- visits.tsThe pretend visitor side: ticket types, today's and the coming week's orders per timed slot, guides and tours, and the visitor history the reports draw.
- 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}).
museum-vitrine.tsx
The page: the sections in order.
Загрузка…
- Подходит для
- Museums and galleries that sell timed entry, run exhibitions and tours, and track objects, loans and their condition.
- Как это работает
- Ticket scans fill the slot bars live; each object stands in a glass case that tilts toward you and moves gallery when dropped on the dock.
- Как использовать
- Edit words in locales/ and colors in theme.ts, and swap the bodies in data/api.ts for calls to your backend.