Skip to content

Latest commit

 

History

History
51 lines (37 loc) · 2.01 KB

README.md

File metadata and controls

51 lines (37 loc) · 2.01 KB

Javascript Calculator 🧮

Screenshot of project

Built with:

  • HTML5
  • CSS3
  • JavaScript

Tools Used:

  • Google
  • Shell Script
  • Visual Studio Code
  • Arch

Features:

  • Addition, subtraction, multiplication and division
  • Support for negative numbers
  • Validate equations
  • Multiple operations supported if pressing an operator
  • +/- toggle button
  • Disable decimal button if clicked
  • Results containing a decimal is rounded to 1 decimal
  • Fully implemented backspace button
  • Alert if user try to divide by 0
  • Alert if the equation is not a valid one
  • Mouse & keyboard support
  • Support for Numpad

Usage:

  • Escape/Delete = AC Button
  • Enter = Equal Button

What I have learned:

  • Use regex patterns to validate and parse mathematical expressions
  • Keyboard events
  • Using media queries to make the calculator responsive to both 1080p and 3440x1440p
  • Using getFullYear method to update copyright footer
  • Chained ogether CSS rules to minimize code
  • Use more functions instead of repeating code

Acknowledgments: