mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-16 21:28:06 +00:00
update
This commit is contained in:
parent
32050e4553
commit
6aee8ae38e
41 changed files with 523 additions and 415 deletions
|
|
@ -6,12 +6,14 @@ import Slider from '@/web/components/Slider'
|
|||
import { cx } from '@emotion/css'
|
||||
import player from '@/web/states/player'
|
||||
import { ceil } from 'lodash'
|
||||
import { useMutation, useQuery } from '@tanstack/react-query'
|
||||
import { IpcChannels } from '@/shared/IpcChannels'
|
||||
import { useCopyToClipboard } from 'react-use'
|
||||
|
||||
function Player() {
|
||||
return (
|
||||
<div className={cx(`space-y-7`)}>
|
||||
<FindTrackOnYouTube />
|
||||
<VolumeSlider />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
@ -59,31 +61,4 @@ function FindTrackOnYouTube() {
|
|||
)
|
||||
}
|
||||
|
||||
function VolumeSlider() {
|
||||
const { t } = useTranslation()
|
||||
const { volume } = useSnapshot(player)
|
||||
const onChange = (volume: number) => {
|
||||
player.volume = volume
|
||||
}
|
||||
return (
|
||||
<div>
|
||||
<BlockTitle>{t(`settings.volume-control`)}</BlockTitle>
|
||||
<div className='pt-2 pr-1'>
|
||||
<Slider
|
||||
value={volume}
|
||||
min={0}
|
||||
max={1}
|
||||
onChange={onChange}
|
||||
alwaysShowTrack
|
||||
alwaysShowThumb
|
||||
/>
|
||||
</div>
|
||||
<div className='mt-1 flex justify-between text-14 font-bold text-neutral-100'>
|
||||
<span>0</span>
|
||||
<span>{ceil(volume * 100)}</span>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default Player
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue