-
Notifications
You must be signed in to change notification settings - Fork 95
/
instagram.json
21 lines (21 loc) · 3.3 KB
/
instagram.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
"name": "instagram",
"type": "registry:ui",
"registryDependencies": [],
"dependencies": [
"motion"
],
"devDependencies": [],
"tailwind": {},
"cssVars": {
"light": {},
"dark": {}
},
"files": [
{
"path": "instagram.tsx",
"content": "'use client';\n\nimport { motion, useAnimation } from 'motion/react';\nimport type { Variants } from 'motion/react';\n\nconst rectVariants: Variants = {\n normal: {\n opacity: 1,\n pathLength: 1,\n pathOffset: 0,\n transition: {\n duration: 0.4,\n opacity: { duration: 0.1 },\n },\n },\n animate: {\n opacity: [0, 1],\n pathLength: [0, 1],\n pathOffset: [1, 0],\n transition: {\n duration: 0.6,\n ease: 'linear',\n opacity: { duration: 0.1 },\n },\n },\n};\n\nconst pathVariants: Variants = {\n normal: {\n opacity: 1,\n pathLength: 1,\n pathOffset: 0,\n transition: {\n duration: 0.4,\n opacity: { duration: 0.1 },\n },\n },\n animate: {\n opacity: [0, 1],\n pathLength: [0, 1],\n pathOffset: [1, 0],\n transition: {\n duration: 0.6,\n ease: 'linear',\n opacity: { duration: 0.1 },\n },\n },\n};\n\nconst lineVariants: Variants = {\n normal: {\n opacity: 1,\n pathLength: 1,\n pathOffset: 0,\n transition: {\n duration: 0.4,\n opacity: { duration: 0.1 },\n },\n },\n animate: {\n opacity: [0, 1],\n pathLength: [0, 1],\n pathOffset: [1, 0],\n transition: {\n duration: 0.6,\n ease: 'linear',\n opacity: { duration: 0.1 },\n },\n },\n};\n\nconst InstagramIcon = () => {\n const rectControls = useAnimation();\n const pathControls = useAnimation();\n const lineControls = useAnimation();\n\n const handleMouseEnter = () => {\n rectControls.start('animate');\n pathControls.start('animate');\n lineControls.start('animate');\n };\n\n const handleMouseLeave = () => {\n rectControls.start('normal');\n pathControls.start('normal');\n lineControls.start('normal');\n };\n\n return (\n <div\n className=\"cursor-pointer select-none p-2 hover:bg-accent rounded-md transition-colors duration-200 flex items-center justify-center\"\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"28\"\n height=\"28\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <motion.rect\n variants={rectVariants}\n initial=\"normal\"\n animate={rectControls}\n x=\"2\"\n y=\"2\"\n width=\"20\"\n height=\"20\"\n rx=\"5\"\n ry=\"5\"\n />\n <motion.path\n variants={pathVariants}\n initial=\"normal\"\n animate={pathControls}\n d=\"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z\"\n />\n <motion.line\n variants={lineVariants}\n initial=\"normal\"\n animate={lineControls}\n x1=\"17.5\"\n y1=\"6.5\"\n x2=\"17.51\"\n y2=\"6.5\"\n />\n </svg>\n </div>\n );\n};\n\nexport { InstagramIcon };\n",
"type": "registry:ui"
}
]
}