docs: update project rules for demo angle modes and UI structure

This commit is contained in:
2026-04-25 01:23:51 +02:00
parent f30bdb9946
commit 4ef19b1339
+22 -3
View File
@@ -31,14 +31,33 @@
- `sqrt`, `asin`, `acos`, `log`, and `ln` must throw clear, explicit domain errors - `sqrt`, `asin`, `acos`, `log`, and `ln` must throw clear, explicit domain errors
- `log` uses `Math.log10` - `log` uses `Math.log10`
- `ln` uses `Math.log` - `ln` uses `Math.log`
- Trigonometric functions use degrees in the demo: - Trigonometric functions must support `deg`, `rad`, and `grad`
- `sin`, `cos`, `tan` convert degrees to radians - In the browser demo, degrees are the default angle mode
- inverse trig functions return degrees
- `inputValue` must remain a string to preserve future hexadecimal input support - `inputValue` must remain a string to preserve future hexadecimal input support
## Demo rules
- The browser demo lives under `samples/dev/`
- `samples/dev/index.html` is the demo entry page
- `samples/dev/index.css` contains the calculator visual theme
- `samples/dev/index.js` contains demo-side presentation helpers and UI logic
- The demo UI must expose:
- a stack display
- a main display
- a visible angle mode indicator
- an angle mode selector for `deg`, `rad`, and `grad`
- The demo may present user-facing labels such as `+`, ``, `×`, `÷`, `y^x`, `1/x`, and `x²` while still using English command identifiers internally
- The example HTML must group buttons by `Stack`, `Arithmetic`, and `Trigonometry` - The example HTML must group buttons by `Stack`, `Arithmetic`, and `Trigonometry`
- The example HTML must call `command(...)` for actions - The example HTML must call `command(...)` for actions
- Keyboard support in the demo should remain consistent with the displayed help text
## File references
- `samples/dev/index.html` references `src/rpn-calculator.js` as the calculator engine used by the demo
- Keep the demo aligned with the public calculator API exposed by `src/rpn-calculator.js`
## Maintenance ## Maintenance
- Keep this file updated after each project change using the provided editing tools. - Keep this file updated after each project change using the provided editing tools.
- When changing the demo UI or calculator API, update these rules so they continue to match the current project behavior.