mirror of
https://github.com/cupcakearmy/old.nicco.io.git
synced 2024-11-01 08:34:13 +01:00
22 lines
473 B
TypeScript
22 lines
473 B
TypeScript
|
import React from 'react'
|
||
|
import { useIsMousePresent, useMousePosition } from '../util'
|
||
|
|
||
|
const Cursor: React.FC = () => {
|
||
|
const mouse = useMousePosition()
|
||
|
const present = useIsMousePresent()
|
||
|
|
||
|
return present
|
||
|
? <span style={{
|
||
|
position: 'fixed',
|
||
|
top: mouse.absolute.y,
|
||
|
left: mouse.absolute.x,
|
||
|
width: '1em',
|
||
|
height: '1em',
|
||
|
borderRadius: '1em',
|
||
|
transform: 'translate(-50%, -50%)',
|
||
|
backgroundColor: '#000000',
|
||
|
}}/>
|
||
|
: null
|
||
|
}
|
||
|
|
||
|
export default Cursor
|