feat(ui): 添加动画效果并优化界面样式
This commit is contained in:
@@ -5,5 +5,6 @@ export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs))
|
||||
}
|
||||
|
||||
export * from './motion'
|
||||
export * from './request'
|
||||
export * from './tool'
|
||||
|
||||
37
src/lib/motion.ts
Normal file
37
src/lib/motion.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import {motion, type Transition} from 'motion/react'
|
||||
import {Link} from 'react-router-dom'
|
||||
|
||||
const tapTransition: Transition = {
|
||||
type: 'spring',
|
||||
stiffness: 700,
|
||||
damping: 28,
|
||||
mass: 0.55,
|
||||
}
|
||||
|
||||
export const tapMotionProps = {
|
||||
whileTap: {
|
||||
scale: 0.94,
|
||||
opacity: 0.96,
|
||||
},
|
||||
transition: tapTransition,
|
||||
} as const
|
||||
|
||||
export const tapMotionPropsSoft = {
|
||||
whileTap: {
|
||||
scale: 0.965,
|
||||
opacity: 0.98,
|
||||
},
|
||||
transition: tapTransition,
|
||||
} as const
|
||||
|
||||
export const tapMotionPropsIcon = {
|
||||
whileTap: {
|
||||
scale: 0.84,
|
||||
opacity: 0.9,
|
||||
},
|
||||
transition: tapTransition,
|
||||
} as const
|
||||
|
||||
export const MotionButton = motion.button
|
||||
export const MotionDiv = motion.div
|
||||
export const MotionLink = motion.create(Link)
|
||||
Reference in New Issue
Block a user