This is a solution to the Calculator app challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- See the size of the elements adjust based on their device's screen size
- Perform mathmatical operations like addition, subtraction, multiplication, and division
- Adjust the color theme based on their preference
- Bonus: Have their initial theme preference checked using
prefers-color-schemeand have any additional changes saved in the browser
- Solution URL: Frontend mentor solution
- Live Site URL: Live site
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- CSS Grid
- Mobile-first workflow
- SASS-SCSS
- Vanilla JS
- I learned to use desktop theme preference. And to change theme between 3 themes.
- For get the numbers to calculate I used e.target.id of each buttons.
- When we click on an operator button (+, -, /,*) the number (e.target.id) became a "previousNumber" and be display in "previousdisplay" this number will be calculate with the next numbers until we click on egal for have the total. Every time we click on a operator button we will get preview of the total price in "previousdisplay"
Practice more javascript
