-
Notifications
You must be signed in to change notification settings - Fork 95
/
banana.json
21 lines (21 loc) · 1.96 KB
/
banana.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
"name": "banana",
"type": "registry:ui",
"registryDependencies": [],
"dependencies": [
"motion"
],
"devDependencies": [],
"tailwind": {},
"cssVars": {
"light": {},
"dark": {}
},
"files": [
{
"path": "banana.tsx",
"content": "'use client';\n\nimport type { Transition, Variants } from 'motion/react';\nimport { motion, useAnimation } from 'motion/react';\n\nconst Transition: Transition = {\n duration: 0.3,\n delay: 0.1,\n opacity: { delay: 0.15 },\n};\n\nconst Variants: Variants = {\n normal: {\n pathLength: 1,\n opacity: 1,\n },\n animate: (custom: number) => ({\n pathLength: [0, 1],\n opacity: [0, 1],\n transition: {\n delay: custom * 0.1,\n },\n }),\n};\n\nconst BananaIcon = () => {\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.path\n transition={Transition}\n variants={Variants}\n animate={controls}\n custom={2}\n d=\"M4 13c3.5-2 8-2 10 2a5.5 5.5 0 0 1 8 5\"\n />\n <motion.path\n transition={Transition}\n variants={Variants}\n animate={controls}\n custom={0}\n d=\"M5.15 17.89c5.52-1.52 8.65-6.89 7-12C11.55 4 11.5 2 13 2c3.22 0 5 5.5 5 8 0 6.5-4.2 12-10.49 12C5.11 22 2 22 2 20c0-1.5 1.14-1.55 3.15-2.11Z\"\n />\n </svg>\n </div>\n );\n};\n\nexport { BananaIcon };\n",
"type": "registry:ui"
}
]
}