diff --git a/app/pages/index.vue b/app/pages/index.vue index 4421dc7d5..e31f1a8d8 100644 --- a/app/pages/index.vue +++ b/app/pages/index.vue @@ -3,6 +3,7 @@ import { SHOWCASED_FRAMEWORKS } from '~/utils/frameworks' const { model: searchQuery, flushUpdateUrlQuery } = useGlobalSearch() const isSearchFocused = shallowRef(false) +const inputWrapperRef = useTemplateRef('inputWrapper') async function search() { flushUpdateUrlQuery() @@ -24,6 +25,16 @@ defineOgImageComponent('Default', { title: 'npmx', description: 'a fast, modern browser for the **npm registry**', }) + +function onMouseMove(event: MouseEvent) { + const inputWrapper = inputWrapperRef.value + if (!inputWrapper) return + const rect = inputWrapper.getBoundingClientRect() + const x = event.clientX - rect.left + const y = event.clientY - rect.top + inputWrapper.style.setProperty('--mouse-x', `${x}px`) + inputWrapper.style.setProperty('--mouse-y', `${y}px`) +}