11import { cn } from "@/lib/utils" ;
22import { createContext , ReactNode , RefObject , useContext , useEffect , useRef , useState } from "react" ;
3- import { IconSearch , IconRefresh } from "@tabler/icons-react" ;
3+ import { IconSearch , IconRefresh , IconAlertTriangle , IconRosetteDiscountCheck } from "@tabler/icons-react" ;
44import { AnimatePresence , motion , Variants } from "motion/react" ;
55
6- type CursorType = "default" | "link" | "button" ;
6+ type CursorType = "default" | "link" | "button" | "alert" | "check" ;
77
88interface CursorTriggerProps extends React . HTMLAttributes < HTMLDivElement > {
99 type : CursorType ;
@@ -57,17 +57,17 @@ export default function HoverCursor() {
5757 < CursorProvider >
5858 < div className = "cursor-wrapper relative w-full h-full overflow-hidden flex items-center justify-center p-5" >
5959 < div className = "grid grid-cols-2 gap-5 items-center justify-center w-full h-full" >
60- < CursorTrigger type = "button" className = "w-full h-full bg-fuchsia -300 rounded-2xl p-5" >
61- < button > button - 1 </ button >
60+ < CursorTrigger type = "button" className = "w-full h-full bg-blue -300 rounded-2xl p-5" >
61+ < button > </ button >
6262 </ CursorTrigger >
63- < CursorTrigger type = "link" className = "w-full h-full bg-fuchsia -400 rounded-2xl p-5" >
64- < button > button - 2 </ button >
63+ < CursorTrigger type = "link" className = "w-full h-full bg-blue -400 rounded-2xl p-5" >
64+ < button > </ button >
6565 </ CursorTrigger >
66- < CursorTrigger type = "default " className = "w-full h-full bg-fuchsia-600 rounded-2xl p-5" >
67- < button > button - 3 </ button >
66+ < CursorTrigger type = "alert " className = "w-full h-full bg-blue-500 rounded-2xl p-5" >
67+ < button > </ button >
6868 </ CursorTrigger >
69- < CursorTrigger type = "default " className = "w-full h-full bg-fuchsia-700 rounded-2xl p-5" >
70- < button > button - 4 </ button >
69+ < CursorTrigger type = "check " className = "w-full h-full bg-blue-600 rounded-2xl p-5" >
70+ < button > </ button >
7171 </ CursorTrigger >
7272 </ div >
7373 </ div >
@@ -107,7 +107,9 @@ const Cursor = () => {
107107 const cursorConfig : Record < CursorType , ReactNode > = {
108108 'default' : '' ,
109109 'link' : < IconSearch className = "w-full h-full" /> ,
110- 'button' : < IconRefresh className = "w-full h-full" />
110+ 'button' : < IconRefresh className = "w-full h-full" /> ,
111+ 'alert' : < IconAlertTriangle className = "w-full h-full" /> ,
112+ 'check' : < IconRosetteDiscountCheck className = "w-full h-full" />
111113 } ;
112114
113115 const variants : Variants = {
@@ -129,8 +131,21 @@ const Cursor = () => {
129131 borderRadius : 50 ,
130132 width : 48 ,
131133 height : 48 ,
132- background : "#22c55e" ,
134+ background : "#666" ,
135+ color : "#fafafa"
136+ } ,
137+ alert : {
138+ borderRadius : 50 ,
139+ width : 48 ,
140+ height : 48 ,
141+ background : "#f43f5e" ,
133142 color : "#fafafa"
143+ } ,
144+ check : {
145+ borderRadius : 50 ,
146+ width : 48 ,
147+ height : 48 ,
148+ background : "#22c55e" ,
134149 }
135150 } ;
136151
0 commit comments