update sw.js

This commit is contained in:
Harvey committed 2022-04-29 17:43:20 +08:00
1 parent b53deb5ad8
commit 227268ecda
12 files changed
+61 -114

No files matched your search

@@ -219,7 +219,7 @@ export default class Danmuku {
resize() {
const { $player } = this.art.template;
const { left: playerLeft, width: playerWidth } = this.getRect($player);
const { width: playerWidth } = this.getRect($player);
this.filter('wait', (danmu) => {
if (danmu.$ref) {
@@ -231,32 +231,6 @@ export default class Danmuku {
}
});
this.filter('emit', (danmu) => {
switch (danmu.mode) {
case 0: {
const { left: danmuLeft } = this.getRect(danmu.$ref);
const translateX = playerWidth - (danmuLeft - playerLeft);
danmu.$ref.style.transform = `translateX(${-translateX}px) translateY(0px) translateZ(0px)`;
break;
}
default:
break;
}
});
this.filter('stop', (danmu) => {
switch (danmu.mode) {
case 0: {
const { left: danmuLeft } = this.getRect(danmu.$ref);
const translateX = playerWidth - (danmuLeft - playerLeft);
danmu.$ref.style.transform = `translateX(${-translateX}px) translateY(0px) translateZ(0px)`;
break;
}
default:
break;
}
});
return this;
}
@@ -293,7 +267,6 @@ export default class Danmuku {
.forEach((danmu) => {
danmu.$ref = this.getDanmuRef(this.queue);
this.$danmuku.appendChild(danmu.$ref);
danmu.$ref.__danmu__ = danmu;
danmu.$ref.style.visibility = 'visible';
danmu.$ref.style.opacity = this.option.opacity;
danmu.$ref.style.fontSize = `${this.option.fontSize}px`;