This web-based calculator app is built using React, offering a user-friendly and feature-rich experience for performing basic math calculations and percentage-based operations. It's perfect for both desktop and mobile use, adapting to various screen sizes seamlessly.
Try out the live demo here.
-
Perform basic arithmetic operations: addition, subtraction, multiplication, and division.
-
Calculate percentages with ease.
-
Clear your input with a single click using the 'C' button.
-
Remove the last character if you make a mistake by pressing the '<' button.
-
Keyboard shortcuts for quick calculations (e.g., 'Enter' for the result, 'Escape' to clear input, and 'Backspace' to delete the last character).
-
Responsive design for a consistent user experience across different devices.
-
Error handling to alert users when calculations encounter issues (e.g., division by zero).
The calculator app supports both light and dark modes to enhance the user experience. Users can switch between these modes easily to suit their preferences.
In light mode, the app features a clean and bright interface with a white background, making it easy to read and interact with.
Dark mode offers a more comfortable viewing experience in low-light conditions. The app adopts a darker color scheme with reduced brightness.
To switch between light and dark modes, simply use the toggle switch located at the [specific location in your app, e.g., the top-right corner].
- Enter your desired calculation in the input field.
- Use the numeric buttons for digits 0-9.
- Utilize the arithmetic operators (+, -, *, /) for calculations.
- To calculate percentages, use the '%' sign (e.g.,
10% of 50will return5). - Press 'C' to clear the input field.
- Use '<' to delete the last character from the input.
- For the result, press '=' or 'Enter'.
- If there's an issue with the calculation, an error message will be displayed.
To run this calculator app locally on your machine, follow these steps:
- Clone this repository.
git clone https://github.com/imtiazimran/ASB-Design
Navigate to the project directory.
bash Copy code cd react-calculator-app Install the project dependencies.
bash Copy code npm install Start the development server.
bash Copy code npm start Open your browser and access the app at http://localhost:5173 .
Technologies Used React: For building the user interface and handling user interactions. HTML & CSS: For structuring the app and styling it. JavaScript: For implementing the calculator's logic and error handling. Folder Structure The project structure is organized as follows:
public/: Contains the HTML template and static assets. src/: Contains the React components and application logic. License This project is open-source and available under the MIT License.
Feel free to contribute, report issues, or suggest improvements by creating a pull request or raising an issue on GitHub.
Happy calculating! 🧮

