feat(ControlsWrapper): close ControlsWrapper on escape click
This commit is contained in:
@@ -57,6 +57,10 @@ function handleKeyDown(e: KeyboardEvent) {
|
||||
e.preventDefault();
|
||||
handleWrapperClick();
|
||||
}
|
||||
|
||||
if (isActive && e.key === 'Escape') {
|
||||
isActive = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Movement Logic
|
||||
@@ -215,27 +219,3 @@ $effect(() => {
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
@keyframes nudge {
|
||||
0%, 100% {
|
||||
transform: translateY(0) scale(1) rotate(0deg);
|
||||
}
|
||||
2% {
|
||||
transform: translateY(-2px) scale(1.1) rotate(-1deg);
|
||||
}
|
||||
4% {
|
||||
transform: translateY(0) scale(1) rotate(1deg);
|
||||
}
|
||||
6% {
|
||||
transform: translateY(-2px) scale(1.1) rotate(0deg);
|
||||
}
|
||||
8% {
|
||||
transform: translateY(0) scale(1) rotate(0deg);
|
||||
}
|
||||
}
|
||||
|
||||
.animate-nudge {
|
||||
animation: nudge 10s ease-in-out infinite;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user