Some checks failed
Deploy to GitHub Pages / build-and-deploy (push) Has been cancelled
2.1 KiB
2.1 KiB
Quickstart: Geek Calculator
Running the Calculator
- Open
index.htmlin any modern web browser - The calculator will load with a dark terminal-themed UI
- Begin typing calculations or use mouse/touch to operate
Basic Operations
- Addition:
5 + 3 =→ displays8 - Subtraction:
10 - 4 =→ displays6 - Multiplication:
6 * 7 =→ displays42 - Division:
15 / 3 =→ displays5 - Parentheses:
(2 + 3) * 4 =→ displays20 - Percentage:
100 + 10% =→ displays110 - Sign Toggle: Enter number then press
±or+/-button
RPN Mode
- Toggle RPN mode using the RPN button
- Enter numbers followed by operators
- Example: To calculate
4 + 6:4 ENTER 6 + - Use
ENTERto push numbers onto the RPN stack - Available operations:
+,-,*,/
Keyboard Controls
- Numbers: 0-9 keys
- Operators:
+,-,*,/keys - Equals:
=orEnterkey - Clear:
EscapeorCkey - All Clear:
Shift + CorDouble Escape - Decimal Point:
.key - Backspace:
Backspacekey - RPN Enter:
Enterkey in RPN mode - Toggle RPN:
Rkey - Command Palette:
@key - History:
↑and↓arrow keys - Help/Shortcuts:
?key
Command Palette
- Press
@to open the command palette - Type commands like "clear", "history", "theme", etc.
- Provides quick access to calculator functions
History Feature
- Previous calculations appear in history panel
- Use
↑and↓arrow keys to navigate - Click on history items to re-run calculations
- Limited to 50 most recent entries
Accessibility Features
- Full keyboard navigation
- ARIA labels on all controls
- High contrast mode
- Screen reader compatible
- Visible focus indicators
Troubleshooting
- If you see "Error", check your expression syntax
- For division by zero, the result will show "Infinity"
- If calculator doesn't respond, try clearing with
Escape - For offline use, ensure service worker is enabled in your browser
Testing
- Unit tests for core math operations: Run
tests/index.htmlin browser - Tests cover basic arithmetic, RPN operations, and error conditions