${t[this.originIndex].content}
\n `, i || this.wrapperStyle) : this.send(t[this.originIndex], i || this.wrapperStyle), this.originIndex++) }), n / t.length * 1e3) } centeredSend(t, e, i = 3e3, n = null) { let r = document.createElement("div"), s = 0; r.innerHTML = t, (e || this.wrapperStyle) && r.classList.add(e || this.wrapperStyle), function t() { if (this.aisle[s].vipRow) this.container.appendChild(r), r.style.cssText = `\n position:absolute;\n left:50%;\n transform:translateX(-50%);\n top: ${s*this.offsetValue}px;\n `, this.aisle[s].vipRow = !1, setTimeout((() => { n && n({ duration: i, target: r, width: r.offsetWidth }), r.remove(), this.aisle[s].vipRow = !0 }), i); else { if (s++, s > this.line - 1) return; t.call(this) } }.call(this) } play() { const t = this.container.children; for (let e = 0; e < t.length; e++) this.controlDanmakurunStatus(t[e], 1); this.runstatus = 1, 0 !== this.overflowArr.length && this.clearOverflowDanmakuArray() } pause() { const t = this.container.children; for (let e = 0; e < t.length; e++) this.controlDanmakurunStatus(t[e], 0); this.runstatus = 0 } controlDanmakurunStatus(t, e) { const i = 0, n = /-(\S*),/; if (e === 1) { clearTimeout(t.timer); const e = Utils.getStyle(t, "transform").match(n)[1]; t.style.transition = `transform ${this.speed}s linear`, t.style.transform = `translateX(-${t.parentNode.offsetWidth+parseInt(e)+t.offsetWidth+130}px)`, t.timer = setTimeout((() => { t.remove() }), 1e3 * this.speed) } else if (e === i) { clearTimeout(t.timer); const e = Utils.getStyle(t, "transform").match(n)[1]; t.style.transition = "transform 0s linear", t.style.transform = `translateX(-${e}px)`, t.setAttribute("relieveDel", 1) } } handleMouseHover() { Utils.eventDelegation(this.container, "default-style", "mouseover", (t => { t.style["z-index"] = 1e3, this.controlDanmakurunStatus(t, 0), this.onHover && this.onHover(t) })), Utils.eventDelegation(this.container, "default-style", "mouseout", (t => { t.style.zIndex = 1, 1 == this.runstatus && this.controlDanmakurunStatus(t, 1) })) } clearOverflowDanmakuArray() { clearInterval(this.cleartimer), this.clearIng = !0; let t = 0; this.cleartimer = setInterval((() => { 0 === this.overflowArr.length ? (t++, t > 20 && (clearInterval(this.cleartimer), this.clearIng = !1)) : (this.send(this.overflowArr[0].content, this.overflowArr[0].normalClass || this.wrapperStyle), this.overflowArr.shift()) }), 500) } } class Utils { static getStyle(t, e) { return window.getComputedStyle(t, null)[e] } static eventDelegation(t, e, i, n) { t.addEventListener(i, (t => { try { t.target.className.includes(e) && n(t.target) } catch (t) {} })) } }