{
disableGutters={true}
sx={{
display: 'flex',
- justifyContent: 'space-between',
+ justifyContent: 'flex-start',
alignItems: 'center',
height: '100%',
- px: { xs: '0.5rem', sm: 'calc(env(titlebar-area-height, 1.25rem) - env(titlebar-area-height, 0rem) + 0.25rem)' },
+ px: { xs: '0.5rem', sm: windowControlsOverlayOpen ? '0.25rem' : '1.5rem' },
py: 'calc(env(titlebar-area-height, 0.5rem) - env(titlebar-area-height, 0rem) + 0.25rem)',
}}
>
-
- {
- (accounts.length !== 0) &&
- updateMobileSideBarOpen(!mobileSideBarOpen)}
- sx={{ display: { xs: '', sm: 'none' } }}
- className='app-region-no-drag'
- >
-
-
- }
-
- updateMobileSideBarOpen(!mobileSideBarOpen)}
+ sx={{ display: { xs: '', sm: 'none' } }}
+ className='app-region-no-drag'
>
- OMP
-
-
-
- {
- (accounts.length == 0) &&
-
-
-
- }
-
+
+
+ }
+
+
+ OMP
+
)
diff --git a/src/pages/Player/Audio/Audio.tsx b/src/pages/Player/Audio/Audio.tsx
index 6ef8a0d..80ebf0d 100644
--- a/src/pages/Player/Audio/Audio.tsx
+++ b/src/pages/Player/Audio/Audio.tsx
@@ -1,8 +1,6 @@
import { useTheme } from '@mui/material'
-import usePlayerStore from '@/store/usePlayerStore'
import useUiStore from '@/store/useUiStore'
import { useMemo, useRef } from 'react'
-import { extractColors } from 'extract-colors'
import Classic from './Classic'
import Modern from './Modern'
import { animated, useSpring } from '@react-spring/web'
@@ -16,26 +14,14 @@ const Audio = ({ player }: { player: HTMLVideoElement | null }) => {
audioViewIsShow,
audioViewTheme,
updateAudioViewIsShow,
- updateCoverColor,
] = useUiStore(
(state) => [
state.audioViewIsShow,
state.audioViewTheme,
state.updateAudioViewIsShow,
- state.updateCoverColor,
]
)
- const [cover] = usePlayerStore((state) => [state.cover])
-
- // 从专辑封面提取颜色
- useMemo(
- () => (cover !== './cover.webp') &&
- extractColors(cover).then(color => updateCoverColor(color[0].hex)).catch(console.error),
- // eslint-disable-next-line react-hooks/exhaustive-deps
- [cover]
- )
-
const topRef = useRef(0)
const [{ top, borderRadius }, api] = useSpring(() => ({
from: {
@@ -69,9 +55,13 @@ const Audio = ({ player }: { player: HTMLVideoElement | null }) => {
[audioViewIsShow]
)
- const bind = useDrag(({ down, movement: [, my], last }) => {
+ const bind = useDrag(({ down, movement: [, my], last, event }) => {
+ if ('pointerType' in event && event.pointerType !== 'touch') {
+ return
+ }
+
if (last) {
- if (my > window.innerHeight * 0.5) {
+ if (my > 40) {
updateAudioViewIsShow(false)
} else {
topRef.current = 0
diff --git a/src/pages/Player/Audio/Classic.tsx b/src/pages/Player/Audio/Classic.tsx
index 63b81a1..2f5327e 100644
--- a/src/pages/Player/Audio/Classic.tsx
+++ b/src/pages/Player/Audio/Classic.tsx
@@ -75,7 +75,7 @@ const Classic = ({ player, styles }: { player: HTMLVideoElement | null, styles:
width: '100%',
height: '100dvh',
background:
- (!backgroundIsShow || cover === './cover.webp')
+ (!backgroundIsShow || cover === './cover.svg')
? `linear-gradient(rgba(50, 50, 50, 0.6), ${coverColor}bb), #000`
: `linear-gradient(rgba(50, 50, 50, 0.3), rgba(50, 50, 50, 0.3) ), url(${cover}) no-repeat center, #000`,
backgroundSize: 'cover',
@@ -85,7 +85,7 @@ const Classic = ({ player, styles }: { player: HTMLVideoElement | null, styles:
}}
>
-