mostly ui chages

This commit is contained in:
HearMeWhisper 2021-09-30 22:38:44 -04:00
parent 2af07974ff
commit 88110368a6
2 changed files with 29 additions and 12 deletions

View File

@ -1,14 +1,14 @@
body { body {
background-color: #23313d; background-color: #42739e;
cursor: default; cursor: default;
font-size: 130%; font-size: 130%;
} }
#score { #score {
border: 2px solid black; border: 2px solid black;
background-color: black; background-color: rgb(46, 45, 45);
color: white; color: white;
border-radius: 7px; border-radius: 15px;
float: left; float: left;
border-collapse: collapse; border-collapse: collapse;
border-style: hidden; border-style: hidden;
@ -28,7 +28,7 @@ body {
} }
.cells1 { .cells1 {
background-color: #70d38b; background-color: #d86e60;
text-align: center; text-align: center;
padding-top: 4%; padding-top: 4%;
padding-bottom: 4%; padding-bottom: 4%;
@ -41,7 +41,7 @@ body {
.dice { .dice {
border: 5px solid black; border: 5px solid black;
width: 80%; width: 80%;
background-color: #53a788; background-color: #56667e;
align-self: center; align-self: center;
margin-top: 7%; margin-top: 7%;
padding: 12px; padding: 12px;
@ -81,7 +81,7 @@ body {
#btn { #btn {
border-radius: 10px; border-radius: 10px;
background-color: #cbffd8; background-color: #e9eb85;
color: 23313d; color: 23313d;
text-align: center; text-align: center;
border: 2.5px solid black; border: 2.5px solid black;
@ -94,7 +94,7 @@ body {
#fullscreen { #fullscreen {
display: flex; display: flex;
border-radius: 10px; border-radius: 10px;
background-color: #cbffd8; background-color: #e9eb85;
color: #23313d; color: #23313d;
text-align: center; text-align: center;
border: 2.5px solid black; border: 2.5px solid black;
@ -126,13 +126,14 @@ body {
} }
#cell13 { #cell13 {
color: #cbffd8; color: #c6f2ff;
background-color: #181c28; background-color: #181c28;
} }
#cell31 { #cell31 {
color: #cbffd8; color:#c6f2ff;
background-color: #181c28; background-color: #181c28;
border-radius: 15px;
} }
#how:hover { #how:hover {
@ -145,6 +146,7 @@ body {
float: right; float: right;
} }
@media (max-device-width: 550px) { @media (max-device-width: 550px) {
.cells { .cells {
border-bottom: 4px solid #2E2E45; border-bottom: 4px solid #2E2E45;

View File

@ -41,7 +41,7 @@ function how_to() {
function hold_score(cell) { function hold_score(cell) {
if ((cell.className == "cells" && turn_over == false) || (document.getElementById("cell29").className == "cells1" && yatzee_counter == true)) { if ((cell.className == "cells" && turn_over == false) || (document.getElementById("cell29").className == "cells1" && yatzee_counter == true)) {
cell.className = "cells1"; cell.className = "cells1";
document.getElementById("cell1").style.borderTopRightRadius = "5px"; document.getElementById("cell1").style.borderTopRightRadius = "15px";
turn_over = true; turn_over = true;
bottom_score(); bottom_score();
upper_score(); upper_score();
@ -78,7 +78,13 @@ function hold_score(cell) {
document.getElementById("cell13").innerHTML = sub_total; document.getElementById("cell13").innerHTML = sub_total;
document.getElementById("cell31").innerHTML = final_total; document.getElementById("cell31").innerHTML = final_total;
if (game_over == true) {document.getElementById('btn').innerHTML = "New Game?"; drawboard();} if (game_over == true) {
document.getElementById('btn').innerHTML = "New Game?";
document.getElementById('btn').onclick = function() {
drawboard();
};
}
} }
/* /*
sub_total = 0; sub_total = 0;
@ -90,6 +96,15 @@ function hold_score(cell) {
} }
function drawboard() { function drawboard() {
if (game_over == true) {
document.getElementById('btn').innerHTML = "New Game?";
document.getElementById('btn').onclick = function() {
window.location.reload(false);
};
game_over = false;
return;
}
document.getElementById('highscore').innerHTML = "Your High Score: " + localStorage.getItem('high_score'); document.getElementById('highscore').innerHTML = "Your High Score: " + localStorage.getItem('high_score');
document.getElementById("scorecard").innerHTML = ""; document.getElementById("scorecard").innerHTML = "";
document.getElementById('btn').innerHTML = 'Start Game!'; document.getElementById('btn').innerHTML = 'Start Game!';
@ -421,7 +436,7 @@ function upper_score() {
game_over = true; game_over = true;
if (Number(localStorage.getItem('high_score')) < final_total) localStorage.setItem('high_score', final_total); if (Number(localStorage.getItem('high_score')) < final_total) localStorage.setItem('high_score', final_total);
document.getElementById('btn').onclick = function() { document.getElementById('btn').onclick = function() {
window.location.reload(false); drawboard();
}; };