Surf Swell
v1.0A sea-glass surf school desk: a glass forecast scrubber on a live wave line, a drag-and-drop lesson timetable, board rentals, surfer levels and coaches.
页面地址: /
内置
你能得到- 浅色和深色使用你的主题颜色
- 桌面端、平板和手机为这些屏幕设计
- 依赖包…
- 代码大小…
- 省电30 fps,静止时空闲
- 隐藏时暂停不在屏幕内或在其他标签页
- 减少动效尊重用户的减少动效设置
每次修改都会检查
安全检查于 12月3日- 类型检查TypeScript 严格模式
- 代码检查与格式化ESLint · Prettier
- 测试与构建浅色和深色截图
- 安全审计无高危或严重漏洞通告
- 依赖包发布时间每个版本都已公开 7 天以上
- 空闲 CPU静止时不到半个核心,≤ 30 fps
代码
surf-swellReact
- surf-swell.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.
- coach.tsxOne coach: their card, and tabs for this week's schedule, their certifications (renew, add, remove) and their ratio of surfers per group lesson.
- coaches.tsxThe coaches page: a card per coach with the levels they teach, their ratio, this week's lessons, the days they work and how their certifications stand; add a coach.
- forecast.tsxThe forecast: seven days to pick from, the tall swell scrubber for the picked day and spot, every hour in a table that follows the puck, the best windows with their calls, and how each spot compares at the puck's time.
- lesson.tsxOne lesson: its roster (add and remove surfers up to the places), details and notes in tabs, the conditions forecast for its start, and edit or delete with undo.
- lessons.tsxThe lessons page: the week as a timetable you drag lessons around in, or as a list; filters by type, level, coach and spot live in the address, so they survive Back.
- overview.tsxThe overview: today's numbers, the swell scrubber with today's call and tides, who is on the water, gear out, coaches, the week and what needs attention.
- rentals.tsxThe rentals page: stock by kind and size, what is out now (check in, overdue first), the history of returns with their takings, and the repair rack; check out and add item open their forms.
- reports.tsxThe reports page: lessons per week, rental takings and level-ups over 8, 12 or 26 weeks (the range lives in the address), lessons by coach this week and surfers by level; export the weeks as CSV.
- settings.tsxThe settings page: Appearance (style, theme and language) beside the school's own settings (name, prices, ratios) and its beach spots.
- sign-in.tsxThe sign-in page (#/sign-in): the school's tagline over a drawn swell beside the form card, over the sea-glass backdrop, without the top bar.
- surfer.tsxOne surfer: their card with the level journey, and tabs for the profile, the skills checklist (with level up once every skill of their level is ticked), their lessons and the waiver to sign.
- surfers.tsxThe surfers page: everyone with their level, next lesson, waiver and skills progress; search by name, filter by level and waiver (the filters live in the address), and add a surfer.
- 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).
- gear-dialogs.tsxThe rental forms: check out a board or wetsuit (kind, size, the first free one, who and for how long, priced from the school's prices), check one back in with any damage, and add an item to the stock.
- lesson-dialog.tsxThe lesson form in a dialog: new (from the timetable, the forecast scrubber or the palette, maybe prefilled with a day, time and spot) or edit; checks places against the coach's ratio and the coach's other lessons.
- overview-cards.tsxThe overview's lower cards: lessons on the water now, gear out, coaches today, this week's lessons, recent level-ups and what needs attention; each links to the list it sums up.
- person-dialogs.tsxThe people forms: a surfer (new or edit), a coach (new or edit, with the levels they teach and the days they work) and a coach's certification.
- school-settings.tsxThe school's own settings: its name, prices and default ratio per level in one form, and the beach spots (add, rename, remove) the forecast and lessons use.
- 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.
- swell-board.tsxThe forecast scrubber wired to the school: picking Go, Maybe or Flat saves the call for that window, and Plan lesson opens the lesson form at the hour under the puck.
- timetable.tsxThe week's timetable: seven days across, four parts of the day down; drag a lesson (or lift it with Space and the arrow keys) to another day or part, and it moves there unless its coach already teaches then.
- top-bar.tsxThe floating glass top bar: the logo, the page tabs with a frosted wave crest that rolls to the chosen one, search, the theme switch and the account menu; below the tabs' width a menu key opens the phone menu.
- 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.
- zigzag.tsThe zigzag row motion: odd rows slide in from the left, even ones from the right, 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 sea-glass mesh of four soft color clouds and a sunset glow behind the glass, with a few drawn swell lines along the bottom; dusky in dark, near-white pastel in light, drifting very slowly. With followBackground it paints your background instead.
- charts.tsxThe charts: pill bars, a glowing line and a donut, each plotted in a recessed glass well, the current bar or last point in coral.
- 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.
- drag-slots.tsDrag lessons between the timetable's slots (a day and a part of it): 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 timetable 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, a text area 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.
- glass.tsxFrosted glass panels: every card is glass with a bright fixed rim and an inset highlight (theme.ts GLASS, a plain CSS blur), the same in every browser.
- 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 rolls like a wave crest: shared by the top bar's tabs, every segmented switch 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, Motion off, live, run-once-in-view and the one shared 30 fps clock every loop draws on.
- router.tsThe page switcher: reads the app's page from the address hash (#/settings, #/?status=open).
- school.tsThe school's loads every page shares (each one key of the fake API), a helper that waits for several at once, and the rules pages count by.
- 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 small parts every page shares: the page heading, card heads, the liquid segmented switch, level and status chips, filter chips, See all links, 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.
- wave-scrubber.tsxThe swell forecast's glass time scrubber: a live wave line across the day, a glass puck that rides it as you drag (or press the arrow keys), and readouts of swell, period, wind and tide that follow; the best surf windows glow coral, brighter while the puck sits in one.
- 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.
- model.tsThe shapes the school's data comes in, the demo clock and the swell model: levels, skills, and the hourly forecast (swell, period, wind, tide) with its best surf windows.
- seed.tsThe pretend school: three beach spots, eight coaches, 42 surfers, three weeks of lessons around today, the board and wetsuit quiver, rentals and half a year of weekly totals. Dates follow today's real date.
- 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}).
surf-swell.tsx
The page: the sections in order.
正在加载…
- 适用场景
- Surf schools and board rental shacks that plan lessons around the swell, track gear by size and level surfers up.
- 工作原理
- Drag the glass puck along the wave: swell, wind and tide follow, the best window glows coral, and one tap calls it or books a lesson.
- 使用方法
- Edit words in locales/ and colors in theme.ts, and swap the bodies in data/api.ts for calls to your backend.