GSAP | GreenSock's GSAP JavaScript animation library (including Draggable) | Animation library

 by   greensock JavaScript Version: 3.12.5 License: No License

kandi X-RAY | GSAP Summary

kandi X-RAY | GSAP Summary

GSAP is a JavaScript library typically used in User Interface, Animation applications. GSAP has no bugs, it has no vulnerabilities and it has medium support. You can install using 'npm i @big0range/utils' or download it from GitHub, npm.

GSAP is completely flexible; sprinkle it wherever you want. Zero dependencies. There are many optional plugins and easing functions for achieving advanced effects easily like scrolling, morphing, animating along a motion path or FLIP animations.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              GSAP has a medium active ecosystem.
              It has 16408 star(s) with 1648 fork(s). There are 397 watchers for this library.
              There were 3 major release(s) in the last 6 months.
              There are 1 open issues and 490 have been closed. On average issues are closed in 22 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of GSAP is 3.12.5

            kandi-Quality Quality

              GSAP has 0 bugs and 0 code smells.

            kandi-Security Security

              GSAP has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              GSAP code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              GSAP does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              GSAP releases are not available. You will need to build from source code and install.
              Deployable package is available in npm.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed GSAP and discovered the below as its top functions. This is intended to give you an instant insight into GSAP implemented functionality, and help decide if they suit your requirements.
            • Draggable class .
            • Create a tween instance .
            • Add arc to arc
            • Measures the segment of the segment .
            • Get the progress data from a file path .
            • Split text into multiple unicode characters
            • Splits the inner HTML into an HTML string splitting the inner HTML into a single element . This function splits the inner HTML into two HTML elements .
            • Bezier .
            • simplify a list of points
            • Gets the progress progress of a point on a point .
            Get all kandi verified functions for this library.

            GSAP Key Features

            No Key Features are available at this moment for GSAP.

            GSAP Examples and Code Snippets

            Example (using GSAP)
            JavaScriptdot img1Lines of Code : 53dot img1no licencesLicense : No License
            copy iconCopy
            import React, { Component } from 'react'
            import { TimelineMax } from 'gsap'
            import { States } from 'caspar-graphics'
            
            export default class Example extends Component {
              static previewData = {
                leftText: 'Live',
                rightText: 'nxtedition demo'
              }  
            MDX Deck with Greensock Animation,Getting Started
            JavaScriptdot img2Lines of Code : 48dot img2no licencesLicense : No License
            copy iconCopy
            npm install
            
            import React from 'react'
            import useTweenLite from './useTweenLite'
            import { Bounce } from 'gsap'
            
            
            export default props => {
            
              const [tweenRef] = useTweenLite(props.duration || 1, {startAt:{ y: props.y || -200, x: props.x || 0}, opa  
            GSAP SCROLL,Example
            JavaScriptdot img3Lines of Code : 22dot img3License : Permissive (MIT)
            copy iconCopy
            import gsap from 'gsap';
            import g from 'gsap-scroll';
            const container = document.querySelector('.container');
            const el = document.querySelector('.box');
            
            const tl = gsap.timeline({ paused: true });
            tl.to(el, {y: 400});
            
            const tl2 = gsap.timeline({ pa  

            Community Discussions

            QUESTION

            Accordion not working correctly (active states not being applied for each parent instance)
            Asked 2022-Apr-17 at 12:41

            I have accordions which on click, grow in height and also changes the image to what is relevant to that section (this is done based on data-id).

            Here are the requirements that I'm trying to achieve:

            • Each accordion group is contained within .accordionRepeater__wrapper and for each instance of that class, I'm trying to get the first .accordionCard. to have the open state.
            • Only have the first .accordionCard in each accordionRepeater__wrapper open on page load, so the user can see some content by default.
            • Only have one .accordionCard in each accordionRepeater__wrapper open at a time (user cannot have two or more accordionCard open in a accordionRepeater__wrapper at one time).

            Currently results:

            • The first .accordionCard in the first .accordionRepeater__wrapper has the class of .accordionCard--open on page load, but doesn't show the content for it.
            • The first instance of .accordionCard in the second .accordionRepeater__wrapper doesn't have the class of .accordionCard--open and doesn't show the image. Only when I click on it does the image and content show.

            See my attempt here:

            ...

            ANSWER

            Answered 2022-Apr-16 at 14:40

            QUESTION

            Sections from an array of objects
            Asked 2022-Apr-01 at 23:13

            I am trying to recreate this codepen with react and gsap on here and i have been trying to recreate this for about an hour now and do not even know where to start from, please who can help. i do not want to create the sections the same way in that codepen but rather form the details from an array of objects meaning creating just once component, i am fairly new to react and i would like know how to do something like that in react, looking at it from vanillajs perspective, i already know what is going on and i also created it like this in react but i want a situation where i have minimal code and the an array of objects forms one component making it more dynamic so i can click on it to get more information about each section that comes in. kindly assist Codepen link below https://codepen.io/designsbyharp/pen/jObpWZg

            HTML

            ...

            ANSWER

            Answered 2022-Apr-01 at 23:13

            If I'm understanding your question correctly you want a more DRY implementation so the slides are not explicitly written out in HTML/JSX.

            Gather up the values that are different between each slide, i.e. the heading and image sources, into an array that can be mapped in the return.

            Example:

            Source https://stackoverflow.com/questions/71713138

            QUESTION

            GSAP ScrollTrigger - Pin animation not working correctly
            Asked 2022-Mar-20 at 13:40

            I have an element called .listing__nav which I want to pin upon scroll.

            When the .listing__nav touches the top of the window, I want it to become fixed and to unpin only when the banner element comes into view.

            To achieve this, I've tried the following:

            ...

            ANSWER

            Answered 2022-Mar-20 at 13:40

            Resolved it with the below JS.

            I was creating two ScrollTriggers which was not required.

            Source https://stackoverflow.com/questions/71529008

            QUESTION

            Animating child elements in ScrollTrigger GSAP horizontal scroll
            Asked 2022-Feb-10 at 06:32

            I have an svg which forms the basis of my horizontal scroller.

            Within this svg, I have added the class .animate to the elements which I want to fade in up as the item comes into view. The .animate class for reference has been added to all the text items in the svg.

            Currently, only the .animate elements that are in view initially fade in up. When I scroll down to continue the scroller, the other elements are static. They're not fading in or translating up or down in any way?

            TL;DR, here is what I'm trying to achieve:

            • When the scroller pins in place, and the user continued to scroll down, start fading away .horizontalScroller__intro.
            • Once .horizontalScroller__intro has faded away, start the horizontal scroll for .horizontalScroller__items
            • Any elements with the class of .animate in my scroller will fade in up to its original position.

            Note: I understand SO rules and preferences to post code here. But, my demo's contain a length SVG, which I cannot post here as it exceeds SO's character limit.

            Here is a demo of my latest approach

            From the scrollTrigger docs, containerAnimation is what helps achieve animations on horizontal scrollers, and is what I've tried to achieve.

            However, in my demo above, I have the following issues:

            1. .horizontalScroller__intro doesn't show initially, when it should, and should fade out on scroll.
            2. The horizontal scroller doesn't work anymore
            3. The .animate elements that are in view, do not fade in up

            If I use timeline (see below snippet), then the intro fade out and scroller works. But, doesn't animate in the child elements, which is where I need containerAnimation

            ...

            ANSWER

            Answered 2022-Feb-10 at 06:32

            You need to use onUpdate method on the scroll trigger.

            Source https://stackoverflow.com/questions/70928780

            QUESTION

            Failed to resolve module specifier "three" - Working Three/Wordpress Integration Suddenly Failed
            Asked 2022-Feb-09 at 19:48

            I manage a WordPress website which uses a Three.js animation on the homepage. I built this site months ago and everything had been working perfectly fine - I even showed it to someone a week ago and nothing was amiss. Yesterday, I check the site and find that Three is not loading, and that I have this in the console:

            Uncaught TypeError: Failed to resolve module specifier "three". Relative references must start with either "/", "./", or "../".

            I don't have a line or even file to reference, the error is logged coming from the first line of the root domain. I want to emphasize that I had changed absolutely nothing about the set-up. I hadn't even updated to WP 5.9 yet. This is how I had originally set things up. Sorry if it's not best practices, but I want to emphasize that it did in fact work fine. Enqueuing animation javascript file and defining its type as "module":

            ...

            ANSWER

            Answered 2022-Feb-09 at 19:48

            I had exact same problem. I uploaded my project on Github a month ago (https://kramzin.github.io/threejs-task/) and since then didn't change a one symbol, but about a week ago it started showing same strange error in console. I found following: "Since r137 using ES6 modules like GLTFLoader in the browser requires an import map. Add the following section right below you canvas."

            Source https://stackoverflow.com/questions/70977276

            QUESTION

            GSAP and ScrollTrigger sections overlapping and executing before previous section has finished
            Asked 2022-Jan-29 at 08:07

            I have a problem that keeps popping up with GSAP and ScrollTrigger.

            I have multiple pinned sections where, as the user scrolls into a section, images slide in from the side.

            When I make these images slide in from the same side everything is fine, but as soon as I make a section slide in from the right the sections start to overlap as though it is executing before the previous pin has finished.

            Strangely, if the top section slides in from the right then the next section is fine, but any further down the page cause issues.

            I have a Codepen here: https://codepen.io/rob-wahlberg-beaney/pen/BamNxaN?editors=1010

            Here's the code to slide things left:

            ...

            ANSWER

            Answered 2022-Jan-29 at 08:07

            Your pinning sections are all in the same HTML level and have no parent to actually pin them on. And you initialize them not sequentially which makes the HTML structure messed up.

            If your sections are in this order left-right-left-right, you should run the ScrollTrigger in the same order. As of now, your script is running like left-left-right-right which is not good.

            The solution for your case is to initialize the ScrollTrigger sequentially from top to bottom, we can do that by merging your scripts into one like this.

            Source https://stackoverflow.com/questions/70893045

            QUESTION

            GSAP/SVG setting x/y origin based on active tab, and looping through event listeners
            Asked 2022-Jan-26 at 18:29

            I am working on a doughnut circle svg with expanding tabs. As of last night the expanding tabs are fully functional and the correct x/y transform is applied on mouseenter/mouseleave. (the x/y is essential on both mouse enter and mouse leave for proper transform origin - this was difficult to get each tab expansion to appear centered as it is a circle).

            Today I have tried going further with the project by creating an additional loop that displays corresponding content based on the active tab index. (This is working).

            Now I want to go a step further by making the current tab stay expanded until another tab is hovered over. Right now the eventlistener mouseleave applies when my mouse leaves the tab (obviously). What can I do to keep the current tab "active" unless hovering over another tab? (rather than the mouseleave?). I am still fairly inexperienced with JS, I'll be content if anyone could just send me in the right direction

            CodePen

            ...

            ANSWER

            Answered 2022-Jan-26 at 18:29

            Instead of using the mouseout event here, you will have to use a "custom event".

            Yes, you can create events... Read more here and dispatch them. That allows you to trigger something special without interfering with the "normal behavior" of any other regular event.

            Below, I called the event "retract". Yay! You also can name it like you wish!

            Here is the function:

            Source https://stackoverflow.com/questions/70868023

            QUESTION

            GSAP/CSS transform origin and glitchy hover effect/ SVG Regions
            Asked 2022-Jan-26 at 01:54

            I am attempting to animate an svg doughnut circle with gsap. After much testing with code and layering, I am stumped with a glitchy hover effect (which I tried to resolve with pointer events) and the transform origin is only applied to a few of the expanded tabs. I am wondering if this might be that the tabs may have a different bounding box?

            Comments added per request:

            Side Note: I've tried applying fill-box to entire svg instead, I'm wondering if I need a parent layer thats an exact square so I can apply the transform origin for the child "expandtabs" to the center of that?

            I assumed I needed to iterate through an array of both to have the tabs correspond. Unless the tabs were children of each other?

            TLDR; Tabs are not scaling from center of circle, and glitchy hover effect

            CodePen Example

            ...

            ANSWER

            Answered 2022-Jan-26 at 01:54

            About the glitchy hover effect, the mouseenter and mouseleave will do the job better. mouseover is firering way to much...

            For the "growing" effect, it is more complex. The transform-origin CSS property won't be enought. Any way, you will need different values for each five parts of the circle.

            Additionnaly, you will need to adjust a transition to "fit" or "keep" the inner part of the circle in place. I suggest you to look at the fromTo method of GSAP. That will allow you to specify explicitely the starting and the landing coordinates.

            Be patient! ;)

            Source https://stackoverflow.com/questions/70857509

            QUESTION

            cursor color - smooth transition between diferent backgrounds
            Asked 2022-Jan-24 at 19:19

            On a website I'm creating there is a cursor that needs to change its color smoothly.
            When it is on a white background the cursor needs to be the blue #0059ff (this is important and I will explain why later on) and when it is on blue then the cursor needs to be white; and the transition needs to be smooth like so:

            To get the white color with mix-blend-mode I'm calculating the inverted color using adjust-hue($color, 180) (in SCSS) and applying this color to the cursor.

            When the background color is #0000ff then cursor should be #ffff00.

            I have started a prototype using mix-blend-mode: difference that works on "primary colors" (basically colors like #ff0000, #ff00ff and so on).
            Result:

            Problems begin when I try to change the "primary" blue #0000ff to the one needed by the project #0059ff. The inverted color is calculated to be #ffa600 and the result is, let's say, "unsatisfactory" because I want the cursor to be white on some background color and said color on white background.

            Calculating the difference will not work with this color and I have no idea how to make it so that when the cursor is not over the white background then the cursor becomes blue (-ish) and when it's over the blue background it becomes white.

            My whole code so far:
            (SCSS compiled so it can run in StackSnippet)

            ...

            ANSWER

            Answered 2022-Jan-24 at 19:19

            I have no idea how to make it so that when the cursor is not over the white background then the cursor becomes blue (-ish) and when it's over the blue background it becomes white.

            In this case, the mix-blend mode is very limiting. When you want to have completely unrelated colors then it's not possible to use it.

            However, I am able to achieve the desired effect using clip-path:

            Source https://stackoverflow.com/questions/70808837

            QUESTION

            Parallax effect within pinned GSAP container
            Asked 2022-Jan-23 at 23:42

            I have a block which becomes pinned and scrolls horizontally.

            Within this block, I have a vector which has a width of 3573px.

            When a user scrolls horizontally, I want the vector to scroll also, alongside the images in my demo.

            Have tried moving my vector under .horizontalScroller__scroll, so that it scrolls alongside the images, but that didn't work.

            See demo:

            ...

            ANSWER

            Answered 2022-Jan-23 at 23:42

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install GSAP

            View the full documentation here, including an installation guide with videos.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries