Optics Iris
v1.0An optician's practice app in violet-blue glass with a teal accent, where a frosted trial lens over a drawn eye chart sharpens the letters as you turn the dials.
Alamat halaman: /
Sudah termasuk
Yang Anda dapat- Terang dan gelapMemakai warna tema Anda
- Desktop, tablet, dan ponselLayar yang didukung
- Paket…
- Ukuran kode…
- Hemat baterai30 fps, diam saat tidak bergerak
- Berhenti saat tersembunyiDi luar layar atau tab lain
- Kurangi gerakanTenang bagi yang memintanya
Dicek di setiap perubahan
Keamanan dicek 3 Des- Pengecekan tipeTypeScript strict
- Lint dan formatESLint · Prettier
- Tes dan buildTangkapan layar terang dan gelap
- Audit keamananTanpa advisori tinggi atau kritis
- Usia paketSetiap versi sudah publik 7+ hari
- CPU saat diamDi bawah setengah core saat diam, ≤ 30 fps
Kode
optics-irisReact
- optics-iris.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.
- appointments.tsxAppointments: one day of the book as a room grid (test room 1, test room 2, the fitting bay) with a line at now, the week's days to switch between and a filter by optometrist; on phones a list by time.
- frames.tsxFrames: the frame wall as cards, each with its shape drawn in its colour, its size, price, what sold in 30 days and the stock to nudge up or down; filters by brand, shape, colour, size and price survive Back.
- orders.tsxLens orders: a board of five stages from ordered to collected; drag a card to its next stage (or Space, the arrow keys and Space again), or use its Move key; every move saves.
- overview.tsxOverview: today's numbers, the lens dial with the patient in the chair, today's book, orders ready to collect, frames running low and this week's tests.
- patient.tsxOne patient: who they are and when they're due, then tabs for their prescriptions (with the sphere over the years), the lens dial to refract them, their lens orders, visits and profile.
- patients.tsxPatients: everyone on the books with their age, last test, latest prescription, recall and open orders; search and a filter that survive Back, and a new patient form.
- recalls.tsxRecalls: who is due a test (overdue, this month, next month) with a text or email reminder, a booking or a month's snooze each, and the log of reminders sent.
- reports.tsxReports: eye tests per week, frame sales by brand, the lens mix and how many days the labs take from order to arrival, over 12 or 26 weeks.
- settings.tsxSettings: the practice's rules (recall interval, when a frame counts as low, how long an eye test takes), the team and rooms, and Appearance (style, theme and language).
- sign-in.tsxThe sign-in page (#/sign-in): a frosted card over the backdrop with the logo, a line about the app and the form, without the lens nav 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).
- appt-dialog.tsxThe booking form: who, what, with which optometrist, in which room and when; a booking that overlaps another in the same room is refused with its own error.
- frame-dialog.tsxThe frame form: brand and model, shape and colour, the three sizes, price and how many are on the wall; a frame can be deleted after a confirm.
- lens-nav.tsxThe lens nav: a centered floating glass pill whose links are a row of lenses joined by little bridges, the current one under a tinted lens that slides on the liquid spring; on phones a glass dock at the bottom with More for the rest.
- order-dialog.tsxThe lens order form: the patient, a frame off the wall, the lens and its coatings, the lab, when it's due and the price; an open order can change stage or be deleted.
- patient-dialog.tsxThe patient form (name, birth date, contact and notes) and the prescription form (both eyes' sphere, cylinder, axis and add, the pupil distance), each with its own errors.
- 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 brand, the lens nav in the middle, search, the theme switch and the account menu; once the page scrolls the bar frosts itself.
- partsWhat several sections share.
- buildWhat several sections share.
- cardsWhat several sections share.
- text.tsThe text card style: cards fade in while titles, labels and numbers (data-build="text") slide up from behind a mask; numbers show their final text.
- rowsWhat several sections share.
- center.tsThe center row motion: the middle row on screen rises first, then the ripple spreads up and down.
- 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 four soft colour clouds leaning violet-blue with a teal turn, dusky in dark and pastel in light, drifting very slowly, with the faint rings of a lens in one corner. With followBackground it paints your background instead.
- charts.tsxThe charts, each plotted in a recessed glass well: pill bars with a soft rim (the current one in the primary), a glowing line with a guide to its last point, a donut and labelled meter bars. Every colour is a chart shade, so presets and your Chart Studio recolor them.
- chips.tsxThe small chips rows share: a booking's status and an order's stage, each with its own mark and words, so a state never rests on colour alone.
- command-palette.tsxThe command palette (⌘K or Ctrl K): type to find a page or an action, then Enter.
- confirm.tsxThe keys under every form (Save, Cancel and Delete) and the in-app confirm a delete asks first; never the browser's own confirm.
- dial-knob.tsxA round glass knob for the lens dial: turn it by dragging around it, the mouse wheel or the arrow keys; each notch is one step (a quarter dioptre, five degrees).
- 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-lanes.tsDrag cards between ordered lanes (a tech's stops, a repair stage): mouse and pen at once, touch after a short press (a swipe still scrolls), the lifted copy kept under the grab point, the others sliding aside (FLIP), the page and the board scrolling near their edges, Escape to cancel, and a keyboard path (Space lifts, arrows move, Space drops).
- 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."), plus money, clock times and dioptres.
- glass.tsxThe glass pieces every page is built from: a panel (frosted or flat), the page's title row, a KPI tile, a card heading with its See all key, and a segmented switch whose tinted lens slides on the liquid spring.
- icons.tsxThe logo (an iris inside a lens) 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).
- lens-dial.tsxThe lens dial: a drawn eye chart as the patient sees it, a frosted trial lens you drag over it, and sphere, cylinder and axis knobs; the letters under the lens spring from blurry to sharp as the lens nears what the eye needs. Save writes the prescription to the patient's record and finishes their test.
- liquid-marker.tsThe selected marker that moves like a drop of liquid: shared by every segmented control, tab row and the tinted lens of the nav.
- 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).
- rx.tsPrescription maths for the lens dial: how far a trial lens is from what the eye needs, as the blur the letters show, and the chart line the eye reads to.
- 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 glass panel that rises from the bottom with the pages the dock has no room for; Escape, a tap outside or its close button lets it go.
- 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 (above the dock on phones).
- 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-save.tsThe fake API's saves: book, move and finish appointments, keep patients and prescriptions, the frame wall, lens orders through their stages, recall reminders and the practice settings. Each waits like a network call while Slow network is on; swap the bodies for your backend.
- api.tsThe fake API: every page loads through these functions (saves are in data/api-save.ts), so wiring a real backend happens here only.
- dates.tsThe demo's clock: today is the real date, the time is pinned to 10:40 so the day book is full at any hour, and days are ISO dates ("2026-11-29").
- db.tsThe fake API's memory and its rules: what is due for recall, what is low on the wall, a patient's latest prescription. data/api.ts reads through these and data/api-save.ts writes to `db`; swap both for your backend.
- seed-book.tsThe pretend day book and history: two weeks back and two ahead of appointments (today full at the pinned 10:40), each patient's past prescriptions, lens orders in every stage, frame sales and the weekly history the reports draw.
- seed.tsThe pretend practice: two optometrists, forty patients with what their eyes need today, the frame wall and the practice settings. Dates count back from today (data/dates.ts), so the demo always looks current.
- types.tsThe shapes the fake API answers with: patients and their prescriptions, the day book, frames, lens orders, recalls and the practice'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}).
optics-iris.tsx
The page: the sections in order.
Memuat…
- Cocok untuk
- An independent optician with two optometrists: eye tests by room, patients and prescriptions, the frame wall, lens orders and recalls.
- Cara kerjanya
- Drag the lens over the chart and turn sphere and cylinder until the letters spring sharp, then save the prescription to the patient.
- Cara memakai
- Edit words in locales/, the brand in content.ts and colors in theme.ts, and swap the bodies in data/api.ts for calls to your backend.