mirror of
https://github.com/cupcakearmy/old.nicco.io.git
synced 2026-04-02 11:55:34 +00:00
migrated to nextjs
This commit is contained in:
25
components/Cursor.tsx
Normal file
25
components/Cursor.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
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
|
||||
Reference in New Issue
Block a user