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:
prefers-color-scheme
and have any additional changes saved in the browser
Step one - Get one layout and theme
Step two - Figure out how to do math
Step three - Configure themes
Keep it simple. And don’t be afraid to try something new.
<form class="keys">
<input type="button" value="7">
<input type="button" value="8">
<input type="button" value="9">
<input type="button" value="del" class="del">
<input type="button" value="4">
<input type="button" value="5">
<input type="button" value="6">
<input type="button" value="+">
<input type="button" value="1">
<input type="button" value="2">
<input type="button" value="3">
<input type="button" value="-">
<input type="button" value=".">
<input type="button" value="0">
<input type="button" value="/">
<input type="button" value="x">
<input type="button" value="reset" class="reset">
<input type="submit" value="=" class="submit">
</form>
:root{
.theme1{
@include theme1;
}
.theme2{
@include theme2;
}
.theme3{
@include theme3;
}
@media(prefers-color-scheme: dark){
.theme3{
@include theme3
}
}
@media(prefers-color-scheme: light){
.theme2{
@include theme2
}
}
}
import Calculator from "./objects/Calculator"
const el = document.querySelector('.calc');
const myCalc = new Calculator(el)
I realized that I should have done this project with typescript in hindsight.