Calculator app (first lvl 3 challenge)

Solution retrospective
This was a really big project for me but im really proud of myself. struggled with the theme picker for a long time but i pretty much got it working. but i have a couple of questions id like feedback on
- i started out without the theme picker and had button hover effects and an 'active' button style for the plus, minus, divide and multiply buttons. so that if was obvious which button was active this was done in CSS using :hover and a class for toggling. But when i changed to a theme system using JS i couldn't figure out how to modify those classes CSS classes to fit with the different themes (seems like thats not a thing i can do), so any suggestions on how i could have built those functions otherwise?
(correction: i just saw that i kept the toggle effect on the buttons but it doesn't change with the themes.)
- i implemented a decimal systemn (and yes i intentionally use comma and dot like that (haha im not american) .. but i couldn't figure out how to allow more digits than 2 after the decimal.. so if you add more the JS behind knows the values but the display wont show it. i used this: Number(parseFloat(num).toFixed(2)).toLocaleString('da'); prepare the value for the display but this would remove the decimals.. i thought i could just modify the .toFixed(..) but it wasn't that simple and i gave up with it a bit.
lastly the display window expands if you fill it with digits.. which looks dumb.. and for some reason the themepicker switch shows up as an oval on my iphone and not the 16x16 px i've set it to im perplexed..
thank you so much for reading this far! you guys are awesome!
Please log in to post a comment
Log in with GitHubCommunity feedback
- @Bope142
Pensez aussi à la sauvegarde du tout dernier thème sélectionné par l'utilisateur avant le chargement de la page afin de lui permettre de garder son récent thème choisi… https://serene-kirch-890ea8.netlify.app/ Si non le défi est réussi !! félicitation.
- @mehboobsamnani
hey Jonatan loved the effort and the end results are same , i would like to give you one feedback to add button click effect. it will definitely improve ux.
for your refrence https://codepen.io/rauldronca/pen/Pzrgzp https://tympanus.net/Tutorials/CSSButtonsPseudoElements/index3.html#
- P@palgramming
you might want to look into using CSS Variables in the future to set your main color mode and then you just change the values of the variables in your JS to modify the theme https://www.w3schools.com/css/css3_variables.asp
But it looks like you have a good start to this challenge it is not a easy one. Lots of elements and edge cases to have to figure out and plan for
Join our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord