Files
hnh-map/frontend-nuxt/components/map/MapShortcutsOverlay.vue
Nikolay Tatarinov 52c34ef8f2 Enhance map functionality with bookmark features and UI improvements
- Introduced a new MapBookmarkNameModal for adding and editing bookmarks.
- Updated MapView to manage selected markers for bookmarking and handle bookmark name submissions.
- Enhanced MapContextMenu with an option to add markers to bookmarks.
- Improved MapBookmarks component to support editing bookmark names and adding selected markers.
- Refactored MapControls and MapControlsContent to integrate selected marker functionality for bookmarks.
- Updated useMapBookmarks composable to include bookmark updating logic.
- Removed unused grid coordinates toggle from the UI for a cleaner interface.
2026-03-03 20:05:42 +03:00

81 lines
2.8 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<Teleport to="body">
<Transition name="shortcuts-modal">
<div
v-if="open"
class="fixed inset-0 z-[1200] flex items-center justify-center p-4 bg-black/50"
role="dialog"
aria-modal="true"
aria-label="Keyboard shortcuts"
@click.self="$emit('close')"
>
<div
class="bg-base-100 rounded-xl shadow-2xl border border-base-300 max-w-md w-full p-6"
@click.stop
>
<div class="flex items-center justify-between mb-4">
<h2 class="text-lg font-semibold flex items-center gap-2">
<icons-icon-keyboard class="size-5" />
Keyboard shortcuts
</h2>
<button
type="button"
class="btn btn-ghost btn-sm btn-circle"
aria-label="Close"
@click="$emit('close')"
>
×
</button>
</div>
<dl class="space-y-2 text-sm">
<div class="flex justify-between gap-4 py-1 border-b border-base-300/50">
<dt class="text-base-content/80"><kbd class="kbd kbd-sm">?</kbd></dt>
<dd>Show this help</dd>
</div>
<div class="flex justify-between gap-4 py-1 border-b border-base-300/50">
<dt class="text-base-content/80"><kbd class="kbd kbd-sm">+</kbd> / <kbd class="kbd kbd-sm"></kbd></dt>
<dd>Zoom in / out</dd>
</div>
<div class="flex justify-between gap-4 py-1 border-b border-base-300/50">
<dt class="text-base-content/80"><kbd class="kbd kbd-sm">H</kbd></dt>
<dd>Toggle markers visibility</dd>
</div>
<div class="flex justify-between gap-4 py-1 border-b border-base-300/50">
<dt class="text-base-content/80"><kbd class="kbd kbd-sm">F</kbd></dt>
<dd>Focus search</dd>
</div>
<div class="flex justify-between gap-4 py-1">
<dt class="text-base-content/80"><kbd class="kbd kbd-sm">Esc</kbd></dt>
<dd>Close menus / overlay</dd>
</div>
</dl>
</div>
</div>
</Transition>
</Teleport>
</template>
<script setup lang="ts">
defineProps<{ open: boolean }>()
defineEmits<{ close: [] }>()
</script>
<style scoped>
.shortcuts-modal-enter-active,
.shortcuts-modal-leave-active {
transition: opacity 0.2s ease;
}
.shortcuts-modal-enter-from,
.shortcuts-modal-leave-to {
opacity: 0;
}
.shortcuts-modal-enter-active .bg-base-100,
.shortcuts-modal-leave-active .bg-base-100 {
transition: transform 0.2s ease;
}
.shortcuts-modal-enter-from .bg-base-100,
.shortcuts-modal-leave-to .bg-base-100 {
transform: scale(0.95);
}
</style>