diff --git a/package-lock.json b/package-lock.json index 81b23fc..ea07cbb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "omp", - "version": "1.5.3", + "version": "1.5.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "omp", - "version": "1.5.3", + "version": "1.5.4", "dependencies": { "@azure/msal-browser": "^3.7.0", "@azure/msal-react": "^2.0.9", diff --git a/package.json b/package.json index 34d2e7f..e5e6e54 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "omp", "description": "OneDrive Media Player", "private": true, - "version": "1.5.3", + "version": "1.5.4", "scripts": { "dev": "webpack serve", "build": "webpack --mode=production --node-env=production", diff --git a/src/pages/Player/Audio/Audio.tsx b/src/pages/Player/Audio/Audio.tsx index 80ebf0d..5b16381 100644 --- a/src/pages/Player/Audio/Audio.tsx +++ b/src/pages/Player/Audio/Audio.tsx @@ -1,4 +1,3 @@ -import { useTheme } from '@mui/material' import useUiStore from '@/store/useUiStore' import { useMemo, useRef } from 'react' import Classic from './Classic' @@ -8,8 +7,6 @@ import { useDrag } from '@use-gesture/react' const Audio = ({ player }: { player: HTMLVideoElement | null }) => { - const theme = useTheme() - const [ audioViewIsShow, audioViewTheme, @@ -23,10 +20,11 @@ const Audio = ({ player }: { player: HTMLVideoElement | null }) => { ) const topRef = useRef(0) - const [{ top, borderRadius }, api] = useSpring(() => ({ + const [{ top, leftRightbottom, borderRadius }, api] = useSpring(() => ({ from: { top: audioViewIsShow ? '0' : '100dvh', - borderRadius: audioViewIsShow ? '0' : '0.5rem', + leftRightbottom: audioViewIsShow ? '0' : '0.5rem', + borderRadius: '0.5rem', }, // config: { // mass: 1, @@ -36,14 +34,14 @@ const Audio = ({ player }: { player: HTMLVideoElement | null }) => { })) const show = () => api.start({ - to: { top: '0', borderRadius: '0' }, + to: { top: '0', leftRightbottom: '0', borderRadius: '0' }, // config: { clamp: false }, }) const hide = () => { api.start({ from: { top: `${topRef.current}` }, - to: { top: '100dvh' }, + to: { top: '100dvh', leftRightbottom: '0.5rem', borderRadius: '0.5rem' }, // config: { clamp: true }, }) topRef.current = 0 @@ -77,12 +75,13 @@ const Audio = ({ player }: { player: HTMLVideoElement | null }) => { diff --git a/src/pages/Player/Audio/Classic.tsx b/src/pages/Player/Audio/Classic.tsx index f1d7762..368d34b 100644 --- a/src/pages/Player/Audio/Classic.tsx +++ b/src/pages/Player/Audio/Classic.tsx @@ -15,6 +15,7 @@ const Classic = ({ player, styles }: { player: HTMLVideoElement | null, styles: const [playQueue] = usePlayQueueStore((state) => [state.playQueue]) const [ + audioViewIsShow, fullscreen, backgroundIsShow, shuffle, @@ -25,6 +26,7 @@ const Classic = ({ player, styles }: { player: HTMLVideoElement | null, styles: updateBackgroundIsShow, ] = useUiStore( (state) => [ + state.audioViewIsShow, state.fullscreen, state.backgroundIsShow, state.shuffle, @@ -108,7 +110,7 @@ const Classic = ({ player, styles }: { player: HTMLVideoElement | null, styles: updateAudioViewIsShow(false)} + onClick={() => updateAudioViewIsShow(!audioViewIsShow)} className='app-region-no-drag' > diff --git a/src/pages/Player/Audio/Modern.tsx b/src/pages/Player/Audio/Modern.tsx index c685c9f..7919d99 100644 --- a/src/pages/Player/Audio/Modern.tsx +++ b/src/pages/Player/Audio/Modern.tsx @@ -30,6 +30,7 @@ const Modern = ({ player, styles }: { player: HTMLVideoElement | null, styles: { const [playQueue] = usePlayQueueStore((state) => [state.playQueue]) const [ + audioViewIsShow, fullscreen, shuffle, repeat, @@ -38,6 +39,7 @@ const Modern = ({ player, styles }: { player: HTMLVideoElement | null, styles: { updatePlayQueueIsShow, ] = useUiStore( (state) => [ + state.audioViewIsShow, state.fullscreen, state.shuffle, state.repeat, @@ -131,7 +133,7 @@ const Modern = ({ player, styles }: { player: HTMLVideoElement | null, styles: { width: '100%', height: 'auto', }}> - updateAudioViewIsShow(false)}> + updateAudioViewIsShow(!audioViewIsShow)}>