Skip to content

nguyenm-giau/JavaScript-Calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JavaScript Calculator

English | Tiếng Việt


Welcome to the JavaScript Calculator project! This is a simple and functional calculator built using HTML, CSS, and JavaScript. It supports basic arithmetic operations, decimal inputs, and keyboard interactions for a smooth user experience.

Calculator Preview

Features

  • Basic Operations: Addition, Subtraction, Multiplication, and Division
  • Keyboard Support: Use both mouse and keyboard to interact with the calculator
  • Floating Point Calculations: Supports decimal calculations
  • Clear and Reset Functions: Easily manage your calculations
  • Press Styles: Interactive button press effect for a better user experience
  • Responsive Design: Works seamlessly on different screen sizes

Demo

You can try the live demo of the calculator here.

Technologies Used

  • HTML5: For the basic structure of the calculator
  • CSS3: For styling and creating a responsive layout
  • JavaScript (ES6): To handle the calculator logic and operations

Setup & Installation

To run this project locally, follow these steps:

  1. Clone the repository:

    git clone https://github.com/nguyenm-giau/JavaScript-Calculator.git
  2. Open index.html in your browser to see the calculator in action.

Usage

  • Mouse Input: Click the buttons to perform calculations.
  • Keyboard Input: Use the following keys:
    • Numbers (0-9) for input
    • +, -, *, / for operations
    • Enter to calculate
    • Backspace to delete the last digit
    • Escape to clear the input

Lessons Learned

During the development of this project, I learned:

  • Managing state in JavaScript using objects.
  • Handling floating-point precision in mathematical operations.
  • Implementing keyboard interactions for web applications.

Icons Used

Contributing

Contributions are welcome! If you'd like to contribute to the project, feel free to fork the repository and submit a pull request.

About

A sleek and functional calculator using HTML, CSS, and JavaScript.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published