From e40afd69c59e1540f7c4a760a4eede70c063a3f7 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Thu, 23 Dec 2021 02:27:04 +0100 Subject: [PATCH] word/memory: celebration animation on completion --- word/memory.js | 3 +++ word/memory.plp | 15 +++++++++++++++ 2 files changed, 18 insertions(+) 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 }); -- 2.30.0