refactor: command center positioning

This commit is contained in:
tglide committed 2023-05-16 10:51:07 +01:00
1 parent 6874ab276f
commit d01c078cd9
2 files changed
+12 -3

No files matched your search

+6 -3
View File
@@ -86,15 +86,18 @@
padding: 0.5rem;
position: fixed;
inset: 0;
background-color: hsl(var(--color-neutral-500) / 0.5);
z-index: 9999;
display: grid;
place-items: center;
}
.card {
min-width: 400px;
padding: 0.5rem;
position: absolute;
top: clamp(128px, 20vh, 400px);
left: 50%;
translate: -50%;
}
</style>
+6
View File
@@ -1,4 +1,5 @@
<script lang="ts">
import { afterNavigate } from '$app/navigation';
import Dialog from '$lib/components/dialog.svelte';
import { commands, disableCommands, registerCommand } from '$lib/helpers/commandCenter';
import { isMac } from '$lib/helpers/platform';
@@ -56,6 +57,11 @@
duration: 150,
easing: quadOut
});
afterNavigate(() => {
open = false;
search = '';
});
</script>
<svelte:window on:keydown={handleKeyDown} />