We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b56e8a1 commit ffe9229Copy full SHA for ffe9229
chapter_fifteen_balloon/script.js
@@ -15,12 +15,20 @@ function explode() {
15
balloon.innerText = "💥";
16
}
17
18
-window.addEventListener('keydown', (e) => {
19
- console.log(e.key);
+function controlSize(e) {
20
if (e.key == `ArrowUp`) {
21
inflate();
22
} else if (e.key = 'ArrowDown') {
23
deflate();
+ }}
24
+
25
+window.addEventListener('keydown', controlSize);
26
27
+window.addEventListener('keydown', () => {
28
+ let currentSize = Number(balloon.style.fontSize.match(/\d+/g))
29
+ if (currentSize > 240) {
30
+ explode();
31
+ window.removeEventListener('keydown', controlSize);
32
33
})
34
0 commit comments