Update transition property in bottom.less and

remove unnecessary styles in plugins.less and
miniProgressBar.js
This commit is contained in:
Harvey Zack committed 2023-11-25 16:14:31 +08:00
1 parent 2b18452644
commit 24601dd18c
5 files changed
+33 -69

No files matched your search

@@ -1,32 +1,13 @@
import { addClass, removeClass } from '../utils';
export default function miniProgressBar(art) {
art.on('ready', () => {
art.layers.add({
name: 'mini-progress-bar',
mounted($progressBar) {
art.on('destroy', () => {
$progressBar.style.display = 'none';
});
if (art.constructor.USE_RAF) {
art.on('raf', () => {
$progressBar.style.width = `${art.played * 100}%`;
});
} else {
art.on('video:timeupdate', () => {
$progressBar.style.width = `${art.played * 100}%`;
});
}
art.on('setBar', (type, percentage) => {
if (type === 'played') {
$progressBar.style.width = `${percentage * 100}%`;
}
});
},
});
art.on('control', (state) => {
if (state) {
removeClass(art.template.$player, 'art-mini-progress-bar');
} else {
addClass(art.template.$player, 'art-mini-progress-bar');
}
});
return {
name: 'mini-progress-bar',
};
return { name: 'mini-progress-bar' };
}