Welcome to the On-Screen Calculator project! This project is an implementation of a calculator using JavaScript, HTML, and CSS. It allows users to perform basic arithmetic operations conveniently on a web page.
- Basic Operations: Addition, Subtraction, Multiplication, and Division.
- Decimal Point: Users can input decimal numbers.
- Backspace: Undo the last input.
- Keyboard Support: Full support for keyboard input (numbers, operators, decimal point, backspace, clear, and equals).
- Clear Button: Resets the calculator to its initial state.
- Error Handling: Displays error messages for division by zero.
- Responsive Design: Simple and clean layout designed for easy use on different devices.
To run the calculator locally on your machine, follow these steps:
-
Clone the repository:
git clone https://github.com/your-username/on-screen-calculator.git cd on-screen-calculator
-
Open
index.html
in your web browser. -
Calculator Interface:
- Use mouse clicks or keyboard inputs to interact with the calculator.
- Click on number buttons to input numbers.
- Click on operator buttons (
+
,-
,*
,/
) to select an operation. - Use the decimal button (
.
) to input decimal points. - Click on the equals button (
=
) or press Enter to compute the result. - Press the clear button (
Clear
) to reset the calculator.
-
Keyboard Shortcuts:
- Use numeric keys (0-9) for numbers.
- Use operator keys (
+
,-
,*
,/
) for operations. - Use the decimal key (
.
) for decimal points. - Use the Enter key for equals (
=
). - Use the Escape key for clear (
Clear
). - Use the Backspace key for undo (
Backspace
).
-
Enjoy calculating!
You can view a live demo of the On-Screen Calculator here.
Contributions are welcome! If you have any suggestions, enhancements, or bug fixes, please open an issue or create a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.