Skip to content

Commit

Permalink
13.12.2024 | Anpassung Memory
Browse files Browse the repository at this point in the history
Die Karten die du richtig hast verschieben sich nun nicht mehr in die mitte sondern es bleiben alle Memory Karten an ihrem Platz. (;
  • Loading branch information
ubodigat authored Dec 13, 2024
1 parent 437c94e commit 55b49e4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions games/memory/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ <h5>Score:</h5>
setTimeout(() => {
const [card1, card2] = flippedCards;
if (card1.emoji === card2.emoji) {
card1.element.style.display = 'none';
card2.element.style.display = 'none';
card1.element.style.visibility = 'hidden';
card2.element.style.visibility = 'hidden';
foundPairs++;
if (foundPairs === emojis.length) {
alert('Glückwunsch! Du hast alle Paare gefunden.');
Expand All @@ -193,13 +193,14 @@ <h5>Score:</h5>
}
});
});

document.getElementById('reset-button').addEventListener('click', () => {
cards.forEach(card => {
card.style.transition = 'transform 0.75s ease-in-out';
card.style.transform = 'rotateY(0deg)';
card.classList.remove('face-up');
card.textContent = '';
card.style.display = 'flex';
card.style.visibility = 'visible';
});

flippedCards = [];
Expand Down

0 comments on commit 55b49e4

Please sign in to comment.