调整弹幕以及发布新文章
This commit is contained in:
1 parent
86802335dd
commit
929efcd2d5
86 files changed
+372
-669
No files matched your search
Vendored
+1
-1
@@ -1 +1 @@
|
||||
var Barrage=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=class{constructor(t){if(this.el="",this.info=[],this.defaultHeader="",this.url="",this.close=!1,this.speed=10,this.color="#ffff",this.backColor="#69696980",this.height="40px",this.fontSize="20px",this.parentName="barrage",this.isLeft=!1,!t||void 0===t.el)throw new Error("el is necessary params");if(t)for(const[e,n]of Object.entries(t))""!==n&&void 0!==this[e]&&"info"!==e&&(this[e]=n);(function t(){this._getElDom();let e=this.mainDom;e.style.position="relative";let n=document.getElementById(this.parentName);n?(this.parentName+=1,t.apply(this)):((n=document.createElement("div")).setAttribute("id",this.parentName),n.setAttribute("style","position:absolute;\n width:100%;\n height:100%;\n top:0;\n left:0;\n z-index:7;\n pointer-events: none;\n overflow:hidden;\n "),e.appendChild(n))}).apply(this)}start(t,e){t?(this.info.push(t),this.info.length>0&&function(t={}){let e,{headImg:n=this.defaultHeader,url:r=this.url,speed:i=this.speed}=t,s=0,o=document.getElementById(this.parentName),a=document.createElement("div"),l=parseInt(this.height.replace(/px|rem|em/,""));if(isNaN(l))throw new Error("height is ");e=(this.mainDom.clientHeight-l)*Math.random();const u=this.mainDom.clientWidth;n&&function(t,e){let n=document.createElement("img");n.setAttribute("class","header"),n.setAttribute("src",e),t.appendChild(n)}(a,n),a.style.opacity="0",a.setAttribute("class","barrage"),function(t,e,n){let r=document.createElement("a");r.setAttribute("class","text"),r.style.color=this.color,n&&(r.setAttribute("href",n),r.setAttribute("target","_blank"));let i=document.createTextNode(e);r.appendChild(i),t.appendChild(r)}.call(this,a,this.info.shift(),r),o.appendChild(a);let c=a.clientWidth+100,h=u,d=-c;!0===this.isLeft&&(h=-c,d=u);const f=`\n height: ${this.height};\n background: ${this.backColor}; \n line-height: ${this.height}; \n font-size: ${this.fontSize};\n color:${this.color}; \n top:${e+10}px; \n transition:transform ${i}s linear 0s;\n transform:translateX(${d}px);\n opacity:1;\n `;a.style.transform="translateX("+h+"px)",a.addEventListener("mouseover",function(t){const e=t.currentTarget;let n=document.defaultView.getComputedStyle(e,null).getPropertyValue("transform").replace("matrix","").slice(1,-1).split(",")[4];e.style.transform=`translateX(${n}px)`,clearTimeout(m),clearInterval(p)}),a.addEventListener("mouseout",function(t){const e=t.currentTarget;e.style.transition=`transform ${i-s}s linear 0s`,e.style.transform=`translateX(${d}px)`,p=setInterval(()=>{s++},1e3),m=setTimeout(()=>{clearInterval(p),o.removeChild(a)},1e3*(i-s+1))}),setTimeout(()=>{a.setAttribute("style",f)},1e3);let m=setTimeout(()=>{clearInterval(p),o.removeChild(a)},1e3*(i+1)),p=setInterval(()=>{s++},1e3)}.call(this,e)):console.warn("message is necessary,you must set message on function start")}_getElDom(){let t=document.querySelector(this.el);if(!t)throw new Error(`'${this.el}'is not a element`);this.mainDom=t}destroy(){let t=document.getElementById(this.parentName);this.mainDom.removeChild(t)}}}]);
|
||||
var Barrage=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=class{constructor(t){if(this.el="",this.info=[],this.defaultHeader="",this.url="",this.close=!1,this.speed=10,this.color="#ffff",this.backColor="#69696980",this.height="40px",this.fontSize="20px",this.parentName="barrage",this.isLeft=!1,!t||void 0===t.el)throw new Error("el is necessary params");if(t)for(const[e,n]of Object.entries(t))""!==n&&void 0!==this[e]&&"info"!==e&&(this[e]=n);(function t(){this._getElDom();let e=this.mainDom;e.style.position="relative";let n=document.getElementById(this.parentName);n?(this.parentName+=1,t.apply(this)):((n=document.createElement("div")).setAttribute("id",this.parentName),n.setAttribute("style","position:absolute;\n width:100%;\n height:100%;\n top:0;\n left:0;\n z-index:7;\n pointer-events: none;\n overflow:hidden;\n "),e.appendChild(n))}).apply(this)}start(t,e){t?(this.info.push(t),this.info.length>0&&function(t={}){let e,{headImg:n=this.defaultHeader,url:r=this.url,speed:i=this.speed}=t,s=0,o=document.getElementById(this.parentName),a=document.createElement("div"),l=parseInt(this.height.replace(/px|rem|em/,""));if(isNaN(l))throw new Error("height is ");e=(this.mainDom.clientHeight-l)*Math.random();const u=this.mainDom.clientWidth;n&&function(t,e){let n=document.createElement("img");n.setAttribute("class","header-avatar"),n.setAttribute("src",e),t.appendChild(n)}(a,n),a.style.opacity="0",a.setAttribute("class","barrage"),function(t,e,n){let r=document.createElement("a");r.setAttribute("class","text"),r.style.color=this.color,n&&(r.setAttribute("href",n),r.setAttribute("target","_blank"));let i=document.createTextNode(e);r.appendChild(i),t.appendChild(r)}.call(this,a,this.info.shift(),r),o.appendChild(a);let c=a.clientWidth+100,h=u,d=-c;!0===this.isLeft&&(h=-c,d=u);const f=`\n height: ${this.height};\n background: ${this.backColor}; \n line-height: ${this.height}; \n font-size: ${this.fontSize};\n color:${this.color}; \n top:${e+10}px; \n transition:transform ${i}s linear 0s;\n transform:translateX(${d}px);\n opacity:1;\n `;a.style.transform="translateX("+h+"px)",a.addEventListener("mouseover",function(t){const e=t.currentTarget;let n=document.defaultView.getComputedStyle(e,null).getPropertyValue("transform").replace("matrix","").slice(1,-1).split(",")[4];e.style.transform=`translateX(${n}px)`,clearTimeout(m),clearInterval(p)}),a.addEventListener("mouseout",function(t){const e=t.currentTarget;e.style.transition=`transform ${i-s}s linear 0s`,e.style.transform=`translateX(${d}px)`,p=setInterval(()=>{s++},1e3),m=setTimeout(()=>{clearInterval(p),o.removeChild(a)},1e3*(i-s+1))}),setTimeout(()=>{a.setAttribute("style",f)},1e3);let m=setTimeout(()=>{clearInterval(p),o.removeChild(a)},1e3*(i+1)),p=setInterval(()=>{s++},1e3)}.call(this,e)):console.warn("message is necessary,you must set message on function start")}_getElDom(){let t=document.querySelector(this.el);if(!t)throw new Error(`'${this.el}'is not a element`);this.mainDom=t}destroy(){let t=document.getElementById(this.parentName);this.mainDom.removeChild(t)}}}]);
|
||||
Reference in new issue
Block a user