Skip to content

Commit

Permalink
Fix some error
Browse files Browse the repository at this point in the history
  • Loading branch information
nini22P committed Oct 28, 2023
1 parent d1af5d8 commit 6a1479b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
10 changes: 8 additions & 2 deletions src/components/CommonList/CommonList.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState } from 'react'
import { useState, useEffect } from 'react';
import { useTranslation } from 'react-i18next'
import { IconButton, ListItem, ListItemButton, ListItemIcon, ListItemText } from '@mui/material'
import Grid from '@mui/material/Unstable_Grid2'
Expand Down Expand Up @@ -39,7 +39,13 @@ const CommonList = (

const isPlayQueueView = listData?.some((item) => typeof (item as PlayQueueItem).index === 'number')

isPlayQueueView && document.getElementById('playing-item')?.scrollIntoView({behavior: 'auto', block: 'center'})
// 打开播放队列时滚动到当前播放文件
useEffect(() => {
isPlayQueueView && document.getElementById('playing-item')?.scrollIntoView({behavior: 'auto', block: 'center'})
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[]
)

const handleClickMenu = (event: React.MouseEvent<HTMLElement>, currentFile: File) => {
setMenuOpen(true)
Expand Down
1 change: 1 addition & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-text-size-adjust: 100%;
text-size-adjust: 100%
}

a {
Expand Down
10 changes: 5 additions & 5 deletions src/pages/Player/Audio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const Audio = (
const [playStatu, cover, currentTime, duration, shuffle, repeat, updateShuffle] = usePlayerStore(
(state) => [state.playStatu, state.cover, state.currentTime, state.duration, state.shuffle, state.repeat, state.updateShuffle])

const [noBackgound, setNoBackground] = useState(false)
const [noBackground, setNoBackground] = useState(false)
const [color, setColor] = useState('#ffffff')

useMemo(
Expand All @@ -78,7 +78,7 @@ const Audio = (
transition: 'top 0.35s ease-in-out',
transform: 'translateZ(0)',
background:
(noBackgound || cover === './cover.png')
(noBackground || cover === './cover.png')
? `linear-gradient(rgba(50, 50, 50, 0.6), ${color}bb), #000`
: `linear-gradient(rgba(50, 50, 50, 0.3), rgba(50, 50, 50, 0.3) ), url(${cover}) no-repeat center, #000`,
backgroundSize: 'cover',
Expand All @@ -87,7 +87,7 @@ const Audio = (
}}
style={(audioViewIsShow) ? { top: 0 } : { top: '100vh' }}
>
<Box sx={{ backdropFilter: (noBackgound || cover === './cover.png') ? '' : 'blur(30px)' }}>
<Box sx={{ backdropFilter: (noBackground || cover === './cover.png') ? '' : 'blur(30px)' }}>
<Container maxWidth={'xl'} disableGutters={true}>
<Grid container
pt={{ xs: 1, sm: 2 }}
Expand All @@ -112,8 +112,8 @@ const Audio = (
<IconButton aria-label="PlayQueue" onClick={() => updatePlayQueueIsShow(true)} >
<QueueMusicOutlinedIcon style={{ color: '#fff' }} />
</IconButton>
<IconButton aria-label="NoBackground" onClick={() => setNoBackground(!noBackgound)} >
<PanoramaOutlinedIcon style={noBackgound ? { color: '#aaa' } : { color: '#fff' }} />
<IconButton aria-label="NoBackground" onClick={() => setNoBackground(!noBackground)} >
<PanoramaOutlinedIcon style={noBackground ? { color: '#aaa' } : { color: '#fff' }} />
</IconButton>
<IconButton aria-label="Full" onClick={() => handleClickFullscreen()}>
{
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const config = {
path: path.resolve(__dirname, 'dist'),
},
devServer: {
open: true,
// open: true,
host: 'localhost',
port: 8760,
},
Expand Down

0 comments on commit 6a1479b

Please sign in to comment.