From: Mischa POSLAWSKY Date: Thu, 23 Dec 2021 01:27:04 +0000 (+0100) Subject: word/memory: celebration animation on completion X-Git-Tag: v1.13~73 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/e40afd69c59e1540f7c4a760a4eede70c063a3f7 word/memory: celebration animation on completion --- diff --git a/word/memory.js b/word/memory.js index 0e523a1..c3adfd4 100644 --- a/word/memory.js +++ b/word/memory.js @@ -26,6 +26,9 @@ class WordMemory { // lock both as correct this.turned.forEach(card => put(card, '.good![onclick]')); this.turned = []; + if (Array.from(this.form.children).every(card => card.classList.contains('good'))) { + put(this.form, '.good'); + } return; } diff --git a/word/memory.plp b/word/memory.plp index 8847713..1bb8ceb 100644 --- a/word/memory.plp +++ b/word/memory.plp @@ -6,6 +6,10 @@ Html({ EOT });