Skip to content

Commit c5d6df3

Browse files
authored
Update README.md
1 parent 12c8338 commit c5d6df3

File tree

1 file changed

+11
-0
lines changed
  • Modern Development/Service Portal Widgets/Konami Code Easter Egg

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
11
# Konami Code Easter Egg
22

33
Put this code in the client controller of a widget to listen for the Konami Code. By default it just opens a modal notifying the user that the konami code as activated. Modify to do whatever fun things you want.
4+
5+
## Version 2
6+
7+
[KonamiCodeEasterEggV2.js]("Modern Development\Service Portal Widgets\Konami Code Easter Egg\KonamiCodeEasterEggV2.js") is the same code but improved with:
8+
9+
1. Uses e.key instead of e.keyCode (which is deprecated) with modern arrow key names
10+
2. Automatically tracks only the last N keypresses instead of manual position tracking
11+
3. Resets the sequence if the user pauses too long (more forgiving UX)
12+
4. Removes event listener when widget is destroyed to prevent memory leaks
13+
5. Uses array join comparison instead of position tracking
14+
6. Modern variable declarations for better scoping

0 commit comments

Comments
 (0)