-
Notifications
You must be signed in to change notification settings - Fork 95
/
alarm-clock.json
21 lines (21 loc) · 3.24 KB
/
alarm-clock.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
"name": "alarm-clock",
"type": "registry:ui",
"registryDependencies": [],
"dependencies": [
"motion"
],
"devDependencies": [],
"tailwind": {},
"cssVars": {
"light": {},
"dark": {}
},
"files": [
{
"path": "alarm-clock.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 x: 0,\n transition: {\n duration: 0.2,\n type: 'spring',\n stiffness: 200,\n damping: 25,\n },\n },\n animate: {\n y: -1.5,\n x: [-1, 1, -1, 1, -1, 0],\n transition: {\n y: {\n duration: 0.2,\n type: 'spring',\n stiffness: 200,\n damping: 25,\n },\n x: {\n duration: 0.3,\n repeat: Infinity,\n ease: 'linear',\n },\n },\n },\n};\n\nconst secondaryPathVariants: Variants = {\n normal: {\n y: 0,\n x: 0,\n transition: {\n duration: 0.2,\n type: 'spring',\n stiffness: 200,\n damping: 25,\n },\n },\n animate: {\n y: -2.5,\n x: [-2, 2, -2, 2, -2, 0],\n transition: {\n y: {\n duration: 0.2,\n type: 'spring',\n stiffness: 200,\n damping: 25,\n },\n x: {\n duration: 0.3,\n repeat: Infinity,\n ease: 'linear',\n },\n },\n },\n};\n\nconst AlarmClockIcon = () => {\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 variants={pathVariants}\n initial=\"normal\"\n animate={controls}\n d=\"M18 20.5L19.5 22\"\n />\n <motion.path\n variants={pathVariants}\n initial=\"normal\"\n animate={controls}\n d=\"M6 20.5L4.5 22\"\n />\n <motion.path\n variants={pathVariants}\n initial=\"normal\"\n animate={controls}\n d=\"M21 13C21 17.968 16.968 22 12 22C7.032 22 3 17.968 3 13C3 8.032 7.032 4 12 4C16.968 4 21 8.032 21 13Z\"\n />\n <motion.path\n variants={pathVariants}\n initial=\"normal\"\n animate={controls}\n d=\"M15.339 15.862L12.549 14.197C12.063 13.909 11.667 13.216 11.667 12.649V8.95898\"\n />\n <motion.path\n variants={secondaryPathVariants}\n initial=\"normal\"\n animate={controls}\n d=\"M18 2L21.747 5.31064\"\n />\n <motion.path\n variants={secondaryPathVariants}\n initial=\"normal\"\n animate={controls}\n d=\"M6 2L2.25304 5.31064\"\n />\n </svg>\n </div>\n );\n};\n\nexport { AlarmClockIcon };\n",
"type": "registry:ui"
}
]
}