-
Notifications
You must be signed in to change notification settings - Fork 95
/
figma.json
21 lines (21 loc) · 2.5 KB
/
figma.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
"name": "figma",
"type": "registry:ui",
"registryDependencies": [],
"dependencies": [
"motion"
],
"devDependencies": [],
"tailwind": {},
"cssVars": {
"light": {},
"dark": {}
},
"files": [
{
"path": "figma.tsx",
"content": "'use client';\n\nimport type { Variants } from 'motion/react';\nimport { motion, useAnimation } from 'motion/react';\n\nconst variants: Variants = {\n normal: {\n pathLength: 1,\n opacity: 1,\n },\n animate: {\n pathLength: [0, 1],\n opacity: [0, 1],\n transition: {\n delay: 0.3,\n duration: 0.5,\n opacity: { delay: 0.25 },\n },\n },\n};\n\nconst FigmaIcon = () => {\n const controls = useAnimation();\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={() => controls.start('animate')}\n onMouseLeave={() => controls.start('normal')}\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.g\n style={{ transformOrigin: '50% 50%' }}\n variants={{\n normal: {\n rotateY: 0,\n transition: {\n duration: 0.5,\n ease: 'linear',\n },\n },\n animate: {\n rotateY: 360,\n transition: {\n duration: 0.8,\n ease: 'linear',\n },\n },\n }}\n animate={controls}\n >\n <path d=\"M5 5.5A3.5 3.5 0 0 1 8.5 2H12v7H8.5A3.5 3.5 0 0 1 5 5.5z\" />\n <path d=\"M12 2h3.5a3.5 3.5 0 1 1 0 7H12V2z\" />\n </motion.g>\n <motion.path\n d=\"M12 12.5a3.5 3.5 0 1 1 7 0 3.5 3.5 0 1 1-7 0z\"\n variants={variants}\n animate={controls}\n />\n <motion.path\n d=\"M5 19.5A3.5 3.5 0 0 1 8.5 16H12v3.5a3.5 3.5 0 1 1-7 0z\"\n variants={variants}\n animate={controls}\n />\n <motion.path\n d=\"M5 12.5A3.5 3.5 0 0 1 8.5 9H12v7H8.5A3.5 3.5 0 0 1 5 12.5z\"\n variants={variants}\n animate={controls}\n />\n </svg>\n </div>\n );\n};\n\nexport { FigmaIcon };\n",
"type": "registry:ui"
}
]
}