-
Notifications
You must be signed in to change notification settings - Fork 95
/
angry.json
21 lines (21 loc) · 2.96 KB
/
angry.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
"name": "angry",
"type": "registry:ui",
"registryDependencies": [],
"dependencies": [
"motion"
],
"devDependencies": [],
"tailwind": {},
"cssVars": {
"light": {},
"dark": {}
},
"files": [
{
"path": "angry.tsx",
"content": "'use client';\n\nimport type { Variants } from 'motion/react';\nimport { motion, useAnimation } from 'motion/react';\n\nconst EYEBROW_ROTATION = 20;\nconst DURATION = 0.6;\n\nconst pathVariantsFace: Variants = {\n normal: { scale: 1, rotate: 0 },\n animate: {\n scale: [1, 1.2, 1.2, 1.2, 1],\n rotate: [0, -3, 3, -1, 1, 0],\n transition: {\n duration: DURATION,\n times: [0, 0.2, 0.4, 0.6, 1],\n ease: 'easeInOut',\n },\n },\n};\n\nconst pathVariantsLeftEyebrow: Variants = {\n normal: { rotate: 0 },\n animate: {\n rotate: [0, EYEBROW_ROTATION, 0],\n transition: {\n duration: DURATION + 0.2,\n },\n },\n};\n\nconst pathVariantsRightEyebrow: Variants = {\n normal: { rotate: 0 },\n animate: {\n rotate: [0, -EYEBROW_ROTATION, 0],\n transition: {\n duration: DURATION + 0.2,\n },\n },\n};\n\nconst pathVariantsEye: Variants = {\n normal: { scale: 1 },\n animate: {\n scale: [1, 1.2, 1],\n transition: {\n duration: DURATION,\n },\n },\n};\n\nconst pathVariantsMouth: Variants = {\n normal: { translateY: 0 },\n animate: {\n translateY: [0, -0.5, 0],\n transition: {\n duration: DURATION,\n },\n },\n};\n\nconst AngryIcon = () => {\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 <motion.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 animate={controls}\n variants={pathVariantsFace}\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <motion.path\n variants={pathVariantsMouth}\n animate={controls}\n d=\"M16 16s-1.5-2-4-2-4 2-4 2\"\n />\n <motion.path\n variants={pathVariantsLeftEyebrow}\n animate={controls}\n d=\"M7.5 8 10 9\"\n />\n <motion.path\n variants={pathVariantsRightEyebrow}\n animate={controls}\n d=\"m14 9 2.5-1\"\n />\n <motion.path\n variants={pathVariantsEye}\n animate={controls}\n d=\"M9 10h.01\"\n />\n <motion.path\n variants={pathVariantsEye}\n animate={controls}\n d=\"M15 10h.01\"\n />\n </motion.svg>\n </div>\n );\n};\n\nexport { AngryIcon };\n",
"type": "registry:ui"
}
]
}