-
Notifications
You must be signed in to change notification settings - Fork 95
/
chrome.json
21 lines (21 loc) · 2.29 KB
/
chrome.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
"name": "chrome",
"type": "registry:ui",
"registryDependencies": [],
"dependencies": [
"motion"
],
"devDependencies": [],
"tailwind": {},
"cssVars": {
"light": {},
"dark": {}
},
"files": [
{
"path": "chrome.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 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 ...transition,\n delay: 0.1 * custom,\n },\n }),\n};\n\nconst ChromeIcon = () => {\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 <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <motion.circle\n cx=\"12\"\n cy=\"12\"\n r=\"4\"\n variants={variants}\n animate={controls}\n custom={0}\n />\n <motion.line\n x1=\"21.17\"\n x2=\"12\"\n y1=\"8\"\n y2=\"8\"\n variants={variants}\n animate={controls}\n custom={3}\n />\n <motion.line\n x1=\"3.95\"\n x2=\"8.54\"\n y1=\"6.06\"\n y2=\"14\"\n variants={variants}\n animate={controls}\n custom={3}\n />\n <motion.line\n x1=\"10.88\"\n x2=\"15.46\"\n y1=\"21.94\"\n y2=\"14\"\n variants={variants}\n animate={controls}\n custom={3}\n />\n </svg>\n </div>\n );\n};\n\nexport { ChromeIcon };\n",
"type": "registry:ui"
}
]
}