Meds

A phone app that shows when each dose is next. This is the real app, running in your browser. Hold a tile, drag the hours, and move the clock.

Sample only. The names on this page are invented, and they are not real medicines. This page is not medical advice. Everything stays in your browser.

The app, its clock and its state machine

  1. Press and hold a tile to open it.
  2. Drag the hours sideways, then let go.
  3. Press and hold the hours to close it.

The app reads this clock. The schedule code gives each result.

Tile
Next dose of nextDose() Doses each day dosesInDay():

The app does not record a dose that you take. It only shows the next time, so the first button moves the clock to that time.

The state machine of

The real XState machine. The app gives each tile its own actor. The lit box is the state of that actor now.

Send an event

    The day

    Each dot is a result of dosesInDay() for the offset in the database. Drag a wheel, and the dots of that item move.

    How it works

    The page builds the source of packages/app with no change. react-native-web draws the components of React Native.

    The real code

    What the page replaces

    • The item list. The page uses five invented names.
    • The clock. The slider gives the app its time, so you can see any hour of the day.
    • The screen size. The app reads the size of the phone frame, not of your window.
    • Haptics and the glass effect. A browser has neither, so the tiles are plain and the buzz does nothing.

    The app starts from its list each time. A reload does the same here, so a reload puts the hours back. The page sends nothing to a server.