mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-28 02:01:20 -08:00
添加旋转和翻转设置
This commit is contained in:
1 parent
650d1abef3
commit
ccf1999e6d
17 files changed
+281
-60
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import { append, inverseClass } from '../utils';
|
||||
|
||||
export default class Flip {
|
||||
constructor(option) {
|
||||
this.option = option;
|
||||
}
|
||||
|
||||
apply(art, $setting) {
|
||||
const { i18n, events: { proxy }, player } = art;
|
||||
this.$header = $setting.querySelector('.art-setting-header');
|
||||
this.$body = append($setting, `
|
||||
<div class="art-setting-body">
|
||||
<span class="art-setting-btn" data-flip="horizontal">${i18n.get('Horizontal')}</span>
|
||||
<span class="art-setting-btn" data-flip="vertical">${i18n.get('Vertical')}</span>
|
||||
</div>
|
||||
`);
|
||||
|
||||
proxy(this.$body, 'click', event => {
|
||||
const { target } = event;
|
||||
const { flip } = target.dataset;
|
||||
if (flip) {
|
||||
player.flip(flip);
|
||||
inverseClass(target, 'current');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user