node-marquee
Advanced tools
Comparing version 1.0.15 to 1.0.17
@@ -0,1 +1,11 @@ | ||
/* | ||
────────╔╗─── ───────────╔═╗───────── | ||
╔═╦╗╔═╗╔╝║╔═╗ ╔══╗╔═╗─╔╦╗║╬║╔╦╗╔═╗╔═╗ | ||
║║║║║╬║║╬║║╩╣ ║║║║║╬╚╗║╔╝╚╗║║║║║╩╣║╩╣ | ||
╚╩═╝╚═╝╚═╝╚═╝ ╚╩╩╝╚══╝╚╝──╚╝╚═╝╚═╝╚═╝ | ||
GitHub Repository: https://github.com/antonbobrov/node-marquee | ||
Powered by Anthony Bobrov | https://github.com/antonbobrov | ||
*/ | ||
!function(n){var i={};function r(e){if(i[e])return i[e].exports;var t=i[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,r),t.l=!0,t.exports}r.m=n,r.c=i,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(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));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=0)}([function(e,t,n){"use strict";n.r(t);function i(e){var o=0<arguments.length&&void 0!==e?e:{};o=Object.assign({selector:".node-marquee",speed:1,autoplay:!0},o);var t,l=(t=o.selector)instanceof HTMLElement||t instanceof Window?t:document.querySelector(t);if(null==l)return!1;l.classList.add("node-marquee");var a=l.innerText,u=0,d=[],s=0,n=!1,i=5;f();var r=f.bind(this);window.addEventListener("resize",r,!1);var c=!1;function f(){u=0,d=[],l.innerHTML="",l.style.position="relative",l.style.width="100%",l.style.overflow="hidden",l.style.whiteSpace="nowrap";var e=p().clientWidth;e<l.clientWidth&&(u=Math.ceil(l.clientWidth/e)),u<i&&(u=i);for(var t=0;t<u-1;t++)p(!0,!0);y()}function p(e,t){var n=0<arguments.length&&void 0!==e&&e,i=1<arguments.length&&void 0!==t&&t,r=document.createElement("div");return r.classList.add("node-marquee__el"),r.innerHTML=i?" "+a:a,n&&(r.style.position="absolute",r.style.top="0",r.style.left="0"),r.style.display="inline-block",l.appendChild(r),d.push(r),r}function y(){s+=o.speed;for(var e=!1,t=0,n=0;n<u;n++){var i=d[n],r=t-s;t+=i.clientWidth,i.style.transform="translate(".concat(r,"px, 0)"),r<-1*i.clientWidth&&(e=i)}e&&(d.push(d.splice(d.indexOf(e),1)[0]),s-=e.clientWidth)}function v(){c||(n=!0,c=window.requestAnimationFrame(function e(){y(),n&&(c=window.requestAnimationFrame(e.bind(this)))}.bind(this)))}return o.autoplay&&v(),{play:v.bind(this),pause:function(){n=!1,c&&(window.cancelAnimationFrame(c),c=!1)}.bind(this)}}window.nodeMarquee=i}]); |
{ | ||
"name": "node-marquee", | ||
"version": "1.0.15", | ||
"version": "1.0.17", | ||
"description": "Custom Marquee element with JavaScript", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -5,3 +5,7 @@ # Custom Marquee element with JavaScript. | ||
## How to start | ||
## Documentation: https://antonbobrov.github.io/node-marquee/ | ||
## How to start with NPM | ||
```sh | ||
@@ -11,4 +15,9 @@ npm install node-marquee | ||
## How to start with CDN | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/node-marquee/dist/cdn/index.min.js"></script> | ||
``` | ||
## Example | ||
@@ -20,2 +29,4 @@ ```html | ||
import nodeMarquee from 'node-marquee'; | ||
``` | ||
```js | ||
nodeMarquee({ | ||
@@ -22,0 +33,0 @@ selector: '.node-marquee' |
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
641362
1258
51