- The HTML file contains just the basic buttons and the container of my whole calculator.
- html_file
- I used Grid to design the whole layout
- As the Grid is now widely used among so many different web designs, the grid makes things look more aesthetic.
- CSS Grid is one of the main things in CSS nowadays and this project is the best way to improve my grid skills.
- I used a light background for the body to make it look more pleasing.
-
I used an Object-oriented approach to build this project.
-
The main object is the calculator
-
it takes two parameters which are
previousnumber
( the number that was entered before) andcurrent number
(the number that is being entered now ) -
The object
calculator
has certain methodsdel()
To delete the last digit of the current inputclear()
To clear out theprevious
as well ascurrent
input and theoperator
calc()
To calculate the resultcurrentoperator()
that watches for the operator and once an operator is selected thecurrentinput
becomes thepreviousinput
and the calculation goes onappendInput
responsible for adding the numbers to thecurrent
andprevious
inputupdateDisplay()
is responsible for updating the display on the screen mainly on the calculator
- CSS GRID
- Object-oriented programing
- JS functionality
- Best practices