mirror of
https://github.com/cupcakearmy/old.nicco.io.git
synced 2025-09-06 02:30:46 +00:00
check if mouse if set
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
type Size = { width: number, height: number }
|
type Size = { width: number, height: number }
|
||||||
export const useInnerWindowSize = (): Size => {
|
export const useInnerWindowSize = (): Size => {
|
||||||
const getCurrentSize = (): Size => ({
|
const getCurrentSize = (): Size => ({
|
||||||
@@ -19,7 +21,7 @@ export const useInnerWindowSize = (): Size => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const useIsMousePresent = () => {
|
export const useIsMousePresent = () => {
|
||||||
let [present, setPresent] = useState<boolean>(false)
|
let [present, setPresent] = useState<boolean>(!('ontouchstart' in window) && ('onmousemove' in window))
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const enter = () => setPresent(true)
|
const enter = () => setPresent(true)
|
||||||
|
Reference in New Issue
Block a user