Add keydown event listener to hide spirit info on Escape press
This commit is contained in:
@@ -516,4 +516,11 @@ function animate() {
|
||||
|
||||
composer.render(scene, camera);
|
||||
requestAnimationFrame(animate);
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener('keydown', (e) => {
|
||||
if (e.key === 'Escape') {
|
||||
let el = document.getElementById('spirit-info');
|
||||
if (el) el.style.display = "none";
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user