2022-07-20 23:57:51 +00:00
|
|
|
mode = 'PLAY'
|
|
|
|
allData = {}
|
|
|
|
total = 0
|
2022-09-20 01:10:14 +00:00
|
|
|
cardNames = []
|
2022-07-20 23:57:51 +00:00
|
|
|
k = 12
|
|
|
|
extra = 3
|
2022-09-20 01:10:14 +00:00
|
|
|
num_artists = k + extra * 2
|
2022-07-20 23:57:51 +00:00
|
|
|
artDict = {}
|
|
|
|
totalCorrect = 0
|
|
|
|
totalSeen = 0
|
|
|
|
wordsLeft = k + extra
|
|
|
|
imagesLeft = k
|
|
|
|
maxRounds = 20
|
|
|
|
whichGuesser = 'counterspell'
|
|
|
|
un = false
|
2022-09-20 01:10:14 +00:00
|
|
|
ub = false
|
2022-07-20 23:57:51 +00:00
|
|
|
online = false
|
|
|
|
firstPrint = false
|
|
|
|
flag = true
|
|
|
|
page = 1
|
2022-08-17 19:40:59 +00:00
|
|
|
sets = {}
|
2022-07-20 23:57:51 +00:00
|
|
|
|
2022-08-17 19:40:59 +00:00
|
|
|
window.console.log(sets)
|
2022-07-20 23:57:51 +00:00
|
|
|
document.location.search.split('&').forEach((pair) => {
|
|
|
|
let v = pair.split('=')
|
|
|
|
if (v[0] === '?whichguesser') {
|
|
|
|
whichGuesser = v[1]
|
|
|
|
} else if (v[0] === 'un') {
|
|
|
|
un = v[1]
|
|
|
|
} else if (v[0] === 'digital') {
|
|
|
|
online = v[1]
|
|
|
|
} else if (v[0] === 'original') {
|
|
|
|
firstPrint = v[1]
|
2022-09-20 01:10:14 +00:00
|
|
|
} else if (v[0] === 'ub') {
|
|
|
|
ub = v[1]
|
2022-07-20 23:57:51 +00:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2022-08-17 19:40:59 +00:00
|
|
|
if (whichGuesser === 'basic') {
|
|
|
|
fetch('jsons/set.json')
|
|
|
|
.then((response) => response.json())
|
|
|
|
.then((data) => (sets = data))
|
|
|
|
}
|
|
|
|
|
2022-09-20 01:10:14 +00:00
|
|
|
if (whichGuesser === 'watermark') {
|
|
|
|
fetch('jsons/wm.json')
|
|
|
|
.then((response) => response.json())
|
|
|
|
.then((data) => (sets = data))
|
|
|
|
}
|
|
|
|
|
2022-08-17 19:40:59 +00:00
|
|
|
let firstFetch = fetch('jsons/' + whichGuesser + '.json')
|
2022-07-20 23:57:51 +00:00
|
|
|
fetchToResponse(firstFetch)
|
|
|
|
|
|
|
|
function putIntoMapAndFetch(data) {
|
|
|
|
putIntoMap(data.data)
|
2022-09-20 01:10:14 +00:00
|
|
|
if (whichGuesser == 'artist') {
|
|
|
|
newArtistData = createNewArtistMap()
|
|
|
|
allData = newArtistData[0]
|
|
|
|
total = newArtistData[1]
|
2022-07-20 23:57:51 +00:00
|
|
|
}
|
2022-09-20 01:10:14 +00:00
|
|
|
cardNames = Array.from(Object.keys(allData))
|
2022-08-17 19:40:59 +00:00
|
|
|
window.console.log(allData)
|
2022-09-20 01:10:14 +00:00
|
|
|
window.console.log(cardNames)
|
2022-08-17 19:40:59 +00:00
|
|
|
window.console.log(total)
|
|
|
|
if (whichGuesser === 'counterspell') {
|
|
|
|
document.getElementById('guess-type').innerText = 'Counterspell Guesser'
|
|
|
|
} else if (whichGuesser === 'burn') {
|
|
|
|
document.getElementById('guess-type').innerText = 'Match With Hot Singles'
|
|
|
|
} else if (whichGuesser === 'beast') {
|
|
|
|
document.getElementById('guess-type').innerText = 'Finding Fantastic Beasts'
|
|
|
|
} else if (whichGuesser === 'basic') {
|
|
|
|
document.getElementById('guess-type').innerText = 'How Basic'
|
2022-09-09 01:38:48 +00:00
|
|
|
} else if (whichGuesser === 'commander') {
|
|
|
|
document.getElementById('guess-type').innerText = 'General Knowledge'
|
2022-09-20 01:10:14 +00:00
|
|
|
} else if (whichGuesser === 'watermark') {
|
|
|
|
document.getElementById('guess-type').innerText = 'Watermark It'
|
|
|
|
} else if (whichGuesser === 'artist') {
|
|
|
|
document.getElementById('guess-type').innerText = 'Aesthetic Consultation'
|
2022-08-17 19:40:59 +00:00
|
|
|
}
|
2022-09-20 01:10:14 +00:00
|
|
|
window.console.log(whichGuesser)
|
2022-08-17 19:40:59 +00:00
|
|
|
setUpNewGame()
|
2022-07-20 23:57:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function getKSamples() {
|
|
|
|
let usedCounters = new Set()
|
|
|
|
let samples = {}
|
|
|
|
let i = 0
|
2022-09-20 01:10:14 +00:00
|
|
|
let allCards = Array.from(Object.keys(allData))
|
|
|
|
shuffleArray(allCards)
|
|
|
|
window.console.log(allCards)
|
|
|
|
for (let j = 0; j < allCards.length; j++) {
|
|
|
|
key = allCards[j]
|
|
|
|
value = allData[key]
|
|
|
|
if (usedCounters.has(key)) {
|
|
|
|
continue
|
|
|
|
} else {
|
|
|
|
window.console.log(key)
|
|
|
|
usedCounters.add(key)
|
|
|
|
let randIndex = Math.floor(Math.random() * value.length)
|
|
|
|
let arts = allData[key].splice(randIndex, 1)
|
|
|
|
samples[arts[0].artImg] = [key, arts[0].normalImg]
|
|
|
|
i++
|
|
|
|
if (i >= k) {
|
2022-07-20 23:57:51 +00:00
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (const key of usedCounters) {
|
|
|
|
if (allData[key].length === 0) {
|
|
|
|
delete allData[key]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
let count = 0
|
2022-09-20 01:10:14 +00:00
|
|
|
shuffleArray(cardNames)
|
|
|
|
for (let j = 0; j < cardNames.length; j++) {
|
|
|
|
key = cardNames[j]
|
|
|
|
value = cardNames[key]
|
|
|
|
if (usedCounters.has(key)) {
|
|
|
|
continue
|
|
|
|
} else {
|
|
|
|
window.console.log(key)
|
|
|
|
usedCounters.add(key)
|
|
|
|
count++
|
|
|
|
if (count >= extra) {
|
2022-07-20 23:57:51 +00:00
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-09-20 01:10:14 +00:00
|
|
|
|
2022-07-20 23:57:51 +00:00
|
|
|
return [samples, usedCounters]
|
|
|
|
}
|
|
|
|
|
2022-09-20 01:10:14 +00:00
|
|
|
function createNewArtistMap() {
|
|
|
|
let usedCounters = new Set()
|
|
|
|
let samples = {}
|
|
|
|
let i = 0
|
|
|
|
let newTotal = 0
|
|
|
|
let allCards = []
|
|
|
|
for (const [key, value] of Object.entries(allData)) {
|
|
|
|
for (let j = 0; j < value.length; j++) {
|
|
|
|
allCards.push(key)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
shuffleArray(allCards)
|
|
|
|
window.console.log(allCards)
|
|
|
|
for (let j = 0; j < allCards.length; j++) {
|
|
|
|
key = allCards[j]
|
|
|
|
value = allData[key]
|
|
|
|
if (usedCounters.has(key)) {
|
|
|
|
continue
|
|
|
|
} else {
|
|
|
|
window.console.log(key)
|
|
|
|
usedCounters.add(key)
|
|
|
|
samples[key] = value
|
|
|
|
newTotal += value.length
|
|
|
|
i++
|
|
|
|
if (i >= num_artists) {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return [samples, newTotal]
|
|
|
|
}
|
|
|
|
|
2022-07-20 23:57:51 +00:00
|
|
|
function fetchToResponse(fetch) {
|
|
|
|
return fetch
|
|
|
|
.then((response) => response.json())
|
2022-09-20 01:10:14 +00:00
|
|
|
.then((json) => putIntoMapAndFetch(json))
|
2022-07-20 23:57:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function determineIfSkip(card) {
|
|
|
|
if (!un) {
|
|
|
|
if (card.set_type === 'funny') {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
2022-09-20 01:10:14 +00:00
|
|
|
if (!ub) {
|
|
|
|
if (card.security_stamp === 'triangle') {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
2022-07-20 23:57:51 +00:00
|
|
|
if (!online) {
|
|
|
|
if (card.digital) {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (firstPrint) {
|
2022-08-17 19:40:59 +00:00
|
|
|
if (whichGuesser == 'basic') {
|
2022-09-20 01:10:14 +00:00
|
|
|
if (card.set_type !== 'expansion' && card.set_type !== 'funny') {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
} else if (whichGuesser == 'artist') {
|
|
|
|
if (
|
|
|
|
card.set_type === 'token' ||
|
|
|
|
card.set_type === 'vanguard' ||
|
|
|
|
card.set_type === 'planechase' ||
|
|
|
|
card.set_type === 'archenemy' ||
|
|
|
|
card.set_type === 'memorabilia'
|
|
|
|
) {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
} else if (whichGuesser == 'watermark') {
|
2022-08-18 01:17:29 +00:00
|
|
|
if (
|
2022-09-20 01:10:14 +00:00
|
|
|
card.name === 'Set' ||
|
|
|
|
card.name === 'Planeswalker' ||
|
|
|
|
card.name === 'Flavor' ||
|
|
|
|
card.name === 'Conspiracy' ||
|
|
|
|
card.name === 'Foretell' ||
|
|
|
|
card.name === 'Tarkir' ||
|
|
|
|
card.set === 'h17' ||
|
|
|
|
card.set === 'ptg' ||
|
|
|
|
card.set === 'htr18'
|
2022-08-18 01:17:29 +00:00
|
|
|
) {
|
2022-08-17 19:40:59 +00:00
|
|
|
return true
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (
|
2022-09-20 01:10:14 +00:00
|
|
|
card.reprint ||
|
2022-08-17 19:40:59 +00:00
|
|
|
(card.frame_effects && card.frame_effects.includes('showcase'))
|
|
|
|
) {
|
|
|
|
return true
|
|
|
|
}
|
2022-07-20 23:57:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// reskinned card names show in art crop
|
|
|
|
if (card.flavor_name) {
|
|
|
|
return true
|
|
|
|
}
|
2022-09-09 01:38:48 +00:00
|
|
|
|
|
|
|
return false
|
2022-07-20 23:57:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function putIntoMap(data) {
|
|
|
|
for (let i = 0; i < data.length; i++) {
|
|
|
|
let card = data[i]
|
|
|
|
if (determineIfSkip(card)) {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
let name = card.name
|
|
|
|
// remove slashes from adventure cards
|
|
|
|
if (card.card_faces) {
|
|
|
|
name = card.card_faces[0].name
|
|
|
|
}
|
2022-08-17 19:40:59 +00:00
|
|
|
if (whichGuesser === 'basic') {
|
|
|
|
name =
|
|
|
|
'<img class="symbol" style="width: 17px; height: 17px" src="' +
|
|
|
|
sets[name][1] +
|
|
|
|
'" /> ' +
|
|
|
|
sets[name][0]
|
|
|
|
}
|
2022-09-20 01:10:14 +00:00
|
|
|
if (whichGuesser === 'watermark' && sets.hasOwnProperty(name)) {
|
|
|
|
name = sets[name]
|
|
|
|
}
|
2022-07-20 23:57:51 +00:00
|
|
|
let normalImg = ''
|
|
|
|
if (card.image_uris.normal) {
|
|
|
|
normalImg = card.image_uris.normal
|
|
|
|
} else {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
let artImg = ''
|
|
|
|
if (card.image_uris.art_crop) {
|
|
|
|
artImg = card.image_uris.art_crop
|
|
|
|
} else {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
total += 1
|
|
|
|
if (!allData[name]) {
|
|
|
|
allData[name] = [{ artImg: artImg, normalImg: normalImg }]
|
|
|
|
} else {
|
|
|
|
allData[name].push({ artImg: artImg, normalImg: normalImg })
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function shuffleArray(array) {
|
|
|
|
for (let i = array.length - 1; i > 0; i--) {
|
|
|
|
let j = Math.floor(Math.random() * (i + 1))
|
|
|
|
let temp = array[i]
|
|
|
|
array[i] = array[j]
|
|
|
|
array[j] = temp
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function setUpNewGame() {
|
|
|
|
wordsLeft = k + extra
|
|
|
|
imagesLeft = k
|
|
|
|
let currentRound = totalSeen / k
|
|
|
|
if (currentRound + 1 === maxRounds) {
|
|
|
|
document.getElementById('round-number').innerText = 'Final Round'
|
|
|
|
} else {
|
|
|
|
document.getElementById('round-number').innerText =
|
|
|
|
'Round ' + (1 + currentRound)
|
|
|
|
}
|
|
|
|
|
|
|
|
setWordsLeft()
|
|
|
|
// select new cards
|
|
|
|
let sampledData = getKSamples()
|
|
|
|
artDict = sampledData[0]
|
|
|
|
let randomImages = Object.keys(artDict)
|
|
|
|
shuffleArray(randomImages)
|
2022-08-18 01:01:59 +00:00
|
|
|
let namesList = Array.from(sampledData[1]).sort((a, b) =>
|
|
|
|
removeSymbol(a).localeCompare(removeSymbol(b))
|
|
|
|
)
|
2022-07-20 23:57:51 +00:00
|
|
|
// fill in the new cards and names
|
|
|
|
for (let cardIndex = 1; cardIndex <= k; cardIndex++) {
|
|
|
|
let currCard = document.getElementById('card-' + cardIndex)
|
|
|
|
currCard.classList.remove('incorrect')
|
|
|
|
currCard.dataset.name = ''
|
|
|
|
currCard.dataset.url = randomImages[cardIndex - 1]
|
|
|
|
currCard.style.backgroundImage = "url('" + currCard.dataset.url + "')"
|
|
|
|
}
|
|
|
|
const nameBank = document.querySelector('.names-bank')
|
|
|
|
for (nameIndex = 1; nameIndex <= k + extra; nameIndex++) {
|
|
|
|
currName = document.getElementById('name-' + nameIndex)
|
|
|
|
// window.console.log(currName)
|
2022-08-17 19:40:59 +00:00
|
|
|
currName.innerHTML = namesList[nameIndex - 1]
|
2022-07-20 23:57:51 +00:00
|
|
|
nameBank.appendChild(currName)
|
|
|
|
}
|
2022-09-20 01:10:14 +00:00
|
|
|
document.querySelectorAll('.temporary-name-holder').forEach((x) => x.remove())
|
2022-07-20 23:57:51 +00:00
|
|
|
}
|
|
|
|
|
2022-08-18 01:01:59 +00:00
|
|
|
function removeSymbol(name) {
|
|
|
|
let arr = name.split('>')
|
|
|
|
return arr[arr.length - 1]
|
|
|
|
}
|
|
|
|
|
2022-07-20 23:57:51 +00:00
|
|
|
function checkAnswers() {
|
|
|
|
let score = k
|
|
|
|
// show the correct full cards
|
|
|
|
for (cardIndex = 1; cardIndex <= k; cardIndex++) {
|
|
|
|
currCard = document.getElementById('card-' + cardIndex)
|
|
|
|
let incorrect = true
|
|
|
|
if (currCard.dataset.name) {
|
2022-08-17 19:40:59 +00:00
|
|
|
// remove image text
|
2022-09-20 01:10:14 +00:00
|
|
|
let guessWithSymbol = document.getElementById(
|
|
|
|
currCard.dataset.name
|
|
|
|
).innerHTML
|
|
|
|
let ansWithSymbol = artDict[currCard.dataset.url][0]
|
|
|
|
let guess = removeSymbol(guessWithSymbol)
|
|
|
|
let ans = removeSymbol(ansWithSymbol)
|
2022-08-18 01:01:59 +00:00
|
|
|
incorrect = ans !== guess
|
2022-07-20 23:57:51 +00:00
|
|
|
// decide if their guess was correct
|
2022-09-20 01:10:14 +00:00
|
|
|
// window.console.log(ans, guess, incorrect)
|
|
|
|
correctAns = String.fromCodePoint(0x2705) + ' ' + ansWithSymbol
|
|
|
|
if (incorrect) {
|
|
|
|
window.console.log(
|
|
|
|
document.getElementById(currCard.dataset.name),
|
|
|
|
guess,
|
|
|
|
ans
|
|
|
|
)
|
|
|
|
document.getElementById(currCard.dataset.name).innerHTML =
|
|
|
|
String.fromCodePoint(0x274c) +
|
|
|
|
' <i style="opacity:.6"><strike>' +
|
|
|
|
guessWithSymbol +
|
|
|
|
'</strike></i><br/><span style="opacity:0;">' +
|
|
|
|
String.fromCodePoint(0x274c) +
|
|
|
|
'</span> ' +
|
|
|
|
ansWithSymbol
|
|
|
|
} else {
|
|
|
|
document.getElementById(currCard.dataset.name).innerHTML = correctAns
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
answerCorrectionHolder = document.createElement('div')
|
|
|
|
answerCorrectionHolder.classList.add('name')
|
|
|
|
answerCorrectionHolder.classList.add('temporary-name-holder')
|
|
|
|
|
|
|
|
answerCorrectionHolder.innerHTML =
|
|
|
|
String.fromCodePoint(0x274c) +
|
|
|
|
' <i style="opacity:.6"><No Answer> </i><br/><span style="opacity:0;">' +
|
|
|
|
String.fromCodePoint(0x274c) +
|
|
|
|
'</span> ' +
|
|
|
|
artDict[currCard.dataset.url][0]
|
|
|
|
currCard.appendChild(answerCorrectionHolder)
|
2022-07-20 23:57:51 +00:00
|
|
|
}
|
2022-09-20 01:10:14 +00:00
|
|
|
if (incorrect) {
|
|
|
|
currCard.classList.add('incorrect')
|
|
|
|
// tally some kind of score
|
|
|
|
score--
|
|
|
|
// show the correct answer
|
|
|
|
}
|
|
|
|
|
2022-07-20 23:57:51 +00:00
|
|
|
// show the correct card
|
|
|
|
currCard.style.backgroundImage =
|
|
|
|
"url('" + artDict[currCard.dataset.url][1] + "')"
|
|
|
|
}
|
|
|
|
totalSeen += k
|
|
|
|
totalCorrect += score
|
|
|
|
document.getElementById('score-amount').innerText = score + '/' + k
|
|
|
|
document.getElementById('score-percent').innerText = Math.round(
|
|
|
|
(totalCorrect * 100) / totalSeen
|
|
|
|
)
|
|
|
|
document.getElementById('score-amount-total').innerText =
|
|
|
|
totalCorrect + '/' + totalSeen
|
|
|
|
}
|
|
|
|
|
|
|
|
function toggleMode() {
|
|
|
|
event.preventDefault()
|
|
|
|
if (mode === 'PLAY') {
|
|
|
|
mode = 'ANSWER'
|
|
|
|
document.querySelector('.play-page').classList.add('answer-page')
|
|
|
|
window.console.log(totalSeen)
|
|
|
|
if (totalSeen / k === maxRounds - 1) {
|
|
|
|
document.getElementById('submit').style.display = 'none'
|
|
|
|
} else {
|
|
|
|
document.getElementById('submit').value = 'Next Round'
|
|
|
|
}
|
|
|
|
checkAnswers()
|
|
|
|
} else {
|
|
|
|
mode = 'PLAY'
|
|
|
|
document.querySelector('.play-page').classList.remove('answer-page')
|
|
|
|
document.getElementById('submit').value = 'Submit'
|
|
|
|
setUpNewGame()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function allowDrop(ev, id) {
|
|
|
|
ev.preventDefault()
|
|
|
|
}
|
|
|
|
|
|
|
|
function drag(ev) {
|
|
|
|
ev.dataTransfer.setData('text', ev.target.id)
|
|
|
|
let nameEl = document.querySelector('.selected')
|
|
|
|
if (nameEl) nameEl.classList.remove('selected')
|
|
|
|
}
|
|
|
|
|
|
|
|
function drop(ev, id) {
|
|
|
|
ev.preventDefault()
|
|
|
|
var data = ev.dataTransfer.getData('text')
|
|
|
|
dropOnCard(id, data)
|
|
|
|
}
|
|
|
|
|
|
|
|
function returnDrop(ev) {
|
|
|
|
ev.preventDefault()
|
|
|
|
var data = ev.dataTransfer.getData('text')
|
|
|
|
returnToNameBank(data)
|
|
|
|
}
|
|
|
|
|
|
|
|
function returnToNameBank(name) {
|
|
|
|
document
|
|
|
|
.querySelector('.names-bank')
|
|
|
|
.appendChild(document.getElementById(name))
|
|
|
|
let prevContainer = document.querySelector('[data-name=' + name + ']')
|
|
|
|
if (prevContainer) {
|
|
|
|
prevContainer.dataset.name = ''
|
|
|
|
wordsLeft += 1
|
|
|
|
imagesLeft += 1
|
|
|
|
setWordsLeft()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function selectName(ev) {
|
|
|
|
if (ev.target.parentNode.classList.contains('names-bank')) {
|
|
|
|
let nameEl = document.querySelector('.selected')
|
|
|
|
if (nameEl) nameEl.classList.remove('selected')
|
|
|
|
ev.target.classList.add('selected')
|
|
|
|
} else {
|
|
|
|
returnToNameBank(ev.target.id)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function dropSelected(ev, id) {
|
|
|
|
ev.preventDefault()
|
|
|
|
let nameEl = document.querySelector('.selected')
|
|
|
|
window.console.log('drop selected', nameEl)
|
|
|
|
if (!nameEl) return
|
|
|
|
nameEl.classList.remove('selected')
|
|
|
|
dropOnCard(id, nameEl.id)
|
|
|
|
}
|
|
|
|
|
|
|
|
function dropOnCard(id, data) {
|
|
|
|
let target = document.getElementById('card-' + id)
|
|
|
|
target.appendChild(document.getElementById(data))
|
|
|
|
// if this already has a name, remove that name
|
|
|
|
if (target.dataset.name) {
|
|
|
|
returnToNameBank(target.dataset.name)
|
|
|
|
}
|
|
|
|
// remove name data from a previous card if there is one
|
|
|
|
let prevContainer = document.querySelector('[data-name=' + data + ']')
|
|
|
|
if (prevContainer) {
|
|
|
|
prevContainer.dataset.name = ''
|
|
|
|
} else {
|
|
|
|
wordsLeft -= 1
|
|
|
|
imagesLeft -= 1
|
|
|
|
setWordsLeft()
|
|
|
|
}
|
|
|
|
target.dataset.name = data
|
|
|
|
}
|
|
|
|
|
|
|
|
function setWordsLeft() {
|
2022-08-17 19:40:59 +00:00
|
|
|
cardName = 'Unused Card Names: '
|
|
|
|
if (whichGuesser === 'basic') {
|
|
|
|
cardName = 'Unused Set Names: '
|
|
|
|
}
|
2022-07-20 23:57:51 +00:00
|
|
|
document.getElementById('words-left').innerText =
|
2022-08-17 19:40:59 +00:00
|
|
|
cardName + wordsLeft + '/Images: ' + imagesLeft
|
2022-07-20 23:57:51 +00:00
|
|
|
}
|