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 mathematical 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-scheme
and have any additional changes saved in the browser
- Solution URL: Git
- Live Site URL: Calculator
I started by planning out how to do the theme switcher first, then put everything into the HTML and styled it with CSS.
Then I figured out how to use Javascript to check prefers-color-scheme
and change themes by switching an alternative stylesheet.
The alternative style sheets only contained color data in the form of CSS variables.
Then I used javascript to disable double tap zoom, perform input verification and swap * for x on the screen.
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- Javascript
I learned how to style radial buttons and theme switch using javascript.
- Website - David Dyer
- Frontend Mentor - @davidbdeath