docs: update project rules for demo angle modes and UI structure
This commit is contained in:
@@ -31,14 +31,33 @@
|
||||
- `sqrt`, `asin`, `acos`, `log`, and `ln` must throw clear, explicit domain errors
|
||||
- `log` uses `Math.log10`
|
||||
- `ln` uses `Math.log`
|
||||
- Trigonometric functions use degrees in the demo:
|
||||
- `sin`, `cos`, `tan` convert degrees to radians
|
||||
- inverse trig functions return degrees
|
||||
- Trigonometric functions must support `deg`, `rad`, and `grad`
|
||||
- In the browser demo, degrees are the default angle mode
|
||||
- `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 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
|
||||
|
||||
- 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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user