mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-11 05:26:15 -08:00
27 lines
662 B
JavaScript
27 lines
662 B
JavaScript
import { append } from './utils';
|
|
|
|
export default class Loading {
|
|
constructor(art) {
|
|
this.art = art;
|
|
const { $loading } = art.template;
|
|
append($loading, art.icons.loading);
|
|
}
|
|
|
|
set show(value) {
|
|
const { $player } = this.art.template;
|
|
if (value) {
|
|
this.state = true;
|
|
$player.classList.add('artplayer-loading-show');
|
|
this.art.emit('loading:show');
|
|
} else {
|
|
this.state = false;
|
|
$player.classList.remove('artplayer-loading-show');
|
|
this.art.emit('loading:hide');
|
|
}
|
|
}
|
|
|
|
toggle() {
|
|
this.show = !this.state;
|
|
}
|
|
}
|