-
Notifications
You must be signed in to change notification settings - Fork 95
/
coffee.json
21 lines (21 loc) · 1.98 KB
/
coffee.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
"name": "coffee",
"type": "registry:ui",
"registryDependencies": [],
"dependencies": [
"motion"
],
"devDependencies": [],
"tailwind": {},
"cssVars": {
"light": {},
"dark": {}
},
"files": [
{
"path": "coffee.tsx",
"content": "'use client';\n\nimport type { Variants } from 'motion/react';\nimport { motion, useAnimation } from 'motion/react';\n\nconst pathVariants: Variants = {\n normal: {\n y: 0,\n opacity: 1,\n },\n animate: (custom: number) => ({\n y: -3,\n opacity: [0, 1, 0],\n transition: {\n repeat: Infinity,\n duration: 1.5,\n ease: 'easeInOut',\n delay: 0.2 * custom,\n },\n }),\n};\n\nconst CoffeeIcon = () => {\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 style={{ overflow: 'visible' }}\n >\n <motion.path\n d=\"M10 2v2\"\n animate={controls}\n variants={pathVariants}\n custom={0.2}\n />\n <motion.path\n d=\"M14 2v2\"\n animate={controls}\n variants={pathVariants}\n custom={0.4}\n />\n <motion.path\n d=\"M6 2v2\"\n animate={controls}\n variants={pathVariants}\n custom={0}\n />\n <path d=\"M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1\" />\n </svg>\n </div>\n );\n};\n\nexport { CoffeeIcon };\n",
"type": "registry:ui"
}
]
}