|
1 | | -import Image from 'next/image' |
2 | 1 | import { motion } from 'framer-motion' |
| 2 | +import Image from "next/image"; |
3 | 3 |
|
4 | 4 | const Avatar = ({ |
5 | | - className = 'relative flex', |
6 | | - initial = { x: 100, opacity: 0 }, |
7 | | - animate = { x: 0, opacity: 1 }, |
8 | | - whileInView, |
9 | | - transition = { type: 'spring', stiffness: 30, delay: 1 }, |
10 | | - width = 'w-1/2 md:w-1/3 lg:w-1/4 xl:w-3/4', |
11 | | - height = 'h-1/2 md:h-1/3 lg:h-1/4 xl:h-3/4', |
12 | | - shadow = 'shadow-2xl', |
| 5 | + className = "relative flex", |
| 6 | + initial = { x: 100, opacity: 0 }, |
| 7 | + animate = { x: 0, opacity: 1 }, |
| 8 | + whileInView, |
| 9 | + transition = { type: "spring", stiffness: 30, delay: 1 }, |
| 10 | + width = "w-1/2 md:w-1/3 lg:w-1/4 xl:w-3/4", |
| 11 | + height = "h-1/2 md:h-1/3 lg:h-1/4 xl:h-3/4", |
| 12 | + shadow = "shadow-2xl", |
13 | 13 | }) => ( |
14 | | - <motion.div |
15 | | - className={className} |
16 | | - initial={initial} |
17 | | - animate={animate} |
18 | | - whileInView={whileInView} |
19 | | - transition={transition}> |
20 | | - <Image |
21 | | - src={`${process.env.NEXT_PUBLIC_BASE_URL}/img/me.webp`} |
22 | | - priority |
23 | | - loading='eager' |
24 | | - alt='Image of Christian B. Martinez' |
25 | | - width={400} |
26 | | - height={400} |
27 | | - className={`mx-auto ${height} ${width} rounded-full object-cover ${shadow}`} |
28 | | - /> |
29 | | - <div |
30 | | - className={`absolute inset-0 mx-auto h-full ${width} rounded-full bg-purple-600 opacity-25 dark:bg-gradient-to-r dark:from-purple-600 dark:to-pink-500 dark:opacity-35`}></div> |
31 | | - </motion.div> |
| 14 | + <motion.div |
| 15 | + className={className} |
| 16 | + initial={initial} |
| 17 | + animate={animate} |
| 18 | + whileInView={whileInView} |
| 19 | + transition={transition} |
| 20 | + > |
| 21 | + <Image |
| 22 | + src={`${process.env.NEXT_PUBLIC_BASE_URL}/img/me.webp`} |
| 23 | + priority |
| 24 | + loading="eager" |
| 25 | + alt="Image of Christian B. Martinez" |
| 26 | + width={400} |
| 27 | + height={400} |
| 28 | + className={`mx-auto ${height} ${width} rounded-full object-cover ${shadow}`} |
| 29 | + /> |
| 30 | + <div |
| 31 | + className={`absolute inset-0 mx-auto h-full ${width} rounded-full bg-purple-600 opacity-25 dark:bg-gradient-to-r dark:from-purple-600 dark:to-pink-500 dark:opacity-35`} |
| 32 | + /> |
| 33 | + </motion.div> |
32 | 34 | ) |
33 | 35 |
|
34 | 36 | export default Avatar |
0 commit comments