A sleek and responsive JavaScript calculator inspired by the iPhone. Perfect for quick calculations with an intuitive button layout and error-free operation. This project demonstrates core JavaScript functionalities, DOM manipulation techniques, and responsive design principles.
Basic Operations: Perform addition, subtraction, multiplication, and division.
Clear Screen: Reset the display to its initial state using the AC
button.
Delete: Remove the last entered character using the del
button.
Responsive Design: The calculator adjusts its layout based on the screen size, making it mobile-friendly.
Error Handling: Displays an error message for invalid calculations.
Keyboard Shortcuts: Supports various keyboard shortcuts for efficient usage.
- 0-9: Enter a digit.
- Enter / =: Calculate the result.
- Backspace / Delete: Delete the last character.
- C: Clear the screen.
Supports basic arithmetic operations.
Displays up to 9 decimal places for precise calculations.
Mobile-friendly design inspired by the iPhone calculator.
git clone https://github.com/https-sharif/iphone-calculator.git
cd iphone-calculator
open index.html
HTML File
CSS File
Javascript File
Favicon PNG
- HTML: The structure of the calculator, including buttons and display areas.
- CSS: Basic styling to make the calculator visually appealing and responsive.
- JavaScript: Handles button clicks, updates the display, performs calculations, and manages errors.
You can view a live demo of the project here.
Contributions are welcome! Feel free to open issues or submit pull requests for improvements and new features.