mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-13 07:46:17 -08:00
25 lines
646 B
JavaScript
25 lines
646 B
JavaScript
import { append } from './utils';
|
|
|
|
export default class Mask {
|
|
constructor(art) {
|
|
this.art = art;
|
|
const { $mask } = art.template;
|
|
const $playBig = append($mask, '<div class="art-state"></div>');
|
|
append($playBig, art.icons.state);
|
|
}
|
|
|
|
show() {
|
|
const { $player } = this.art.template;
|
|
this.state = true;
|
|
$player.classList.add('artplayer-mask-show');
|
|
this.art.emit('mask:show');
|
|
}
|
|
|
|
hide() {
|
|
const { $player } = this.art.template;
|
|
this.state = false;
|
|
$player.classList.remove('artplayer-mask-show');
|
|
this.art.emit('mask:hide');
|
|
}
|
|
}
|