mirror of
https://github.com/mileswolfallen2/miles-web.git
synced 2026-09-08 11:23:17 +00:00
Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -71,6 +71,24 @@
|
||||
});
|
||||
})();
|
||||
|
||||
/* GAMES PAGE EASTER EGG: g, a, m, e, s */
|
||||
(function(){
|
||||
const seq = ['g','a','m','e','s'];
|
||||
let pos = 0;
|
||||
window.addEventListener('keydown', function(e){
|
||||
const key = e.key.length === 1 ? e.key.toLowerCase() : e.key;
|
||||
if (key === seq[pos]) {
|
||||
pos++;
|
||||
if (pos === seq.length) {
|
||||
pos = 0;
|
||||
window.location.href = '/games.html';
|
||||
}
|
||||
} else {
|
||||
pos = (key === seq[0]) ? 1 : 0;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
/* CURSOR */
|
||||
(function(){
|
||||
const dot = document.getElementById('cursorDot');
|
||||
|
||||
Reference in New Issue
Block a user