mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-18 02:21:20 -08:00
添加灯光模式
This commit is contained in:
1 parent
4867d8e25a
commit
3379e6091c
18 files changed
+170
-54
No files matched your search
@@ -21,6 +21,7 @@ import playingMix from './playingMix';
|
||||
import autoSizeMix from './autoSizeMix';
|
||||
import rectMix from './rectMix';
|
||||
import flipMix from './flipMix';
|
||||
import lightMix from './lightMix';
|
||||
import { proxyPropertys } from '../utils';
|
||||
|
||||
export default class Player {
|
||||
@@ -48,6 +49,7 @@ export default class Player {
|
||||
autoSizeMix(art, this);
|
||||
rectMix(art, this);
|
||||
flipMix(art, this);
|
||||
lightMix(art, this);
|
||||
proxyPropertys(art, this);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import { def, getStyle, setStyle } from '../utils';
|
||||
|
||||
export default function lightMix(art, player) {
|
||||
const { $undercover } = art.template;
|
||||
|
||||
def(player, 'light', {
|
||||
get() {
|
||||
return getStyle($undercover, 'display', false) !== 'none';
|
||||
},
|
||||
set(value) {
|
||||
setStyle($undercover, 'display', value ? 'block' : 'none');
|
||||
art.emit('light', value);
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user