Skip to content

Commit

Permalink
resolved card swap bug using onDeck reassignment
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill-the-dev committed Feb 13, 2022
1 parent 367ae1f commit 2e4c5b3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion dist/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ body {
width: 100%;
display: flex;
position: fixed;
background-color: rgba(0, 0, 0, 0.6);
background-color: rgba(0, 0, 0, 0.25);
margin: 0 auto;
visibility: hidden;
justify-content: center;
Expand All @@ -158,6 +158,7 @@ body {
font-family: "Nanum Brush Script", cursive;
font-size: 1.5em;
color: #302f2f;
z-index: 4;
}

.modal__fill-active {
Expand Down
6 changes: 3 additions & 3 deletions dist/main.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ document.addEventListener("DOMContentLoaded", () => {
});

// Modal How To off
modalFill.addEventListener("click", e => {
modalHowTo.addEventListener("click", e => {
e.preventDefault();
console.log("off");
modalFill.classList.remove("modal__fill-active");
modalHowTo.classList.remove("modal__fill-active");
});

// Start / End game dynamic
Expand Down
1 change: 1 addition & 0 deletions src/scripts/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ export default class Game {
let newDeckCard = playedCard;
currentHand[playedCardIdx] = newPlayerCard;
deckCard = newDeckCard;
this.onDeckCard = newDeckCard; // new
// debugger;

// view swap
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/modal.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// export const modalFill =
export const modalFill =
`
<h2>How to Play Onitama</h2>
Expand Down

0 comments on commit 2e4c5b3

Please sign in to comment.