word/memory: celebration animation on completion
[sheet.git] / word / memory.js
index 0e523a1c7857fa7832abd14d6f180dd7a13ca27a..c3adfd4590d3d7dd6e4edc519620a84b8442b78f 100644 (file)
@@ -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;
                }