Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArtPlayer 播放器界面配色支持使用设置的主题色 #7971

Open
3 of 4 tasks
hmjz100 opened this issue Feb 9, 2025 · 0 comments
Open
3 of 4 tasks

ArtPlayer 播放器界面配色支持使用设置的主题色 #7971

hmjz100 opened this issue Feb 9, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@hmjz100
Copy link

hmjz100 commented Feb 9, 2025

Please make sure of the following things

  • I have read the documentation.
  • I'm sure there are no duplicate issues or discussions.
  • I'm sure this feature is not implemented.
  • I'm sure it's a reasonable and popular requirement.

Description of the feature / 需求描述

如题,修改 ArtPlayer 默认的红色配色为用户在管理面板中设置的主题色
以及更新播放器、弹幕组件,以及修改弹幕按钮的颜色

Suggested solution / 实现思路

在构建播放器时传入 theme:"主题色" 参数,以及为弹幕功能的 UI (仅适用于新版弹幕组件)增加额外 CSS:

#(播放器元素ID) .artplayer-plugin-danmuku .apd-modes .apd-mode:hover{color:(用户设置的颜色);}#(播放器元素ID) .artplayer-plugin-danmuku .apd-slider .apd-slider-progress{background-color:(用户设置的颜色);}#(播放器元素ID) .artplayer-plugin-danmuku .apd-slider .apd-slider-dot{background-color:(用户设置的颜色);}#(播放器元素ID) .artplayer-plugin-danmuku .apd-config-other .apd-other:hover{color:(用户设置的颜色);}#(播放器元素ID) .artplayer-plugin-danmuku .apd-send:not(.apd-lock){background-color:(用户设置的颜色);}#(播放器元素ID) [data-danmuku-mode='0'] .apd-style-mode [data-mode='0']{color:(用户设置的颜色);}#(播放器元素ID) [data-danmuku-mode='0'] .apd-style-mode [data-mode='0'] path{fill:(用户设置的颜色);}#(播放器元素ID) [data-danmuku-mode='1'] .apd-style-mode [data-mode='1']{color:(用户设置的颜色);}#(播放器元素ID) [data-danmuku-mode='1'] .apd-style-mode [data-mode='1'] path{fill:(用户设置的颜色);}#(播放器元素ID) [data-danmuku-mode='2'] .apd-style-mode [data-mode='2']{color:(用户设置的颜色);}#(播放器元素ID) [data-danmuku-mode='2'] .apd-style-mode [data-mode='2'] path{fill:(用户设置的颜色);}#(播放器元素ID) .apd-toggle-on path:nth-of-type(2),#(播放器元素ID) .apd-check-on path,#(播放器元素ID) .apd-mode-0-off path,#(播放器元素ID) .apd-mode-1-off path,#(播放器元素ID) .apd-mode-2-off path{fill:(用户设置的颜色);}.art-contextmenu svg,.art-contextmenu img{vertical-align: top;margin-right: 5px}

Additional context / 附件

No response

@hmjz100 hmjz100 added the enhancement New feature or request label Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant