Water Rill
v1.0A home water app on a pale aqua bento: live flow per room, leak alerts, rain-aware garden zones and a rain tank whose water line you drag.
ที่อยู่หน้า: /
มีในตัว
สิ่งที่คุณได้รับ- สว่างและมืดใช้สีของธีมคุณ
- เดสก์ท็อป แท็บเล็ต และโทรศัพท์หน้าจอที่สร้างมารองรับ
- แพ็กเกจ…
- ขนาดโค้ด…
- ประหยัดแบตเตอรี่30 fps หยุดพักเมื่อนิ่ง
- หยุดเมื่อซ่อนอยู่นอกหน้าจอหรืออยู่แท็บอื่น
- ลดการเคลื่อนไหวสงบสำหรับผู้ที่ตั้งค่าไว้
ตรวจสอบทุกครั้งที่มีการเปลี่ยนแปลง
ตรวจสอบความปลอดภัย 3 ธ.ค.- ตรวจสอบไทป์TypeScript แบบ strict
- Lint และฟอร์แมตESLint · Prettier
- ทดสอบและบิลด์ภาพหน้าจอโหมดสว่างและมืด
- ตรวจสอบความปลอดภัยไม่มีคำเตือนระดับสูงหรือวิกฤต
- อายุแพ็กเกจทุกเวอร์ชันเผยแพร่มาแล้วอย่างน้อย 7 วัน
- CPU ขณะว่างต่ำกว่าครึ่งคอร์ขณะพัก ≤ 30 fps
โค้ด
water-rillReact
- water-rill.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.
- budget.tsxBudget (#/budget): this month's bill estimate against the target (live with today's litres), every day of the month so far, the target (?target=1 to change it), the tariff, the days left with what each may use, the pace, and the bills (add, edit, mark paid, delete with Undo; ?bill=new or an id).
- irrigation.tsxIrrigation (#/irrigation): the zone watering now with its countdown (or the next round and Run now), the rain rule and forecast, what skips this week, the garden's water and rain, and every zone with its switch, Run now and Stop. A zone opens its page (#/irrigation/<id>; new: #/irrigation/new).
- leak.tsxOne leak (#/leaks/<id>): what it is and what it has cost, mark it fixed, snooze or reopen it, edit or delete it, and its timeline and notes (?tab=notes).
- leaks.tsxLeaks (#/leaks): the leak running now with its litres lost counting up, the year's losses, the night test, what is being watched, what got fixed, and every leak filtered by status. ?new=1 opens Report a leak. A leak opens its own page (#/leaks/<id>).
- live.tsxLive use (#/live): the whole house's flow as it happens, every room's flow and litres today, the taps running now and today's busiest hour. A room opens its own page (#/live/<room>).
- overview-more.tsxThe Overview's lower tiles: the week, the bill, the rain ahead, the busiest room and last year.
- overview.tsxOverview (#/): the house at a glance as a bento: the live flow, the rain tank whose line you drag, today's litres, leaks, the next watering, the week, the bill, the rain, the busiest room and last year.
- reports.tsxReports (#/reports): litres per day over 7, 30 or 90 days (?range=; the bars morph), each room's share, the year by month, the busiest and quietest day and the daily average, all against last year with ?compare=year, and Export CSV.
- room.tsxOne room (#/live/<room>): its flow now, today's litres and share, its taps (add, edit, remove, rename the room) and, on the Week tab, its last 14 days.
- settings.tsxSettings (#/settings): the household (name, people, tariff, fixed charge, tank size, roof area, leak alert sensitivity and alerts) and Appearance (style, theme and language).
- sign-in.tsxThe sign-in page (#/sign-in): the form on a card beside a quiet panel with the house's water today, without the sidebar and top bar.
- tank.tsxRain tank (#/tank): the tank with its draggable floor and the zones it feeds, the level now, rain caught, days of garden water left, how much of the garden runs on rain, and the tank's log with Log a reading (?log=1).
- zone.tsxOne garden zone (#/irrigation/<id>, or new): its schedule as a form (name, plants, kind, rate, minutes, days, start, water source), Run now, delete with Undo, and its past runs (?tab=runs).
- 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).
- figures.tsSums the pages share: this month's bill estimate against the budget, and the days of history added up by room.
- sidebar.tsxThe sidebar: logo, search with the command palette shortcut, and the page links (Leaks opens to its filters); the current page sits on an accent pill that glides to the next one. 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.
- tank-tile.tsxThe signature tile: the rain tank beside the garden zones that draw from it. Drag the dashed line and the zones that would take the tank below it grey out as you go; let go and the floor saves, with Undo.
- top-bar.tsxThe top bar: the menu button on narrow screens, where you are, pause or resume the live meter, search, the theme switch and the account menu. At the top of the page it has no fill; once the page scrolls it frosts over what passes under it.
- partsWhat several sections share.
- buildWhat several sections share.
- cardsWhat several sections share.
- sheen.tsThe sheen card style: cards rise, plus one soft light sweep across each card as it lands.
- 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.
- bar-chart.tsxA bar chart: bars grow in, and the picked bar (in the primary), its guide line and tooltip glide to the bar you point at or pick with the arrow keys; a new range morphs the bars instead of drawing them again.
- command-palette.tsxThe command palette (⌘K or Ctrl K): type to find a page or an action, then Enter.
- csv.tsExport CSV: turns rows into a CSV file and hands it to the browser to save.
- 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 L", "1.240 L"; "Nov 19", "19 nov."), litres, flow, euros and times.
- 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).
- line-chart.tsxA line chart with a soft area under it, in the primary: the line draws itself in, the latest point marked, and new values roll the line to its new shape.
- live-bits.tsxThe live readings several pages show: today's litres counting up as water runs, the flow right now, and each room's flow as a bar.
- 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.
- popover.tsxA menu that unfolds from its button (a row's actions, the alerts, a sort pick): drawn in the window layer so no table or card clips it; arrow keys walk it, Escape, Tab, a click outside or a scroll folds it away, and it plays its way out unless motion is reduced.
- pulse.tsThe one shared clock for everything live: at most 30 frames a second, a meter step every second, and only while a live tile is on screen, the tab is visible, live isn't paused and motion is allowed.
- 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.
- tank.tsxThe rain tank, drawn: water with a live rippling surface and a dashed line you drag (or move with the arrow keys) to set how low the garden may draw it; the surface waves while you drag and settles after.
- 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 tile (one idea, one heading), the page heading, pill tabs, the live flow line, small bars, a ring, a meter and a status chip.
- 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: every page loads and saves through these functions, so wiring a real backend happens here only.
- live.tsThe pretend smart meter: every second a loop of taps opens and closes (a shower, the kitchen sink, a toilet filling, the washer), plus a running leak and a garden zone when one runs. data/api.ts steps it and reads it.
- seed.tsThe pretend house the app shows: rooms and their taps, leaks, garden zones, the rain tank, the budget and bills, and 90 days of use with last year's beside it. Dates are counted back from today, so the demo is always current.
- 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}).
water-rill.tsx
The page: the sections in order.
กำลังโหลด…
- เหมาะสำหรับ
- Smart-meter, irrigation and home utility apps: live use, leaks, garden zones, a rain tank, a bill budget and reports.
- ทำงานอย่างไร
- Litres count up, the flow line glides and the tank ripples; drag the tank's line and zones that would skip grey out, then it saves.
- วิธีใช้
- Edit words in locales/ and colors in theme.ts, and swap the bodies in data/api.ts for calls to your meter and controller.