Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ishan569.com
14 changes: 12 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ let answer = document.getElementById("ans");
let clickOperator = 0;
let percent = false;
let numPercent = 0;
let colors = ['#EF2D4F', 'pink', 'blue', 'skyblue'];
let currentColor = 0;
// this chunk of code is contributed by tushartiwari7
document.onkeyup = function(e) {
if (e.which == 48 || e.keyCode == 96) {
Expand Down Expand Up @@ -100,5 +102,13 @@ function equals(){
ans.value = 'Syntax Error';
}
}

//End
function changeColor(){
if(currentColor < colors.length-1) {
currentColor = currentColor+1;
document.body.style.backgroundColor = colors[currentColor];
} else {
currentColor = 0;
document.body.style.backgroundColor = colors[0];
}
}
//End
7 changes: 6 additions & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,9 @@ button:hover {
.pink {
background-color: #EF2D4F;
color: white;
}
}
.change-color-btn{
border-radius: 10px;
width: 80%;
margin: 5px;
}