UNPKG

vue-dynamic-marquee

Version:

Marquee component for Vue - repeatedly translate content across wrapper. Completely responsive to after-render changes with many options to customize.

2 lines 8.26 kB
(("undefined"!==typeof self?self:this)["webpackJsonpvue_dynamic_marquee"]=("undefined"!==typeof self?self:this)["webpackJsonpvue_dynamic_marquee"]||[]).push([[1],{"1d1f":function(e,t,n){"use strict";n.r(t);var r,i=[],o=function(){return i.some((function(e){return e.activeTargets.length>0}))},s=function(){return i.some((function(e){return e.skippedTargets.length>0}))},c="ResizeObserver loop completed with undelivered notifications.",a=function(){var e;"function"===typeof ErrorEvent?e=new ErrorEvent("error",{message:c}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=c),window.dispatchEvent(e)};(function(e){e["BORDER_BOX"]="border-box",e["CONTENT_BOX"]="content-box",e["DEVICE_PIXEL_CONTENT_BOX"]="device-pixel-content-box"})(r||(r={}));var u,h=function(){function e(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Object.freeze(this)}return e.prototype.toJSON=function(){var e=this,t=e.x,n=e.y,r=e.top,i=e.right,o=e.bottom,s=e.left,c=e.width,a=e.height;return{x:t,y:n,top:r,right:i,bottom:o,left:s,width:c,height:a}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),f=function(e){return e instanceof SVGElement&&"getBBox"in e},d=function(e){if(f(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var i=e,o=i.offsetWidth,s=i.offsetHeight;return!(o||s||e.getClientRects().length)},v=function(e){var t,n,r=null===(n=null===(t=e)||void 0===t?void 0:t.ownerDocument)||void 0===n?void 0:n.defaultView;return!!(r&&e instanceof r.Element)},p=function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},l="undefined"!==typeof window?window:{},b=new Map,g=/auto|scroll/,w=/^tb|vertical/,x=/msie|trident/i.test(l.navigator&&l.navigator.userAgent),E=function(e){return parseFloat(e||"0")},m=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=!1),Object.freeze({inlineSize:(n?t:e)||0,blockSize:(n?e:t)||0})},y=Object.freeze({devicePixelContentBoxSize:m(),borderBoxSize:m(),contentBoxSize:m(),contentRect:new h(0,0,0,0)}),z=function(e){if(b.has(e))return b.get(e);if(d(e))return b.set(e,y),y;var t=getComputedStyle(e),n=f(e)&&e.ownerSVGElement&&e.getBBox(),r=!x&&"border-box"===t.boxSizing,i=w.test(t.writingMode||""),o=!n&&g.test(t.overflowY||""),s=!n&&g.test(t.overflowX||""),c=n?0:E(t.paddingTop),a=n?0:E(t.paddingRight),u=n?0:E(t.paddingBottom),v=n?0:E(t.paddingLeft),p=n?0:E(t.borderTopWidth),l=n?0:E(t.borderRightWidth),z=n?0:E(t.borderBottomWidth),T=n?0:E(t.borderLeftWidth),B=v+a,S=c+u,O=T+l,R=p+z,C=s?e.offsetHeight-R-e.clientHeight:0,k=o?e.offsetWidth-O-e.clientWidth:0,N=r?B+O:0,_=r?S+R:0,D=n?n.width:E(t.width)-N-k,M=n?n.height:E(t.height)-_-C,P=D+B+k+O,F=M+S+C+R,I=Object.freeze({devicePixelContentBoxSize:m(Math.round(D*devicePixelRatio),Math.round(M*devicePixelRatio),i),borderBoxSize:m(P,F,i),contentBoxSize:m(D,M,i),contentRect:new h(v,c,D,M)});return b.set(e,I),I},T=function(e,t){var n=z(e),i=n.borderBoxSize,o=n.contentBoxSize,s=n.devicePixelContentBoxSize;switch(t){case r.DEVICE_PIXEL_CONTENT_BOX:return s;case r.BORDER_BOX:return i;default:return o}},B=function(){function e(e){var t=z(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=[t.borderBoxSize],this.contentBoxSize=[t.contentBoxSize],this.devicePixelContentBoxSize=[t.devicePixelContentBoxSize]}return e}(),S=function(e){if(d(e))return 1/0;var t=0,n=e.parentNode;while(n)t+=1,n=n.parentNode;return t},O=function(){var e=1/0,t=[];i.forEach((function(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach((function(t){var n=new B(t.target),i=S(t.target);r.push(n),t.lastReportedSize=T(t.target,t.observedBox),i<e&&(e=i)})),t.push((function(){n.callback.call(n.observer,r,n.observer)})),n.activeTargets.splice(0,n.activeTargets.length)}}));for(var n=0,r=t;n<r.length;n++){var o=r[n];o()}return e},R=function(e){b.clear(),i.forEach((function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach((function(n){n.isActive()&&(S(n.target)>e?t.activeTargets.push(n):t.skippedTargets.push(n))}))}))},C=function(){var e=0;R(e);while(o())e=O(),R(e);return s()&&a(),e>0},k=[],N=function(){return k.splice(0).forEach((function(e){return e()}))},_=function(e){if(!u){var t=document.createTextNode(""),n={characterData:!0};new MutationObserver((function(){return N()})).observe(t,n),u=function(){t.textContent=""}}k.push(e),u()},D=function(e){_((function(){requestAnimationFrame(e)}))},M=0,P=function(){return!!M},F=12,I={attributes:!0,characterData:!0,childList:!0,subtree:!0},L=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],X=!1,A=function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;X||(X=!0,D((function(){var n=!1;try{n=C()}finally{if(X=!1,!P())return;n?t.run(60):e?t.run(e-1):t.start()}})))},e.prototype.schedule=function(){this.stop(),this.run(F)},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,I)};document.body?t():l.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),L.forEach((function(t){return l.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),L.forEach((function(t){return l.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}(),V=new A,W=function(e){!M&&e>0&&V.start(),M+=e,!M&&V.stop()},q=function(e){return!f(e)&&!p(e)&&"inline"===getComputedStyle(e).display},j=function(){function e(e,t){this.target=e,this.observedBox=t||r.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e=T(this.target,this.observedBox);return q(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},e}(),J=function(){function e(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t}return e}(),G=new Map,H=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},U=function(){function e(){}return e.connect=function(e,t){var n=new J(e,t);i.push(n),G.set(e,n)},e.observe=function(e,t,n){if(G.has(e)){var r=G.get(e);H(r.observationTargets,t)<0&&(r.observationTargets.push(new j(t,n&&n.box)),W(1),V.schedule())}},e.unobserve=function(e,t){if(G.has(e)){var n=G.get(e),r=H(n.observationTargets,t);r>=0&&(n.observationTargets.splice(r,1),W(-1))}},e.disconnect=function(e){if(G.has(e)){var t=G.get(e);i.splice(i.indexOf(t),1),G.delete(e),W(-t.observationTargets.length)}},e}(),Y=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!==typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");U.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!v(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");U.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!v(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");U.unobserve(this,e)},e.prototype.disconnect=function(){U.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();n.d(t,"ResizeObserver",(function(){return Y})),n.d(t,"ResizeObserverEntry",(function(){return B}))}}]); //# sourceMappingURL=vue-dynamic-marquee.umd.min.1.js.map