gsap-react-marquee 0.1.5 → 0.1.7

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/dist/index.d.ts CHANGED
@@ -187,7 +187,7 @@ declare const calculateDuplicates: (marqueeChildrenWidth: number, containerMarqu
187
187
  */
188
188
  declare const getMinWidth: (marqueesChildren: HTMLElement[], totalWidth: number, containerMarqueeWidth: number, props: GSAPReactMarqueeProps) => string | number;
189
189
  /**
190
- * Creates a complex fill-based marquee animation with seamless looping
190
+ * Creates a complex marquee animation with seamless looping and draggable support
191
191
  *
192
192
  * This is the core animation engine that creates smooth, continuous scrolling.
193
193
  * It handles the complex math required for seamless looping by calculating
@@ -198,19 +198,23 @@ declare const getMinWidth: (marqueesChildren: HTMLElement[], totalWidth: number,
198
198
  * 2. **Seamless Looping**: Calculate track length and loop points to prevent gaps
199
199
  * 3. **Staggered Animation**: Each element starts at different times for smooth flow
200
200
  * 4. **Direction Handling**: Support forward and reverse directions with proper timing
201
+ * 5. **Integrated Draggable**: Optional support for drag interaction with manual control
201
202
  *
202
203
  * Technical Details:
203
204
  * - Uses xPercent for percentage-based positioning (responsive to element width changes)
204
205
  * - Creates two-part animation: main movement + seamless loop reset
205
206
  * - Calculates precise durations based on distance and speed for consistent motion
207
+ * - Implements draggable with intelligent pause/resume animation handling
206
208
  *
207
209
  * @param elementsToAnimate - Array of DOM elements to animate (content or containers)
208
210
  * @param startX - Starting X position reference point
209
211
  * @param tl - GSAP timeline to add animations to
210
212
  * @param isReverse - Whether animation should play in reverse direction
213
+ * @param draggableTrigger - Element(s) that will trigger the draggable functionality
214
+ * @param isVertical - Whether the marquee scrolls vertically
211
215
  * @param props - Configuration object with spacing, speed, delay, and other settings
212
216
  */
213
- declare const coreAnimation: (elementsToAnimate: HTMLElement[], startX: number, tl: gsap.core.Timeline, isReverse: boolean, props: GSAPReactMarqueeProps) => void;
217
+ declare const coreAnimation: (elementsToAnimate: HTMLElement[], startX: number, tl: gsap.core.Timeline, isReverse: boolean, draggableTrigger: HTMLElement | HTMLElement[], isVertical: boolean, props: GSAPReactMarqueeProps) => void;
214
218
 
215
219
  export { calculateDuplicates, cn, coreAnimation, GSAPReactMarquee as default, getEffectiveBackgroundColor, getMinWidth, setupContainerStyles };
216
220
  export type { GSAPReactMarqueeProps };
@@ -1 +1 @@
1
- .gsap-react-marquee-container:after{background:linear-gradient(270deg,hsla(0,0%,100%,0) 0,var(--gradient-color) 75%);content:"";height:100%;left:0;position:absolute;top:0;width:15%;z-index:10}.gsap-react-marquee-container:before{background:linear-gradient(90deg,hsla(0,0%,100%,0) 0,var(--gradient-color) 75%);content:"";height:100%;position:absolute;right:0;top:0;width:15%;z-index:10}.gsap-react-marquee{flex:1;height:max-content;width:auto}.gsap-react-marquee,.gsap-react-marquee-content{display:flex;line-height:100%;white-space:preserve nowrap}.gsap-react-marquee-content{overflow:hidden;width:max-content}
1
+ .gsap-react-marquee-container:after{background:linear-gradient(270deg,hsla(0,0%,100%,0) 0,var(--gradient-color) 75%);left:0}.gsap-react-marquee-container:after,.gsap-react-marquee-container:before{content:"";height:100%;pointer-events:none;position:absolute;top:0;width:15%;z-index:10}.gsap-react-marquee-container:before{background:linear-gradient(90deg,hsla(0,0%,100%,0) 0,var(--gradient-color) 75%);right:0}.gsap-react-marquee{flex:1;height:max-content;width:auto}.gsap-react-marquee,.gsap-react-marquee-content{display:flex;line-height:100%;white-space:preserve nowrap}.gsap-react-marquee-content{overflow:hidden;width:max-content}