@axetroy/marquee
Advanced tools
Comparing version 0.1.1 to 0.1.2
{ | ||
"name": "@axetroy/marquee", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Marquee component for Vue.js & React.js", | ||
@@ -17,18 +17,19 @@ "scripts": { | ||
"devDependencies": { | ||
"@types/react": "^16.9.1", | ||
"@types/react-dom": "^16.8.5", | ||
"@types/webpack": "^4.32.1", | ||
"@vue/component-compiler-utils": "^3.0.0", | ||
"parcel-bundler": "^1.12.3", | ||
"react": "^16.9.0", | ||
"react-dom": "^16.9.0", | ||
"ts-loader": "^6.0.4", | ||
"tslib": "^1.10.0", | ||
"@babel/polyfill": "^7.4.4", | ||
"@types/react": "16.9.1", | ||
"@types/react-dom": "16.8.5", | ||
"@types/webpack": "4.32.1", | ||
"@vue/component-compiler-utils": "3.0.0", | ||
"parcel-bundler": "1.12.3", | ||
"react": "16.9.0", | ||
"react-dom": "16.9.0", | ||
"ts-loader": "6.0.4", | ||
"tslib": "1.10.0", | ||
"typescript": "3.5.2", | ||
"vue": "^2.6.10", | ||
"vue-hot-reload-api": "^2.3.3", | ||
"vue-loader": "^15.7.1", | ||
"vue-template-compiler": "^2.6.10", | ||
"webpack": "^4.39.1", | ||
"webpack-cli": "^3.3.6" | ||
"vue": "2.6.10", | ||
"vue-hot-reload-api": "2.3.3", | ||
"vue-loader": "15.7.1", | ||
"vue-template-compiler": "2.6.10", | ||
"webpack": "4.39.1", | ||
"webpack-cli": "3.3.6" | ||
}, | ||
@@ -35,0 +36,0 @@ "author": "", |
@@ -1,2 +0,2 @@ | ||
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("react"));else if("function"==typeof define&&define.amd)define(["react"],e);else{var r="object"==typeof exports?e(require("react")):e(t.react);for(var o in r)("object"==typeof exports?exports:t)[o]=r[o]}}(global,function(t){return function(t){var e={};function r(o){if(e[o])return e[o].exports;var n=e[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,o){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(o,n,function(e){return t[e]}.bind(null,n));return o},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([function(e,r){e.exports=t},function(t,e,r){"use strict";r.r(e),r.d(e,"Marquee",function(){return f});var o,n=r(0),i=(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),s=function(){return(s=Object.assign||function(t){for(var e,r=1,o=arguments.length;r<o;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)},u={whiteSpace:"nowrap",overflow:"hidden"},f=function(t){function e(e){var r=t.call(this,e)||this;return r.timer=null,r.state={},r}return i(e,t),e.prototype.componentDidMount=function(){var t=this.refs.box,e=[this.refs.text.offsetWidth,t.offsetWidth];e[1]>e[0]||this.start()},e.prototype.start=function(){this.timer||this._scroll2Left()},e.prototype.pause=function(){clearTimeout(this.timer),this.timer=null},e.prototype._scroll2Left=function(){var t=this,e=this.refs.box,r=this.refs.text,o=[r.offsetWidth,e.offsetWidth][0],n=(r.style.transform||"").match(/-?\d+/),i=n?+n[0]:0;i<0&&o<-i?(r.style.transform="translateX("+(e.offsetWidth+1)+"px)",this.timer=setTimeout(function(){clearTimeout(t.timer),t._scroll2Left()},1e3)):(r.style.transform="translateX("+(i-1)+"px)",this.timer=setTimeout(function(){clearTimeout(t.timer),t._scroll2Left()},18))},e.prototype._onmouseEnter=function(){this.props.pauseOnHover&&this.pause()},e.prototype._onmouseLeave=function(){this.props.pauseOnHover&&this.start()},e.prototype.render=function(){var t=this,e=this.props,r=e.style,o=e.className,i=e.children;return n.createElement("div",{style:s({},u,r||{}),className:o,ref:"box",onMouseEnter:function(){return t._onmouseEnter()},onMouseLeave:function(){return t._onmouseLeave()}},n.createElement("div",{ref:"text",style:{display:"inline-block"}},i))},e}(n.Component);e.default=f}])}); | ||
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("react"));else if("function"==typeof define&&define.amd)define(["react"],e);else{var r="object"==typeof exports?e(require("react")):e(t.react);for(var o in r)("object"==typeof exports?exports:t)[o]=r[o]}}(global,function(t){return function(t){var e={};function r(o){if(e[o])return e[o].exports;var n=e[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,o){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(o,n,function(e){return t[e]}.bind(null,n));return o},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([function(e,r){e.exports=t},function(t,e,r){"use strict";r.r(e),r.d(e,"Marquee",function(){return f});var o,n=r(0),i=(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),s=function(){return(s=Object.assign||function(t){for(var e,r=1,o=arguments.length;r<o;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)},u={whiteSpace:"nowrap",overflow:"hidden"},f=function(t){function e(e){var r=t.call(this,e)||this;return r.timer=null,r.state={},r}return i(e,t),e.prototype.componentDidMount=function(){var t=this.refs.box,e=[this.refs.text.offsetWidth,t.offsetWidth];e[1]>e[0]||this.start()},e.prototype.start=function(){this.timer||this._scroll2Left()},e.prototype.pause=function(){clearTimeout(this.timer),this.timer=null},e.prototype._scroll2Left=function(){var t=this,e=this.refs.box,r=this.refs.text,o=[r.offsetWidth,e.offsetWidth][0],n=(r.style.transform||"").match(/-?\d+/),i=n?+n[0]:0,s=r.style;i<0&&o<-i?(s.msTransform="translateX("+(e.offsetWidth+1)+"px)",s.transform="translateX("+(e.offsetWidth+1)+"px)",this.timer=setTimeout(function(){clearTimeout(t.timer),t._scroll2Left()},1e3)):(s.msTransform="translateX("+(i-1)+"px)",s.transform="translateX("+(i-1)+"px)",this.timer=setTimeout(function(){clearTimeout(t.timer),t._scroll2Left()},18))},e.prototype._onmouseEnter=function(){this.props.pauseOnHover&&this.pause()},e.prototype._onmouseLeave=function(){this.props.pauseOnHover&&this.start()},e.prototype.render=function(){var t=this,e=this.props,r=e.style,o=e.className,i=e.children;return n.createElement("div",{style:s({},u,r||{}),className:o,ref:"box",onMouseEnter:function(){return t._onmouseEnter()},onMouseLeave:function(){return t._onmouseLeave()}},n.createElement("div",{ref:"text",style:{display:"inline-block"}},i))},e}(n.Component);e.default=f}])}); | ||
//# sourceMappingURL=index.js.map |
@@ -77,4 +77,14 @@ [![Build Status](https://travis-ci.org/axetroy/marquee.svg?branch=master)](https://travis-ci.org/axetroy/marquee) | ||
## Browsers support | ||
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari | | ||
| --------- | --------- | --------- | --------- | | ||
| IE9, IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions | ||
> **IE11** require polyfill ``Object.assign()`` | ||
> **IE10** require polyfill ``new Set()`` and ``new Map()`` | ||
## License | ||
The [MIT License](https://github.com/axetroy/marquee/blob/master/LICENSE) |
@@ -1,2 +0,2 @@ | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("vue"));else if("function"==typeof define&&define.amd)define(["vue"],t);else{var n="object"==typeof exports?t(require("vue")):t(e.vue);for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(global,function(e){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(t,n){t.exports=e},function(e,t,n){"use strict";n.r(t);var o=function(){var e=this.$createElement;return(this._self._c||e)("div",{ref:"box",staticStyle:{"white-space":"nowrap",overflow:"hidden"},on:{mouseenter:this._onmouseEnter,mouseleave:this._onmouseLeave}},[this._ssrNode('<div style="display: inline-block;">',"</div>",[this._t("default")],2)])};o._withStripped=!0;var r=n(0);var i=function(e,t,n,o,r,i,s,u){var f,a="function"==typeof e?e.options:e;if(t&&(a.render=t,a.staticRenderFns=n,a._compiled=!0),o&&(a.functional=!0),i&&(a._scopeId="data-v-"+i),s?(f=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},a._ssrRegister=f):r&&(f=u?function(){r.call(this,this.$root.$options.shadowRoot)}:r),f)if(a.functional){a._injectStyles=f;var l=a.render;a.render=function(e,t){return f.call(t),l(e,t)}}else{var c=a.beforeCreate;a.beforeCreate=c?[].concat(c,f):[f]}return{exports:e,options:a}}(n.n(r).a.extend({name:"v-marquee",data:function(){return{timer:0}},props:{pauseOnHover:{type:Boolean,default:!1}},methods:{_scroll2Left:function(){var e=this,t=this.$refs.box,n=this.$refs.text,o=[n.offsetWidth,t.offsetWidth][0],r=(n.style.transform||"").match(/-?\d+/),i=r?+r[0]:0;i<0&&o<-i?(n.style.transform="translateX("+(t.offsetWidth+1)+"px)",this.timer=setTimeout(function(){clearTimeout(e.timer),e._scroll2Left()},1e3)):(n.style.transform="translateX("+(i-1)+"px)",this.timer=setTimeout(function(){clearTimeout(e.timer),e._scroll2Left()},18))},start:function(){this.timer||this._scroll2Left()},pause:function(){clearTimeout(this.timer),this.timer=null},_onmouseEnter:function(){this.$props.pauseOnHover&&this.pause()},_onmouseLeave:function(){this.$props.pauseOnHover&&this.start()}},mounted:function(){var e=this.$refs.box,t=[this.$refs.text.offsetWidth,e.offsetWidth];t[1]>t[0]||this.start()}}),o,[],!1,null,null,"16475e00");i.options.__file="vue/index.vue";t.default=i.exports}])}); | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("vue"));else if("function"==typeof define&&define.amd)define(["vue"],t);else{var r="object"==typeof exports?t(require("vue")):t(e.vue);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(global,function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(t,r){t.exports=e},function(e,t,r){"use strict";r.r(t);var n=function(){var e=this.$createElement;return(this._self._c||e)("div",{ref:"box",staticStyle:{"white-space":"nowrap",overflow:"hidden"},on:{mouseenter:this._onmouseEnter,mouseleave:this._onmouseLeave}},[this._ssrNode('<div style="display: inline-block;">',"</div>",[this._t("default")],2)])};n._withStripped=!0;var o=r(0);var i=function(e,t,r,n,o,i,s,u){var f,a="function"==typeof e?e.options:e;if(t&&(a.render=t,a.staticRenderFns=r,a._compiled=!0),n&&(a.functional=!0),i&&(a._scopeId="data-v-"+i),s?(f=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},a._ssrRegister=f):o&&(f=u?function(){o.call(this,this.$root.$options.shadowRoot)}:o),f)if(a.functional){a._injectStyles=f;var l=a.render;a.render=function(e,t){return f.call(t),l(e,t)}}else{var c=a.beforeCreate;a.beforeCreate=c?[].concat(c,f):[f]}return{exports:e,options:a}}(r.n(o).a.extend({name:"v-marquee",data:function(){return{timer:0}},props:{pauseOnHover:{type:Boolean,default:!1}},methods:{_scroll2Left:function(){var e=this,t=this.$refs.box,r=this.$refs.text,n=[r.offsetWidth,t.offsetWidth][0],o=(r.style.transform||"").match(/-?\d+/),i=o?+o[0]:0,s=r.style;i<0&&n<-i?(s.msTransform="translateX("+(t.offsetWidth+1)+"px)",s.transform="translateX("+(t.offsetWidth+1)+"px)",this.timer=setTimeout(function(){clearTimeout(e.timer),e._scroll2Left()},1e3)):(s.msTransform="translateX("+(i-1)+"px)",s.transform="translateX("+(i-1)+"px)",this.timer=setTimeout(function(){clearTimeout(e.timer),e._scroll2Left()},18))},start:function(){this.timer||this._scroll2Left()},pause:function(){clearTimeout(this.timer),this.timer=null},_onmouseEnter:function(){this.$props.pauseOnHover&&this.pause()},_onmouseLeave:function(){this.$props.pauseOnHover&&this.start()}},mounted:function(){var e=this.$refs.box,t=[this.$refs.text.offsetWidth,e.offsetWidth];t[1]>t[0]||this.start()}}),n,[],!1,null,null,"16475e00");i.options.__file="vue/index.vue";t.default=i.exports}])}); | ||
//# sourceMappingURL=index.js.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38808
10
71
90
17