({
mouseX,
mouseY,
...gridProps
}: Resource['pattern'] & {
mouseX: MotionValue<number>;
mouseY: MotionValue<number>;
})
| 102 | } |
| 103 | |
| 104 | function ResourcePattern({ |
| 105 | mouseX, |
| 106 | mouseY, |
| 107 | ...gridProps |
| 108 | }: Resource['pattern'] & { |
| 109 | mouseX: MotionValue<number>; |
| 110 | mouseY: MotionValue<number>; |
| 111 | }) { |
| 112 | let maskImage = useMotionTemplate`radial-gradient(180px at ${mouseX}px ${mouseY}px, white, transparent)`; |
| 113 | let style = { maskImage, WebkitMaskImage: maskImage }; |
| 114 | |
| 115 | return ( |
| 116 | <div className="pointer-events-none"> |
| 117 | <div className="absolute inset-0 rounded-2xl transition duration-300 [mask-image:linear-gradient(white,transparent)] group-hover:opacity-50"> |
| 118 | <GridPattern |
| 119 | width={72} |
| 120 | height={56} |
| 121 | x="50%" |
| 122 | className="absolute inset-x-0 inset-y-[-30%] h-[160%] w-full skew-y-[-18deg] fill-black/[0.02] stroke-black/5 dark:fill-white/1 dark:stroke-white/2.5" |
| 123 | {...gridProps} |
| 124 | /> |
| 125 | </div> |
| 126 | <motion.div |
| 127 | className="absolute inset-0 rounded-2xl bg-gradient-to-r from-[#fad000]/25 to-[#19182E]/10 opacity-0 transition duration-300 group-hover:opacity-100 dark:from-[#fad000]/30 dark:to-[#19182E]/80" |
| 128 | style={style} |
| 129 | /> |
| 130 | <motion.div |
| 131 | className="absolute inset-0 rounded-2xl opacity-0 mix-blend-overlay transition duration-300 group-hover:opacity-100" |
| 132 | style={style} |
| 133 | > |
| 134 | <GridPattern |
| 135 | width={72} |
| 136 | height={56} |
| 137 | x="50%" |
| 138 | className="absolute inset-x-0 inset-y-[-30%] h-[160%] w-full skew-y-[-18deg] fill-black/50 stroke-black/70 dark:fill-white/2.5 dark:stroke-white/10" |
| 139 | {...gridProps} |
| 140 | /> |
| 141 | </motion.div> |
| 142 | </div> |
| 143 | ); |
| 144 | } |
| 145 | |
| 146 | function Resource({ resource }: { resource: Resource }) { |
| 147 | let mouseX = useMotionValue(0); |
nothing calls this directly
no outgoing calls
no test coverage detected