-
Notifications
You must be signed in to change notification settings - Fork 95
/
git-pull-request.json
21 lines (21 loc) · 3.34 KB
/
git-pull-request.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
"name": "git-pull-request",
"type": "registry:ui",
"registryDependencies": [],
"dependencies": [
"motion"
],
"devDependencies": [],
"tailwind": {},
"cssVars": {
"light": {},
"dark": {}
},
"files": [
{
"path": "git-pull-request.tsx",
"content": "'use client';\n\nimport { motion, useAnimation } from 'motion/react';\n\nconst DURATION = 0.3;\n\nconst calculateDelay = (i: number) => {\n if (i === 0) return 0.1;\n\n return i * DURATION + 0.1;\n};\n\nconst GitPullRequestIcon = () => {\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.circle\n cx=\"18\"\n cy=\"18\"\n r=\"3\"\n transition={{\n duration: DURATION,\n delay: calculateDelay(0),\n opacity: { delay: calculateDelay(0) },\n }}\n variants={{\n normal: { pathLength: 1, opacity: 1, transition: { delay: 0 } },\n animate: {\n pathLength: [0, 1],\n opacity: [0, 1],\n },\n }}\n animate={controls}\n />\n <motion.circle\n cx=\"6\"\n cy=\"6\"\n r=\"3\"\n transition={{\n duration: DURATION,\n delay: calculateDelay(2),\n opacity: { delay: calculateDelay(2) },\n }}\n variants={{\n normal: { pathLength: 1, opacity: 1, transition: { delay: 0 } },\n animate: {\n pathLength: [0, 1],\n opacity: [0, 1],\n },\n }}\n animate={controls}\n />\n <motion.path\n d=\"M13 6h3a2 2 0 0 1 2 2v7\"\n transition={{\n duration: DURATION,\n delay: calculateDelay(1),\n opacity: { delay: calculateDelay(1) },\n }}\n variants={{\n normal: {\n pathLength: 1,\n pathOffset: 0,\n opacity: 1,\n transition: { delay: 0 },\n },\n animate: {\n pathLength: [0, 1],\n opacity: [0, 1],\n pathOffset: [1, 0],\n },\n }}\n animate={controls}\n />\n <motion.line\n x1=\"6\"\n x2=\"6\"\n y1=\"9\"\n y2=\"21\"\n transition={{\n duration: DURATION,\n delay: calculateDelay(3),\n opacity: { delay: calculateDelay(3) },\n }}\n variants={{\n normal: { opacity: 1, pathLength: 1, transition: { delay: 0 } },\n animate: {\n opacity: [0, 1],\n pathLength: [0, 1],\n },\n }}\n animate={controls}\n />\n </svg>\n </div>\n );\n};\n\nexport { GitPullRequestIcon };\n",
"type": "registry:ui"
}
]
}