Skip to content

mkdew37/calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

About

My calculator project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published