@@ -41,50 +41,47 @@ const Mouse = () => {
4141 } , [ ] )
4242
4343 useEffect ( ( ) => {
44- if ( ! ( / A n d r o i d | w e b O S | i P h o n e | i P a d | i P o d | B l a c k B e r r y | I E M o b i l e | O p e r a M i n i / i. test ( navigator . userAgent ) ) ) {
45-
46- cursor . current . style . borderWidth = `2px`
47- const a = document . querySelectorAll ( 'a' )
48- a . forEach ( el => {
49- el . addEventListener ( "mouseenter" , event => {
50- cursor . current . style . width = cssVar ( '--cursor-hover-size' )
51- cursor . current . style . height = cssVar ( '--cursor-hover-size' )
52- cursor . current . style . color = cssVar ( '--color-active-2' )
53- } )
54- el . addEventListener ( "mouseleave" , event => {
55- cursor . current . style . width = cssVar ( '--cursor-size' )
56- cursor . current . style . height = cssVar ( '--cursor-size' )
57- cursor . current . style . color = 'inherit'
58- } )
44+ cursor . current . style . borderWidth = `2px`
45+ const a = document . querySelectorAll ( 'a' )
46+ a . forEach ( el => {
47+ el . addEventListener ( "mouseenter" , event => {
48+ cursor . current . style . width = cssVar ( '--cursor-hover-size' )
49+ cursor . current . style . height = cssVar ( '--cursor-hover-size' )
50+ cursor . current . style . color = cssVar ( '--color-active-2' )
51+ } )
52+ el . addEventListener ( "mouseleave" , event => {
53+ cursor . current . style . width = cssVar ( '--cursor-size' )
54+ cursor . current . style . height = cssVar ( '--cursor-size' )
55+ cursor . current . style . color = 'inherit'
5956 } )
57+ } )
6058
61- //back filter
62- const filters = document . querySelectorAll ( '[data-cursor-filter]' )
63- filters . forEach ( el => {
64- el . style . cursor = "none"
65- el . addEventListener ( "mouseenter" , event => {
66- cursor . current . style . backdropFilter = el . dataset . cursorFilter
67- cursor . current . style . borderWidth = 0
68- } )
69- el . addEventListener ( "mouseleave" , event => {
70- cursor . current . style . backdropFilter = ''
71- cursor . current . style . borderWidth = `2px`
72- } )
59+ //back filter
60+ const filters = document . querySelectorAll ( '[data-cursor-filter]' )
61+ filters . forEach ( el => {
62+ el . style . cursor = "none"
63+ el . addEventListener ( "mouseenter" , event => {
64+ cursor . current . style . backdropFilter = el . dataset . cursorFilter
65+ cursor . current . style . borderWidth = 0
66+ } )
67+ el . addEventListener ( "mouseleave" , event => {
68+ cursor . current . style . backdropFilter = ''
69+ cursor . current . style . borderWidth = `2px`
7370 } )
71+ } )
7472
75- //size
76- const sizes = document . querySelectorAll ( '[data-cursor-size]' )
77- sizes . forEach ( el => {
78- el . addEventListener ( "mouseenter" , event => {
79- cursor . current . style . width = el . dataset . cursorSize
80- cursor . current . style . height = el . dataset . cursorSize
81- } )
82- el . addEventListener ( "mouseleave" , event => {
83- cursor . current . style . width = cssVar ( '--cursor-size' )
84- cursor . current . style . height = cssVar ( '--cursor-size' )
85- } )
73+ //size
74+ const sizes = document . querySelectorAll ( '[data-cursor-size]' )
75+ sizes . forEach ( el => {
76+ el . addEventListener ( "mouseenter" , event => {
77+ cursor . current . style . width = el . dataset . cursorSize
78+ cursor . current . style . height = el . dataset . cursorSize
79+ } )
80+ el . addEventListener ( "mouseleave" , event => {
81+ cursor . current . style . width = cssVar ( '--cursor-size' )
82+ cursor . current . style . height = cssVar ( '--cursor-size' )
8683 } )
87- }
84+ } )
8885 return ( ) => { }
8986
9087 } , [ path ] )
0 commit comments