1.1.9 • Published 1 year ago

gsap-quicktools v1.1.9

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

License Information

Attention! Have in mind that this package is based on GSAP. Please inform yourself about their license before using this package.

Components

NameDescription
GSAPFadeWrapperAttaches a fade animation to the provided child elements.
GSAPFadeSlideWrapperAttaches a fade and slide animation to the provided child elements.
GSAPScaleXWrapperAttaches a scaleX animation to the provided child elements.
ScrollElementEnables scrolling through a scrollable element by clicking/touching.

GSAPFadeWrapper

Adds a fade animation to the provided child elements.

Table Prop Overview

PropTypeDefaultDescription
elementTypeReact.ElementTypedivOptional, the wrapper's element type
classNamesstring""Optional, CSS classes for the wrapper itself
isVisiblebooleantrueOptional, render condition of the wrapped elements
fadeDurationnumberor{ fadeInDuration: number, fadeOutDuration: number }0.5Optional, duration of the fade animations in seconds

Children elements/components may be included.

Example

<GSAPFadeWrapper
  elementType="p"
  classNames="flex flex-col bg-red-600"
  isVisible={renderCondition}
  fadeDuration={{ fadeInDuration: 0.5, fadeOutDuration: 1.5 }}
>
  Include any child elements/components
</GSAPFadeWrapper>

GSAPFadeSlideWrapper

Adds both a fade and slide animation to the provided child elements

Table Prop Overview

PropTypeDefaultDescription
elementTypeReact.ElementTypedivOptional, the wrapper's element type
classNamesstring""Optional, CSS classes for the wrapper itself
isVisiblebooleantrueOptional, render condition of the wrapped elements
slideDirectionslideDown or slideUp or slideFromRight or slideFromLeftslideUpOptional, slide direction
slideLengthnumber50Optional, slide length
animationDurationnumberor{ animationInDuration: number, animationOutDuration: number }0.5Optional, Fade & slide duration in seconds

Children elements/components may be included.

Example

<GSAPFadeSlideWrapper
  classNames="text-center custom_css_class"
  elementType="h1"
  isVisible={renderCondition}
  slideDirection="slideDown"
  animationDuration={{ animationInDuration: 0.5, animationOutDuration: 1.5 }}
  slideLength={150}
>
  This is some text!
</GSAPFadeSlideWrapper>

GSAPScaleXWrapper

Adds a scaleX entering and closing animation to the provided child elements

Table Prop Overview

PropTypeDefaultDescription
elementTypeReact.ElementTypedivOptional, the wrapper's element type
classNamesstring""Optional, CSS classes for the wrapper itself
isVisiblebooleantrueOptional, render condition of the wrapped elements
animationDurationnumberor{ animationInDuration: number, animationOutDuration: number }0.5Optional, Fade & slide duration in seconds
transformOriginstringcenter centerOptional, transformOrigin property

Children elements/components may be included.

Example

<GSAPScaleXWrapper
  classNames="w-36 h-1 bg-red-800"
  isVisible={isShown}
  animationDuration={2.5}
/>

MouseScrollElement

This component enables scrolling within a separate component or element through holding down the mouse on this component. For instance, users can navigate a list using the MouseScrollElement without having to use the actual scroll button on their mouse. To enable this functionality, it's essential to link a reference (ref) to both this component and the target element intended for scrolling. This component doesn't utilize GSAP, therefore the missing GSAP prefix. To handle cases where text is selected while holding down the button, consider using (User Select)https://developer.mozilla.org/en-US/docs/Web/CSS/user-select. This component doesn't support touch events on mobile devices out of the box. For enhanced mobile interaction, consider using libraries like (Hammer.js)https://hammerjs.github.io/, which offer comprehensive touch event handling capabilities.

Table Prop Overview

PropTypeDefaultDescription
elementTypeReact.ElementTypedivOptional, the component's element type
classNamesstring""Optional, CSS classes for the component itself
scrollAmountnumber2Optional, determines the scroll speed
scrollDirection{ horizontal: "left" or "right" } or { vertical: "down" or "up" }{ vertical: "down" }Optional, sets the scroll direction
refReact.RefObject<HTMLElement>Required, the ref that targets the scrollable element

Children elements/components may be included.

Example

<ScrollElement
  ref={scrollTargetRef}
  classNames="w-96 h-24 bg-red-200"
  elementType={"button"}
  scrollDirection={{ horizontal: "right" }}
  scrollAmount={4}
>
  SCROLL RIGHT
</ScrollElement>
1.1.9

1 year ago

1.1.8

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago