mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-23 22:01:20 -08:00
调整整体样式
This commit is contained in:
1 parent
487e865017
commit
fa585e536a
49 files changed
+984
-322
No files matched your search
@@ -1,5 +1,3 @@
|
||||
import { setStyle } from './utils';
|
||||
|
||||
export default class Notice {
|
||||
constructor(art) {
|
||||
this.art = art;
|
||||
@@ -7,8 +5,9 @@ export default class Notice {
|
||||
}
|
||||
|
||||
show(msg, autoHide = true, time = 1000) {
|
||||
const { $notice, $noticeInner } = this.art.template;
|
||||
setStyle($notice, 'display', 'block');
|
||||
const { $player, $noticeInner } = this.art.template;
|
||||
this.state = true;
|
||||
$player.classList.add('artplayer-notice-show');
|
||||
$noticeInner.innerHTML = msg instanceof Error ? msg.message.trim() : msg;
|
||||
clearTimeout(this.timer);
|
||||
if (autoHide) {
|
||||
@@ -16,12 +15,13 @@ export default class Notice {
|
||||
this.hide();
|
||||
}, time);
|
||||
}
|
||||
this.art.emit('notice:show', $notice);
|
||||
this.art.emit('notice:show');
|
||||
}
|
||||
|
||||
hide() {
|
||||
const { $notice } = this.art.template;
|
||||
setStyle($notice, 'display', 'none');
|
||||
this.art.emit('notice:hide', $notice);
|
||||
const { $player } = this.art.template;
|
||||
this.state = false;
|
||||
$player.classList.remove('artplayer-notice-show');
|
||||
this.art.emit('notice:hide');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user