Skip to content

Latest commit

 

History

History
59 lines (46 loc) · 2.49 KB

README.md

File metadata and controls

59 lines (46 loc) · 2.49 KB

iPhone Calculator

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.

Features

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.

Keyboard Shortcuts

  • 0-9: Enter a digit.
  • Enter / =: Calculate the result.
  • Backspace / Delete: Delete the last character.
  • C: Clear the screen.

Additional Features

Supports basic arithmetic operations.
Displays up to 9 decimal places for precise calculations.
Mobile-friendly design inspired by the iPhone calculator.

Usage

1. Clone the Repository:

git clone https://github.com/https-sharif/iphone-calculator.git

2. Navigate to the project directory:

cd iphone-calculator

3. Open the index.html file

open index.html

Repository Content

HTML File
CSS File
Javascript File
Favicon PNG

Implementation Details

  • 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.

Demo

You can view a live demo of the project here.

Preview

JavaScript Calculator

Contributions

Contributions are welcome! Feel free to open issues or submit pull requests for improvements and new features.