add admin ability to double card values
This commit is contained in:
parent
a4b0297c3f
commit
81ee2200fb
5 changed files with 22 additions and 1 deletions
|
|
@ -1,5 +1,7 @@
|
|||
"use strict"
|
||||
|
||||
import { qs } from "./shared.js"
|
||||
|
||||
function setup() {
|
||||
let highlighted
|
||||
document.addEventListener("click", (event) => {
|
||||
|
|
@ -18,6 +20,18 @@ function setup() {
|
|||
highlighted = card
|
||||
card.classList.add("highlight")
|
||||
})
|
||||
|
||||
window.addEventListener("message", ({ data }) => {
|
||||
if (data !== "double") {
|
||||
return
|
||||
}
|
||||
for (let card of qs(".card")) {
|
||||
if (card.classList.contains("cat")) {
|
||||
continue
|
||||
}
|
||||
card.textContent = parseInt(card.textContent) * 2
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
setup()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue