mirror of
https://github.com/cupcakearmy/old.nicco.io.git
synced 2024-11-01 08:34:13 +01:00
25 lines
484 B
TypeScript
25 lines
484 B
TypeScript
import React from 'react'
|
|
|
|
import { useIsMousePresent, useMousePosition } from '../utils/hooks'
|
|
|
|
|
|
|
|
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 |