Lending Hazel
v1.0A neighbourhood tool library's desk app: a warm workshop bento with a return desk where cards flip back onto the shelf, live loan timers and queues.
نشانی صفحه: /
داخلی
آنچه میگیرید- روشن و تیرهاز رنگهای تم شما استفاده میکند
- دسکتاپ، تبلت، و گوشیصفحهنمایشهایی که برایشان ساخته شده
- پکیجها…
- حجم کد…
- کممصرف برای باتری30 فریم بر ثانیه، در حالت ساکن متوقف
- در حالت پنهان متوقف میشودخارج از صفحه یا تب دیگر
- کاهش حرکتآرام برای کسانی که بخواهند
با هر تغییر بررسی میشود
بررسی امنیتی 3 دسامبر- بررسی نوعTypeScript strict
- لینت و قالببندیESLint · Prettier
- تست و بیلدتصاویر روشن و تیره
- ممیزی امنیتیبدون هشدار بالا یا بحرانی
- قدمت پکیجهر نسخه حداقل 7 روز عمومی بوده
- پردازنده در حالت بیکارکمتر از نیم هسته در حالت ساکن، حداکثر 30 فریم بر ثانیه
کد
lending-hazelReact
- lending-hazel.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.
- loans.tsxLoans (#/loans): what is out, due today, late and lately returned, in tabs that live in the address; check out a tool, take one back, extend a loan or waive a fine.
- member.tsxOne member (#/members/m12): who they are and their plan, loans out against the plan's limit, and their loans, fines and queue places in tabs; check out for them, settle fines, edit or delete.
- members.tsxMembers (#/members): the 900 neighbours by plan, who borrows now and who owes a fine, as rows with their loans against the plan's limit; sign up a new one from ?new=1.
- overview.tsxThe Overview (#/): out now, due today, late, the return desk and its shelf, the most borrowed, the week, the queues and the workshop, in one bento grid. A walk-in borrows a tool every 40 seconds of the shared clock, so the desk is live.
- repairs.tsxRepairs (#/repairs): broken tools from reported to the bench (with a live bench timer) to fixed or retired, the fix log with costs, and the next step on each.
- reports.tsxReports (#/reports): loans per week, the late rate, the most-borrowed tools and the busiest shelves, over the last 4, 12 or 26 weeks (the span lives in the address).
- reservations.tsxReservations (#/reservations): every tool with a queue, its places as numbered chips, who was told it is back (with a live pick-up countdown), and add, move, notify or cancel.
- settings.tsxSettings (#/settings): the lending rules (loan length, the late fine and its grace days), the plans (how many tools at once and the yearly fee) and Appearance (style, theme, language).
- sign-in.tsxThe sign-in page (#/sign-in): the form on one card beside a pegboard panel of drawn tools, without the sidebar and top bar.
- tool.tsxOne tool (#/tools/t12): its drawing, state, deposit and who has it now, how often it goes out, and its loans, queue and repairs in tabs; check it out, reserve it, report it broken, edit, retire or delete it.
- tools.tsxThe catalogue (#/tools): all 600 tools by status and shelf, as drawn cards with their code, state, deposit and queue; filters live in the address, and a new tool opens from ?new=1.
- 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).
- checkout-dialog.tsxThe check-out dialog: find the member and the tool by typing (name or code), pick the loan length, and lend it; the plan's limit and the tool's queue are checked by the API, and its answer shows under the form.
- loan-rows.tsxA loan as a row (the Loans page, a tool's history, a member's history): the tool and who has it, when it is due (a live timer once late), its status, and Return, Extend or Waive where they fit.
- member-form.tsxThe member dialog: sign up a neighbour or edit one (name, email, phone, plan); the form checks itself and shows its own errors.
- overview-tiles.tsxThe Overview's tiles beside the return desk: tools out now (the hero, a live ring), due today, late with a ticking timer, the most borrowed, the last seven days, the queues and the workshop.
- queue-rows.tsxOne tool's queue as rows: each place a numbered chip, who waits and since when, the live pick-up countdown for the one who was told, and move up, move down, notify and cancel. Rows glide when the order changes.
- repair-rows.tsxA repair as a card (the Repairs page, a tool's Repairs tab): the issue, its stage, a live bench timer, the fix log with costs, and the next step (bench it, log a fix, back on the shelf, retire).
- return-desk.tsxThe return desk (the Overview's signature): today's due tools as cards. Scan one (click it, or type its code) and it turns over to "Back on shelf", glides into the shelf tile beside it as its newest chip, and the return saves: the loan closes, the tool is back on the shelf, the member's history gains it and the first in its queue is told.
- sidebar.tsxThe sidebar: the logo, search with the command palette shortcut, and the page links in their groups (Desk, Library, Insights), the current one on an accent pill that glides between them; 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.
- tool-dialogs.tsxThe small dialogs a tool opens: reserve it for a member, report it broken, and an in-app "are you sure" for retiring or deleting (never a browser popup).
- tool-form.tsxThe tool dialog: add a tool to the catalogue or edit one (name, what it is, its shelf, its state, the deposit); the form checks itself and shows its own errors.
- top-bar.tsxThe top bar: the menu button on narrow screens, where you are, the desk's open sign, search, the theme switch and the account menu. Plain at rest; once the page scrolls it frosts itself (blur, a ground fill and a thin bottom edge).
- 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.
- odo.tsxThe odo row motion: each row on screen rises 6px from faint while every number rolls digit by digit to its value.
- 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.
- 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 with the current one lit, a line with a soft area under it, the loans-out ring, ranked bars and a share strip; every series in a chart shade.
- clock.tsThe one shared clock every live tile reads (late timers, pickup countdowns, the bench timer, the desk's walk-ins): one tick a second, paused while the tab is hidden, the app is off screen or reduced motion is on.
- 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.
- flip.tsFLIP glides: tiles and rows that change place (a filter, a returned card leaving the desk) slide from where they were to where they are now.
- 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).
- 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.tsxThe bento pieces every page is built from: the page heading, a tile (plain, hero or one link), status chips, the live dot and the tab strip.
- toasts.tsxThe toasts: short notes that confirm what just happened, at the bottom end.
- tool-art.tsxThe drawn tool pictures: one small drawing per kind of tool (drill, ladder, tent...), in the app's ink with its body in the primary, on a soft tile.
- 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: every page loads and saves through these functions, so wiring a real backend happens here only.
- seed.tsThe pretend library: 600 tools, 900 members, loans, queues and the workshop, made by a seeded generator so every visit sees the same library.
- types.tsThe shapes the fake API answers with: tools, members, loans, the queues, repairs and the lending rules.
- views.tsThe library as the app holds it while it runs (db), and the views the pages read, worked out from it each time.
- 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}).
lending-hazel.tsx
The page: the sections in order.
در حال بارگذاری…
- مناسب برای
- Tool libraries, makerspaces and lending shelves that track loans, members, queues and repairs.
- چگونه کار میکند
- Click a card on the return desk: it flips, slides onto the shelf, due today ticks down and the member's history updates.
- نحوه استفاده
- Edit words in locales/ and colors in theme.ts, and swap the bodies in data/api.ts for calls to your backend.