search v1
All checks were successful
Deploy App / build (push) Successful in 1m5s
Deploy App / deploy (push) Successful in 14s

This commit is contained in:
valere
2025-10-16 01:45:28 +02:00
parent 3ad8cb8795
commit 0aa1a57b78
6 changed files with 265 additions and 2 deletions

View File

@@ -0,0 +1,17 @@
import { useUiStore } from '~/store/ui'
export default defineNuxtPlugin((nuxtApp) => {
const ui = useUiStore()
const isMobile = nuxtApp.$isMobile as boolean | undefined
const onKeyDown = (e: KeyboardEvent) => {
if ((e.metaKey || e.ctrlKey) && (e.key === 'f' || e.key === 'F')) {
if (isMobile) return
e.preventDefault()
if (!ui.showSearch) ui.openSearch()
}
}
if (process.client) {
window.addEventListener('keydown', onKeyDown)
}
})