marquee-content 4.5.1-dev.1 → 4.5.1-dev.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  [![GitHub package version](https://img.shields.io/github/package-json/v/ux-ui-pro/marquee-content.svg)](https://github.com/ux-ui-pro/marquee-content)
10
10
  [![NPM Downloads](https://img.shields.io/npm/dm/marquee-content.svg?style=flat)](https://www.npmjs.org/package/marquee-content)
11
11
 
12
- <sup>1kB gzipped</sup>
12
+ <sup>1.5kB gzipped</sup>
13
13
 
14
14
  <a href="https://codepen.io/ux-ui/full/dygzqYm">Demo</a>
15
15
 
package/dist/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";var h=Object.defineProperty;var _=(r,e,t)=>e in r?h(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var n=(r,e,t)=>_(r,typeof e!="symbol"?e+"":e,t);const i=class i{constructor({element:e=".marquee"}={}){n(this,"_gsap",i.gsap);n(this,"_timeline");n(this,"_matchMedia");n(this,"_element");n(this,"_resizeObserver");n(this,"_animationFrame");const t=e instanceof HTMLElement?e:document.querySelector(e);if(!t)throw new Error("Target element not found");this._element=t,this._gsap=i.gsap,this._matchMedia=this._gsap.matchMedia(),this._resizeObserver=new ResizeObserver(i._debounce(()=>{this._update()})),this._resizeObserver.observe(this._element)}static registerGSAP(e,t){i.gsap=e,i.ScrollTrigger=t}static _debounce(e){let t=null;return(...s)=>{t!==null&&cancelAnimationFrame(t),t=requestAnimationFrame(()=>e(...s))}}init(){this._commonInit()}destroy(){this._animationFrame!==void 0&&(cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0),this._resizeObserver.disconnect(),this._clearTimeline()}_commonInit(){this._clearTimeline(),this._cloneElements(),this._setBreakpoints(),this._applySkew(),this._timeline=this._createAnimation()}_update(){this._animationFrame!==void 0&&cancelAnimationFrame(this._animationFrame),this._animationFrame=requestAnimationFrame(()=>{this._commonInit(),i.ScrollTrigger.refresh()})}_createAnimation(){var s;(s=this._timeline)==null||s.kill();const e=this._gsap.timeline({scrollTrigger:{trigger:this._element,start:"top bottom",end:"bottom top",toggleActions:"resume pause resume pause",onUpdate:a=>{const l=this._element.dataset.mcDirection;l==="ltr"?e.timeScale(-1):l==="auto"&&e.timeScale(a.direction)}}}),t=this._element.dataset.mcBreakpoint||"";return this._matchMedia.add(t,()=>{const a=parseFloat(this._element.dataset.mcSpeed??"20");return e.to(this._element.children,{duration:a,x:"-100%",repeat:-1,ease:"none"}),e.totalProgress(.5),()=>{e.kill()}}),e}_clearTimeline(){var e;(e=this._timeline)==null||e.kill(),this._timeline=void 0,this._gsap.set(this._element.children,{clearProps:"all"})}_setBreakpoints(){const{mcMax:e,mcMin:t}=this._element.dataset;this._element.dataset.mcBreakpoint=e?`(max-width: ${parseFloat(e)-.02}px)`:t?`(min-width: ${t}px)`:""}_cloneElements(){const e=()=>{for(;this._element.childElementCount>1;)this._element.removeChild(this._element.lastChild)};e();const t=this._element.dataset.mcBreakpoint||"";this._matchMedia.add(t,()=>{if(!this._element.firstElementChild)return()=>{};const s=this._element.firstElementChild,a=Math.ceil(this._element.scrollWidth/s.clientWidth+2);if(this._element.childElementCount<a){const l=document.createDocumentFragment();for(let o=0;o<a-1;o++){const c=s.cloneNode(!0);l.appendChild(c)}this._element.appendChild(l)}return()=>{e()}})}_applySkew(){const{mcSkew:e}=this._element.dataset;e&&(this._element.style.transformOrigin="center center",this._element.style.transform=`skew(0deg, ${e}deg)`)}};n(i,"gsap",gsap),n(i,"ScrollTrigger",ScrollTrigger);let m=i;module.exports=m;
1
+ "use strict";var h=Object.defineProperty;var d=(r,e,t)=>e in r?h(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var n=(r,e,t)=>d(r,typeof e!="symbol"?e+"":e,t);const p=require("gsap"),u=require("gsap/ScrollTrigger"),i=class i{constructor({element:e=".marquee"}={}){n(this,"gsapInstance",i._gsap);n(this,"timeline");n(this,"matchMedia");n(this,"element");n(this,"resizeObserver");n(this,"animationFrame");const t=e instanceof HTMLElement?e:document.querySelector(e);if(!t)throw new Error("Target element not found");this.element=t,this.gsapInstance=i._gsap,this.matchMedia=this.gsapInstance.matchMedia(),this.resizeObserver=new ResizeObserver(i.debounce(()=>{this.update()})),this.resizeObserver.observe(this.element)}static registerGSAP(e,t){i._gsap=e,i._ScrollTrigger=t}static debounce(e){let t=null;return(...s)=>{t!==null&&cancelAnimationFrame(t),t=requestAnimationFrame(()=>e(...s))}}init(){this.setup()}destroy(){this.animationFrame!==void 0&&(cancelAnimationFrame(this.animationFrame),this.animationFrame=void 0),this.resizeObserver.disconnect(),this.clearTimeline()}setup(){this.clearTimeline(),this.cloneElements(),this.setBreakpoints(),this.applySkew(),this.timeline=this.createAnimation()}update(){this.animationFrame!==void 0&&cancelAnimationFrame(this.animationFrame),this.animationFrame=requestAnimationFrame(()=>{var e,t;this.setup(),(t=(e=i._ScrollTrigger).refresh)==null||t.call(e)})}createAnimation(){var s;(s=this.timeline)==null||s.kill();const e=this.gsapInstance.timeline({scrollTrigger:{trigger:this.element,start:"top bottom",end:"bottom top",toggleActions:"resume pause resume pause",onUpdate:a=>{const{mcDirection:l}=this.element.dataset;l==="ltr"?e.timeScale(-1):l==="auto"&&e.timeScale(a.direction)}}}),t=this.element.dataset.mcBreakpoint||"";return this.matchMedia.add(t,()=>{const a=parseFloat(this.element.dataset.mcSpeed??"20");return e.to(this.element.children,{duration:a,x:"-100%",repeat:-1,ease:"none"}),e.totalProgress(.5),()=>{e.kill()}}),e}clearTimeline(){var e;(e=this.timeline)==null||e.kill(),this.timeline=void 0,this.gsapInstance.set(this.element.children,{clearProps:"all"})}setBreakpoints(){const{mcMax:e,mcMin:t}=this.element.dataset;this.element.dataset.mcBreakpoint=e?`(max-width: ${parseFloat(e)-.02}px)`:t?`(min-width: ${t}px)`:""}cloneElements(){const e=()=>{for(;this.element.childElementCount>1;)this.element.removeChild(this.element.lastChild)};e();const t=this.element.dataset.mcBreakpoint||"";this.matchMedia.add(t,()=>{const s=this.element.firstElementChild;if(!s)return()=>{};const a=Math.ceil(this.element.scrollWidth/s.clientWidth+2);if(this.element.childElementCount<a){const l=document.createDocumentFragment();for(let o=0;o<a-1;o++){const c=s.cloneNode(!0);l.appendChild(c)}this.element.appendChild(l)}return()=>{e()}})}applySkew(){const{mcSkew:e}=this.element.dataset;e&&(this.element.style.transformOrigin="center center",this.element.style.transform=`skew(0deg, ${e}deg)`)}};n(i,"_gsap",p.gsap),n(i,"_ScrollTrigger",u.ScrollTrigger);let m=i;module.exports=m;
package/dist/index.d.ts CHANGED
@@ -1,26 +1,28 @@
1
+ import { gsap } from 'gsap';
2
+ import { ScrollTrigger } from 'gsap/ScrollTrigger';
1
3
  interface MarqueeOptions {
2
4
  element?: string | HTMLElement;
3
5
  }
4
- declare class MarqueeContent {
5
- private static gsap;
6
- private static ScrollTrigger;
7
- private _gsap;
8
- private _timeline?;
9
- private _matchMedia;
10
- private _element;
11
- private _resizeObserver;
12
- private _animationFrame?;
6
+ export default class MarqueeContent {
7
+ private static _gsap;
8
+ private static _ScrollTrigger;
9
+ private gsapInstance;
10
+ private timeline?;
11
+ private matchMedia;
12
+ private element;
13
+ private resizeObserver;
14
+ private animationFrame?;
13
15
  constructor({ element }?: MarqueeOptions);
14
16
  static registerGSAP(gsapInstance: typeof gsap, scrollTriggerInstance: typeof ScrollTrigger): void;
15
- private static _debounce;
17
+ private static debounce;
16
18
  init(): void;
17
19
  destroy(): void;
18
- private _commonInit;
19
- private _update;
20
- private _createAnimation;
21
- private _clearTimeline;
22
- private _setBreakpoints;
23
- private _cloneElements;
24
- private _applySkew;
20
+ private setup;
21
+ private update;
22
+ private createAnimation;
23
+ private clearTimeline;
24
+ private setBreakpoints;
25
+ private cloneElements;
26
+ private applySkew;
25
27
  }
26
- export default MarqueeContent;
28
+ export {};
package/dist/index.es.js CHANGED
@@ -1,94 +1,98 @@
1
1
  var h = Object.defineProperty;
2
- var _ = (r, e, t) => e in r ? h(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var n = (r, e, t) => _(r, typeof e != "symbol" ? e + "" : e, t);
2
+ var d = (r, e, t) => e in r ? h(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
+ var n = (r, e, t) => d(r, typeof e != "symbol" ? e + "" : e, t);
4
+ import { gsap as p } from "gsap";
5
+ import { ScrollTrigger as u } from "gsap/ScrollTrigger";
4
6
  const i = class i {
5
7
  constructor({ element: e = ".marquee" } = {}) {
6
- n(this, "_gsap", i.gsap);
7
- n(this, "_timeline");
8
- n(this, "_matchMedia");
9
- n(this, "_element");
10
- n(this, "_resizeObserver");
11
- n(this, "_animationFrame");
8
+ n(this, "gsapInstance", i._gsap);
9
+ n(this, "timeline");
10
+ n(this, "matchMedia");
11
+ n(this, "element");
12
+ n(this, "resizeObserver");
13
+ n(this, "animationFrame");
12
14
  const t = e instanceof HTMLElement ? e : document.querySelector(e);
13
15
  if (!t) throw new Error("Target element not found");
14
- this._element = t, this._gsap = i.gsap, this._matchMedia = this._gsap.matchMedia(), this._resizeObserver = new ResizeObserver(i._debounce(() => {
15
- this._update();
16
- })), this._resizeObserver.observe(this._element);
16
+ this.element = t, this.gsapInstance = i._gsap, this.matchMedia = this.gsapInstance.matchMedia(), this.resizeObserver = new ResizeObserver(i.debounce(() => {
17
+ this.update();
18
+ })), this.resizeObserver.observe(this.element);
17
19
  }
18
20
  static registerGSAP(e, t) {
19
- i.gsap = e, i.ScrollTrigger = t;
21
+ i._gsap = e, i._ScrollTrigger = t;
20
22
  }
21
- static _debounce(e) {
23
+ static debounce(e) {
22
24
  let t = null;
23
25
  return (...s) => {
24
26
  t !== null && cancelAnimationFrame(t), t = requestAnimationFrame(() => e(...s));
25
27
  };
26
28
  }
27
29
  init() {
28
- this._commonInit();
30
+ this.setup();
29
31
  }
30
32
  destroy() {
31
- this._animationFrame !== void 0 && (cancelAnimationFrame(this._animationFrame), this._animationFrame = void 0), this._resizeObserver.disconnect(), this._clearTimeline();
33
+ this.animationFrame !== void 0 && (cancelAnimationFrame(this.animationFrame), this.animationFrame = void 0), this.resizeObserver.disconnect(), this.clearTimeline();
32
34
  }
33
- _commonInit() {
34
- this._clearTimeline(), this._cloneElements(), this._setBreakpoints(), this._applySkew(), this._timeline = this._createAnimation();
35
+ setup() {
36
+ this.clearTimeline(), this.cloneElements(), this.setBreakpoints(), this.applySkew(), this.timeline = this.createAnimation();
35
37
  }
36
- _update() {
37
- this._animationFrame !== void 0 && cancelAnimationFrame(this._animationFrame), this._animationFrame = requestAnimationFrame(() => {
38
- this._commonInit(), i.ScrollTrigger.refresh();
38
+ update() {
39
+ this.animationFrame !== void 0 && cancelAnimationFrame(this.animationFrame), this.animationFrame = requestAnimationFrame(() => {
40
+ var e, t;
41
+ this.setup(), (t = (e = i._ScrollTrigger).refresh) == null || t.call(e);
39
42
  });
40
43
  }
41
- _createAnimation() {
44
+ createAnimation() {
42
45
  var s;
43
- (s = this._timeline) == null || s.kill();
44
- const e = this._gsap.timeline({ scrollTrigger: { trigger: this._element, start: "top bottom", end: "bottom top", toggleActions: "resume pause resume pause", onUpdate: (a) => {
45
- const l = this._element.dataset.mcDirection;
46
+ (s = this.timeline) == null || s.kill();
47
+ const e = this.gsapInstance.timeline({ scrollTrigger: { trigger: this.element, start: "top bottom", end: "bottom top", toggleActions: "resume pause resume pause", onUpdate: (a) => {
48
+ const { mcDirection: l } = this.element.dataset;
46
49
  l === "ltr" ? e.timeScale(-1) : l === "auto" && e.timeScale(a.direction);
47
- } } }), t = this._element.dataset.mcBreakpoint || "";
48
- return this._matchMedia.add(t, () => {
49
- const a = parseFloat(this._element.dataset.mcSpeed ?? "20");
50
- return e.to(this._element.children, { duration: a, x: "-100%", repeat: -1, ease: "none" }), e.totalProgress(0.5), () => {
50
+ } } }), t = this.element.dataset.mcBreakpoint || "";
51
+ return this.matchMedia.add(t, () => {
52
+ const a = parseFloat(this.element.dataset.mcSpeed ?? "20");
53
+ return e.to(this.element.children, { duration: a, x: "-100%", repeat: -1, ease: "none" }), e.totalProgress(0.5), () => {
51
54
  e.kill();
52
55
  };
53
56
  }), e;
54
57
  }
55
- _clearTimeline() {
58
+ clearTimeline() {
56
59
  var e;
57
- (e = this._timeline) == null || e.kill(), this._timeline = void 0, this._gsap.set(this._element.children, { clearProps: "all" });
60
+ (e = this.timeline) == null || e.kill(), this.timeline = void 0, this.gsapInstance.set(this.element.children, { clearProps: "all" });
58
61
  }
59
- _setBreakpoints() {
60
- const { mcMax: e, mcMin: t } = this._element.dataset;
61
- this._element.dataset.mcBreakpoint = e ? `(max-width: ${parseFloat(e) - 0.02}px)` : t ? `(min-width: ${t}px)` : "";
62
+ setBreakpoints() {
63
+ const { mcMax: e, mcMin: t } = this.element.dataset;
64
+ this.element.dataset.mcBreakpoint = e ? `(max-width: ${parseFloat(e) - 0.02}px)` : t ? `(min-width: ${t}px)` : "";
62
65
  }
63
- _cloneElements() {
66
+ cloneElements() {
64
67
  const e = () => {
65
- for (; this._element.childElementCount > 1; ) this._element.removeChild(this._element.lastChild);
68
+ for (; this.element.childElementCount > 1; ) this.element.removeChild(this.element.lastChild);
66
69
  };
67
70
  e();
68
- const t = this._element.dataset.mcBreakpoint || "";
69
- this._matchMedia.add(t, () => {
70
- if (!this._element.firstElementChild) return () => {
71
+ const t = this.element.dataset.mcBreakpoint || "";
72
+ this.matchMedia.add(t, () => {
73
+ const s = this.element.firstElementChild;
74
+ if (!s) return () => {
71
75
  };
72
- const s = this._element.firstElementChild, a = Math.ceil(this._element.scrollWidth / s.clientWidth + 2);
73
- if (this._element.childElementCount < a) {
76
+ const a = Math.ceil(this.element.scrollWidth / s.clientWidth + 2);
77
+ if (this.element.childElementCount < a) {
74
78
  const l = document.createDocumentFragment();
75
79
  for (let m = 0; m < a - 1; m++) {
76
80
  const c = s.cloneNode(!0);
77
81
  l.appendChild(c);
78
82
  }
79
- this._element.appendChild(l);
83
+ this.element.appendChild(l);
80
84
  }
81
85
  return () => {
82
86
  e();
83
87
  };
84
88
  });
85
89
  }
86
- _applySkew() {
87
- const { mcSkew: e } = this._element.dataset;
88
- e && (this._element.style.transformOrigin = "center center", this._element.style.transform = `skew(0deg, ${e}deg)`);
90
+ applySkew() {
91
+ const { mcSkew: e } = this.element.dataset;
92
+ e && (this.element.style.transformOrigin = "center center", this.element.style.transform = `skew(0deg, ${e}deg)`);
89
93
  }
90
94
  };
91
- n(i, "gsap", gsap), n(i, "ScrollTrigger", ScrollTrigger);
95
+ n(i, "_gsap", p), n(i, "_ScrollTrigger", u);
92
96
  let o = i;
93
97
  export {
94
98
  o as default
package/dist/index.umd.js CHANGED
@@ -1 +1 @@
1
- (function(n,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(n=typeof globalThis<"u"?globalThis:n||self).MarqueeContent=t()})(this,function(){"use strict";var h=Object.defineProperty;var d=(n,t,o)=>t in n?h(n,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[t]=o;var s=(n,t,o)=>d(n,typeof t!="symbol"?t+"":t,o);const t=class t{constructor({element:e=".marquee"}={}){s(this,"_gsap",t.gsap);s(this,"_timeline");s(this,"_matchMedia");s(this,"_element");s(this,"_resizeObserver");s(this,"_animationFrame");const i=e instanceof HTMLElement?e:document.querySelector(e);if(!i)throw new Error("Target element not found");this._element=i,this._gsap=t.gsap,this._matchMedia=this._gsap.matchMedia(),this._resizeObserver=new ResizeObserver(t._debounce(()=>{this._update()})),this._resizeObserver.observe(this._element)}static registerGSAP(e,i){t.gsap=e,t.ScrollTrigger=i}static _debounce(e){let i=null;return(...a)=>{i!==null&&cancelAnimationFrame(i),i=requestAnimationFrame(()=>e(...a))}}init(){this._commonInit()}destroy(){this._animationFrame!==void 0&&(cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0),this._resizeObserver.disconnect(),this._clearTimeline()}_commonInit(){this._clearTimeline(),this._cloneElements(),this._setBreakpoints(),this._applySkew(),this._timeline=this._createAnimation()}_update(){this._animationFrame!==void 0&&cancelAnimationFrame(this._animationFrame),this._animationFrame=requestAnimationFrame(()=>{this._commonInit(),t.ScrollTrigger.refresh()})}_createAnimation(){var a;(a=this._timeline)==null||a.kill();const e=this._gsap.timeline({scrollTrigger:{trigger:this._element,start:"top bottom",end:"bottom top",toggleActions:"resume pause resume pause",onUpdate:r=>{const l=this._element.dataset.mcDirection;l==="ltr"?e.timeScale(-1):l==="auto"&&e.timeScale(r.direction)}}}),i=this._element.dataset.mcBreakpoint||"";return this._matchMedia.add(i,()=>{const r=parseFloat(this._element.dataset.mcSpeed??"20");return e.to(this._element.children,{duration:r,x:"-100%",repeat:-1,ease:"none"}),e.totalProgress(.5),()=>{e.kill()}}),e}_clearTimeline(){var e;(e=this._timeline)==null||e.kill(),this._timeline=void 0,this._gsap.set(this._element.children,{clearProps:"all"})}_setBreakpoints(){const{mcMax:e,mcMin:i}=this._element.dataset;this._element.dataset.mcBreakpoint=e?`(max-width: ${parseFloat(e)-.02}px)`:i?`(min-width: ${i}px)`:""}_cloneElements(){const e=()=>{for(;this._element.childElementCount>1;)this._element.removeChild(this._element.lastChild)};e();const i=this._element.dataset.mcBreakpoint||"";this._matchMedia.add(i,()=>{if(!this._element.firstElementChild)return()=>{};const a=this._element.firstElementChild,r=Math.ceil(this._element.scrollWidth/a.clientWidth+2);if(this._element.childElementCount<r){const l=document.createDocumentFragment();for(let m=0;m<r-1;m++){const c=a.cloneNode(!0);l.appendChild(c)}this._element.appendChild(l)}return()=>{e()}})}_applySkew(){const{mcSkew:e}=this._element.dataset;e&&(this._element.style.transformOrigin="center center",this._element.style.transform=`skew(0deg, ${e}deg)`)}};s(t,"gsap",gsap),s(t,"ScrollTrigger",ScrollTrigger);let n=t;return n});
1
+ (function(n,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("gsap"),require("gsap/ScrollTrigger")):typeof define=="function"&&define.amd?define(["gsap","gsap/ScrollTrigger"],i):(n=typeof globalThis<"u"?globalThis:n||self).MarqueeContent=i(n.gsap,n.ScrollTrigger)})(this,function(n,i){"use strict";var d=Object.defineProperty;var p=(n,i,r)=>i in n?d(n,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[i]=r;var a=(n,i,r)=>p(n,typeof i!="symbol"?i+"":i,r);const s=class s{constructor({element:e=".marquee"}={}){a(this,"gsapInstance",s._gsap);a(this,"timeline");a(this,"matchMedia");a(this,"element");a(this,"resizeObserver");a(this,"animationFrame");const t=e instanceof HTMLElement?e:document.querySelector(e);if(!t)throw new Error("Target element not found");this.element=t,this.gsapInstance=s._gsap,this.matchMedia=this.gsapInstance.matchMedia(),this.resizeObserver=new ResizeObserver(s.debounce(()=>{this.update()})),this.resizeObserver.observe(this.element)}static registerGSAP(e,t){s._gsap=e,s._ScrollTrigger=t}static debounce(e){let t=null;return(...l)=>{t!==null&&cancelAnimationFrame(t),t=requestAnimationFrame(()=>e(...l))}}init(){this.setup()}destroy(){this.animationFrame!==void 0&&(cancelAnimationFrame(this.animationFrame),this.animationFrame=void 0),this.resizeObserver.disconnect(),this.clearTimeline()}setup(){this.clearTimeline(),this.cloneElements(),this.setBreakpoints(),this.applySkew(),this.timeline=this.createAnimation()}update(){this.animationFrame!==void 0&&cancelAnimationFrame(this.animationFrame),this.animationFrame=requestAnimationFrame(()=>{var e,t;this.setup(),(t=(e=s._ScrollTrigger).refresh)==null||t.call(e)})}createAnimation(){var l;(l=this.timeline)==null||l.kill();const e=this.gsapInstance.timeline({scrollTrigger:{trigger:this.element,start:"top bottom",end:"bottom top",toggleActions:"resume pause resume pause",onUpdate:o=>{const{mcDirection:m}=this.element.dataset;m==="ltr"?e.timeScale(-1):m==="auto"&&e.timeScale(o.direction)}}}),t=this.element.dataset.mcBreakpoint||"";return this.matchMedia.add(t,()=>{const o=parseFloat(this.element.dataset.mcSpeed??"20");return e.to(this.element.children,{duration:o,x:"-100%",repeat:-1,ease:"none"}),e.totalProgress(.5),()=>{e.kill()}}),e}clearTimeline(){var e;(e=this.timeline)==null||e.kill(),this.timeline=void 0,this.gsapInstance.set(this.element.children,{clearProps:"all"})}setBreakpoints(){const{mcMax:e,mcMin:t}=this.element.dataset;this.element.dataset.mcBreakpoint=e?`(max-width: ${parseFloat(e)-.02}px)`:t?`(min-width: ${t}px)`:""}cloneElements(){const e=()=>{for(;this.element.childElementCount>1;)this.element.removeChild(this.element.lastChild)};e();const t=this.element.dataset.mcBreakpoint||"";this.matchMedia.add(t,()=>{const l=this.element.firstElementChild;if(!l)return()=>{};const o=Math.ceil(this.element.scrollWidth/l.clientWidth+2);if(this.element.childElementCount<o){const m=document.createDocumentFragment();for(let c=0;c<o-1;c++){const h=l.cloneNode(!0);m.appendChild(h)}this.element.appendChild(m)}return()=>{e()}})}applySkew(){const{mcSkew:e}=this.element.dataset;e&&(this.element.style.transformOrigin="center center",this.element.style.transform=`skew(0deg, ${e}deg)`)}};a(s,"_gsap",n.gsap),a(s,"_ScrollTrigger",i.ScrollTrigger);let r=s;return r});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marquee-content",
3
- "version": "4.5.1-dev.1",
3
+ "version": "4.5.1-dev.3",
4
4
  "description": "MarqueeContent provides a set of tools for creating dynamic and adaptive ticker animations on web pages using GSAP and ScrollTrigger.",
5
5
  "author": "ux-ui.pro",
6
6
  "license": "MIT",
@@ -52,7 +52,9 @@
52
52
  "rimraf": "6.0.1",
53
53
  "typescript": "5.8.2",
54
54
  "vite": "6.2.1",
55
- "vite-plugin-dts": "4.5.3",
55
+ "vite-plugin-dts": "4.5.3"
56
+ },
57
+ "peerDependencies": {
56
58
  "gsap": "3.12.7"
57
59
  },
58
60
  "keywords": [