-
Notifications
You must be signed in to change notification settings - Fork 95
/
earth.json
21 lines (21 loc) · 3.12 KB
/
earth.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
"name": "earth",
"type": "registry:ui",
"registryDependencies": [],
"dependencies": [
"motion"
],
"devDependencies": [],
"tailwind": {},
"cssVars": {
"light": {},
"dark": {}
},
"files": [
{
"path": "earth.tsx",
"content": "'use client';\n\nimport type { Transition, Variants } from 'motion/react';\nimport { motion, useAnimation } from 'motion/react';\n\nconst circleTransition: Transition = {\n duration: 0.3,\n delay: 0.1,\n opacity: { delay: 0.15 },\n};\n\nconst circleVariants: Variants = {\n normal: {\n pathLength: 1,\n opacity: 1,\n },\n animate: {\n pathLength: [0, 1],\n opacity: [0, 1],\n },\n};\n\nconst EarthIcon = () => {\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 animate={controls}\n d=\"M21.54 15H17a2 2 0 0 0-2 2v4.54\"\n transition={{ duration: 0.7, delay: 0.5, opacity: { delay: 0.5 } }}\n variants={{\n normal: {\n pathLength: 1,\n opacity: 1,\n pathOffset: 0,\n },\n animate: {\n pathLength: [0, 1],\n opacity: [0, 1],\n pathOffset: [1, 0],\n },\n }}\n />\n <motion.path\n animate={controls}\n d=\"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17\"\n transition={{ duration: 0.7, delay: 0.5, opacity: { delay: 0.5 } }}\n variants={{\n normal: {\n pathLength: 1,\n opacity: 1,\n pathOffset: 0,\n },\n animate: {\n pathLength: [0, 1],\n opacity: [0, 1],\n pathOffset: [1, 0],\n },\n }}\n />\n <motion.path\n animate={controls}\n d=\"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05\"\n transition={{ duration: 0.7, delay: 0.5, opacity: { delay: 0.5 } }}\n variants={{\n normal: {\n pathLength: 1,\n opacity: 1,\n pathOffset: 0,\n },\n animate: {\n pathLength: [0, 1],\n opacity: [0, 1],\n pathOffset: [1, 0],\n },\n }}\n />\n <motion.circle\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n transition={circleTransition}\n variants={circleVariants}\n animate={controls}\n />\n </svg>\n </div>\n );\n};\n\nexport { EarthIcon };\n",
"type": "registry:ui"
}
]
}