Aquarium Reef
v1.0A public aquarium's operations app on frosted glass over drifting caustic light: a reef map of breathing tank dots, water alerts, feeding rounds, animals, tickets and talks.
ที่อยู่หน้า: /
มีในตัว
สิ่งที่คุณได้รับ- สว่างและมืดใช้สีของธีมคุณ
- เดสก์ท็อป แท็บเล็ต และโทรศัพท์หน้าจอที่สร้างมารองรับ
- แพ็กเกจ…
- ขนาดโค้ด…
- ประหยัดแบตเตอรี่30 fps หยุดพักเมื่อนิ่ง
- หยุดเมื่อซ่อนอยู่นอกหน้าจอหรืออยู่แท็บอื่น
- ลดการเคลื่อนไหวสงบสำหรับผู้ที่ตั้งค่าไว้
ตรวจสอบทุกครั้งที่มีการเปลี่ยนแปลง
ตรวจสอบความปลอดภัย 3 ธ.ค.- ตรวจสอบไทป์TypeScript แบบ strict
- Lint และฟอร์แมตESLint · Prettier
- ทดสอบและบิลด์ภาพหน้าจอโหมดสว่างและมืด
- ตรวจสอบความปลอดภัยไม่มีคำเตือนระดับสูงหรือวิกฤต
- อายุแพ็กเกจทุกเวอร์ชันเผยแพร่มาแล้วอย่างน้อย 7 วัน
- CPU ขณะว่างต่ำกว่าครึ่งคอร์ขณะพัก ≤ 30 fps
โค้ด
aquarium-reefReact
- aquarium-reef.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.
- animal.tsxOne animal's record (#/animals/an101): tabs in the address for its record, its health notes (add and delete) and its births, arrivals and moves (add; a move changes its tank).
- animals.tsxThe animals: every individual and group in a table filtered by health and a search (both in the address), beside the season's births and arrivals, who is in care and the animals by zone.
- feeding.tsxFeeding rounds: pick a round and an aquarist (both in the address), tick each tank done or skip it with a reason, reorder the walk; beside it today's rounds and the food per round, and the daily schedule to edit below.
- overview.tsxThe overview: four numbers, the reef map beside the round to walk now, then the visitor flow, the water alerts with the tanks close to a limit, and today's keeper talks.
- reports.tsxReports for 7, 30 or 90 days (the range lives in the address): visitors per day, water readings out of range by day, parameter and tank, and the food used; Export CSV downloads the daily numbers.
- settings.tsxThe settings page: Appearance (style, theme and language) beside the water limits, the safe range of each parameter for each kind of water.
- sign-in.tsxThe sign-in page (#/sign-in): the form on a glass card beside a porthole onto the aquarium (its zones as breathing beads, three facts and a line about the day), without the header.
- tank.tsxOne tank's record (#/tanks/r06): its health, then tabs in the address (?tab=): an overview (latest reading, facts, feeds, animals), readings, feeding, animals and life support; edit and delete sit in the head.
- tanks.tsxThe tanks: every tank as a card with its health, last reading and keeper, filtered by zone, health and a search that all live in the address (so Back keeps them).
- team.tsxThe team: cover by zone and shift, today's rounds by keeper, then a card for each aquarist with edit and remove; Add aquarist opens the same form.
- visitors.tsxTickets and talks: today's numbers, the half-hour entry slots (tap one to set its capacity), the keeper talks with seat booking, and the bookings with check-in, edit and cancel. The search lives in the address.
- water.tsxWater quality: one parameter's 14-day trend for a tank in a recessed well, the alert queue to acknowledge or resolve, and the last three days of readings with edit and delete. The tank and parameter live in the address.
- 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.
- animal-form.tsxThe new-animal and edit-record dialog: an individual or a group, its species, tank, sex, origin and health.
- 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).
- feed-form.tsxThe new-feed and edit-feed dialog: which tank, which round, what food, how much and who feeds it.
- header.tsxThe header: one full-width frosted band like the surface of a tank. The brand, the zones' health beads, opening hours and the account sit on top; below, the page bubbles float on a drawn water line and a liquid bubble glides to the current page. On narrow screens the bubbles move into the phone sheet.
- reading-form.tsxThe log-a-reading dialog: pick a tank, type the four values, and each one flags itself the moment it leaves the tank's safe range.
- 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.
- tank-form.tsxThe new-tank and edit-tank dialog: name, zone, volume, what is on show and its keeper.
- tank-tabs.tsxThe tank record's tabs: its latest reading and facts, the 30-day readings, its daily feeds, its animals and its life support units.
- visitor-forms.tsxThe visitor dialogs: a booking (name, entry time, party, ticket kind), a keeper talk (title, time, keeper, tank, length, seats) and an entry slot's capacity.
- 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.
- spot.tsThe spot row motion: each row on screen lights up from faint as a soft primary glow passes it.
- 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 water clouds behind the glass (deep and dusky in dark, pale lagoon in light), a light shaft from the surface and two nets of caustic light drifting across each other. With followBackground it paints your background instead.
- charts.tsxThe two charts: rounded pill bars and a glowing line, each plotted in a recessed glass well, the current bar or newest point in the accent, axis text flat and readable.
- 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 bubble of water: shared by the nav bubble on the water line, every segmented control and tab row.
- 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.
- reef-map.tsxThe reef map: a drawn top-down plan of the aquarium's five zones joined by the visitor walkway, with every tank as a health dot that breathes; hover or focus a dot for its card, click it for the tank.
- 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 builds with: glass panels, the liquid segmented control and tab row, page and card heads, health dots, stat cards, a sparkline, a fill meter, a confirm dialog and the save helper.
- 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 through these functions (saves are in data/save.ts), so wiring a real backend happens here only.
- db.tsThe fake API's memory: copies of the pretend data that saves change, and the rules every page counts by (a tank's health, which readings raise an alert, who is inside). Only data/api.ts and data/save.ts read it.
- history.tsThe pretend past: 90 days of water readings for every tank, visitors per day and food used per day, made once from a fixed seed so every visit sees the same numbers.
- save.tsThe fake API's saves: every create, edit, delete and tick goes through here (a short wait, like a network call). Swap each body for a call to your backend.
- seed-life.tsThe pretend animals with their health notes and events, and the feeding schedule with today's ticks. Pages load them through data/api.ts.
- seed-visits.tsThe pretend visitor side of today: the keeper talks, the timed-entry slots and the bookings. Pages load them through data/api.ts.
- seed.tsThe pretend aquarium: zones, tanks with their life support, the aquarists, the water limits and today's clock. Pages never read this file; they load through data/api.ts.
- 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}).
aquarium-reef.tsx
The page: the sections in order.
กำลังโหลด…
- เหมาะสำหรับ
- Aquariums, zoos, marine centres and any team that checks many tanks, feeds on rounds and runs timed visitor entry.
- ทำงานอย่างไร
- A frosted water-line header with bubble tabs over moving caustics; tank dots breathe by health and ticked feeds send a ripple.
- วิธีใช้
- 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.