From 32050e45533edba59652a8835f63491f6a9aee7d Mon Sep 17 00:00:00 2001 From: "L.Ryland" <41134883+L-Ryland@users.noreply.github.com> Date: Mon, 3 Jul 2023 12:45:38 +0800 Subject: [PATCH] feat(web): volume control (#2053) --- packages/web/i18n/locales/en-us.json | 1 + packages/web/i18n/locales/zh-cn.json | 1 + packages/web/pages/Settings/Player.tsx | 38 +++++++++++++++++++++++--- 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/packages/web/i18n/locales/en-us.json b/packages/web/i18n/locales/en-us.json index 9570ab7..3f024db 100644 --- a/packages/web/i18n/locales/en-us.json +++ b/packages/web/i18n/locales/en-us.json @@ -71,6 +71,7 @@ "lab": "Lab", "general-choose-language": "Choose Language", "player-youtube-unlock": "YouTube Unlock", + "volume-control": "Volume Control", "player-find-alternative-track-on-youtube-if-not-available-on-netease": "Find alternative track on YouTube if not available on NetEase.", "about": "About" }, diff --git a/packages/web/i18n/locales/zh-cn.json b/packages/web/i18n/locales/zh-cn.json index 04533d5..a542590 100644 --- a/packages/web/i18n/locales/zh-cn.json +++ b/packages/web/i18n/locales/zh-cn.json @@ -72,6 +72,7 @@ "general-choose-language": "选择语言", "player-find-alternative-track-on-youtube-if-not-available-on-netease": "当播放的歌曲无版权或无法播放时,自动从 YouTube 寻找替代音频。", "player-youtube-unlock": "YouTube 解锁", + "volume-control": "音量控制", "about": "关于" }, "context-menu": { diff --git a/packages/web/pages/Settings/Player.tsx b/packages/web/pages/Settings/Player.tsx index 7d66740..758580e 100644 --- a/packages/web/pages/Settings/Player.tsx +++ b/packages/web/pages/Settings/Player.tsx @@ -1,13 +1,17 @@ import settings from '@/web/states/settings' -import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' import { useSnapshot } from 'valtio' -import { BlockDescription, BlockTitle, Button, Option, OptionText, Switch } from './Controls' +import { BlockDescription, BlockTitle, Option, OptionText, Switch, Input } from './Controls' +import Slider from '@/web/components/Slider' +import { cx } from '@emotion/css' +import player from '@/web/states/player' +import { ceil } from 'lodash' function Player() { return ( -