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

@@ -359,7 +359,7 @@ 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) {
danmu.$ref.style.border = 'none';
@@ -369,32 +369,6 @@ class Danmuku {
danmu.$ref.style.transition = 'transform 0s linear 0s';
}
});
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;
}
update() {
@@ -422,7 +396,6 @@ 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`;