Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4d8d1d7

Browse files
author
Jin Xu
committed
course wesbos#12 finished
1 parent 605be60 commit 4d8d1d7

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

12 - Key Sequence Detection/index-START.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,16 @@
66
<script type="text/javascript" src="http://www.cornify.com/js/cornify.js"></script>
77
</head>
88
<body>
9+
<p>TYPE: 'wesbos' to active the gifs</p>
910
<script>
11+
const pwd = 'wesbos';
12+
let pressed = Array(Array.from(pwd).length);
13+
14+
window.addEventListener('keyup', e => {
15+
pressed.shift();
16+
pressed.push(e.key);
17+
if(pressed.join('') === pwd) cornify_add();
18+
});
1019
</script>
1120
</body>
1221
</html>

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
9. [x] ~~Dev Tools Domination~~
1616
10. [x] ~~Hold Shift and Check Checkboxes~~
1717
11. [ ] Custom Video Player
18-
12. [ ] Key Sequence Detection
18+
12. [x] ~~Key Sequence Detection~~
1919
13. [ ] Slide in on Scroll
2020
14. [ ] JavaScript References vs. Copying
2121
15. [ ] LocalStorage

0 commit comments

Comments
 (0)