41 lines
1.0 KiB
TypeScript
Raw Normal View History

2022-10-28 20:29:04 +08:00
import { css, cx } from '@emotion/css'
import persistedUiStates from '@/web/states/persistedUiStates'
2022-05-12 02:45:43 +08:00
import { useSnapshot } from 'valtio'
2022-10-28 20:29:04 +08:00
import NowPlaying from './NowPlaying'
import PlayingNext from './PlayingNext'
import { AnimatePresence, motion, MotionConfig } from 'framer-motion'
import { ease } from '@/web/utils/const'
2022-03-13 14:40:38 +08:00
2022-10-28 20:29:04 +08:00
const Player = () => {
const { minimizePlayer } = useSnapshot(persistedUiStates)
2022-03-13 14:40:38 +08:00
return (
2022-10-28 20:29:04 +08:00
<MotionConfig transition={{ duration: 0.6 }}>
<div
className={cx(
'fixed right-6 bottom-6 flex w-full flex-col justify-between overflow-hidden',
css`
width: 318px;
`
)}
2022-04-02 02:12:15 +08:00
>
2022-10-28 20:29:04 +08:00
<AnimatePresence>
{!minimizePlayer && (
<motion.div
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
exit={{ opacity: 0 }}
>
<PlayingNext />
</motion.div>
)}
2022-10-28 20:29:04 +08:00
</AnimatePresence>
2022-03-13 14:40:38 +08:00
2022-10-28 20:29:04 +08:00
<NowPlaying />
</div>
</MotionConfig>
2022-03-13 14:40:38 +08:00
)
}
export default Player