Skip to content

Redesign the calculator as a hotel at night - #15

Merged
alihdrndm merged 2 commits into
mainfrom
feat/calculator-redesign
Oct 8, 2026
Merged

alihdrndm merged 2 commits into
mainfrom
feat/calculator-redesign

Conversation

@alihdrndm

Copy link
Copy Markdown
Owner

What

The browser calculator now looks like it belongs to its subject instead of a plain form.

  • The block as a hotel at night. One tower per night, one window per room: amber for booked, coral for rooms short of that night's minimum, outlined for rooms the hotel resold, dark for rooms allowed to stay empty, and a mint line at the minimum. Big blocks scale to a few rooms per window, with a note. It has a text alternative for screen readers and a night-by-night table.
  • The two bills as hotel folios, side by side, with the per-night bill itemising each short night and the higher one stamped.
  • Live results. It recalculates on every keystroke and opens on the worked example, so the first view is a real block.
  • Bundled font (Bricolage Grotesque via Fontsource), so the page still makes no third-party requests.

Fix

Changing the number of nights and then clicking into a night used to rebuild the table on blur and drop what you typed. The table is now only rebuilt when the dates change.

Checks

  • Lint, typecheck, the 5 calculator tests and the build pass.
  • Checked in a browser at 1440 px and 390 px: no horizontal scroll on the phone, worked example still gives $975.60 and $1,528.80, resell credit, a 12-night block with a 250-room night, and an invalid currency.

Draws the block as one tower per night with a lit window per booked room
and coral windows for the nightly shortfall, shows the two bills as hotel
folios, and recalculates as you type. Bundles Bricolage Grotesque so the
page still makes no third-party requests.

Also stops the nights table from being rebuilt when the night count only
loses focus, which replaced the input being clicked.
@alihdrndm
alihdrndm merged commit 0cb3834 into main Oct 8, 2026
8 checks passed
@alihdrndm
alihdrndm deleted the feat/calculator-redesign branch October 8, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant