summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
Diffstat (limited to 'play.js')
-rw-r--r--play.js30
1 files changed, 8 insertions, 22 deletions
diff --git a/play.js b/play.js
index c2d11ed..9caf509 100644
--- a/play.js
+++ b/play.js
@@ -174,23 +174,13 @@ drawCards(deck, handLimit);
function displayHand(hand) {
const handDiv = document.getElementById('hand');
hand.forEach(card => {
- if (card < 100) {
- const img = document.createElement('img')
- img.src = `cards/e${card}.gif`
- img.className='handCard'
- img.alt = `Card ${card}`
- img.addEventListener('click', playCard)
- handDiv.appendChild(img)
- }
- else {
- const img = document.createElement('img')
- img.src = `cards2/e${card}.gif`
- img.className='handCard'
- img.alt = `Card ${card}`
- img.addEventListener('click', playCard)
- handDiv.appendChild(img)
- }
- })
+ const img = document.createElement('img')
+ img.src = `cards/e${card}.gif`
+ img.className='handCard'
+ img.alt = `Card ${card}`
+ img.addEventListener('click', playCard)
+ handDiv.appendChild(img)
+ })
}
@@ -286,11 +276,7 @@ function playCard(event) {
const eventPanel = document.getElementById('events');
const activeCard = document.createElement('img')
- if (playedCard < 100) {
- activeCard.src = `cards/e${playedCard}.gif`
- } else {
- activeCard.src = `cards2/e${playedCard}.gif`
- }
+ activeCard.src = `cards/e${playedCard}.gif`
activeCard.className='playedCard'
activeCard.alt = `Card ${playedCard}`
eventPanel.appendChild(activeCard)