Add keydown event listener to hide spirit info on Escape press
This commit is contained in:
@@ -517,3 +517,10 @@ function animate() {
|
|||||||
composer.render(scene, camera);
|
composer.render(scene, camera);
|
||||||
requestAnimationFrame(animate);
|
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