scrollmagic-plugin-gsap | Add animation.gsap.js plugin | Animation library
kandi X-RAY | scrollmagic-plugin-gsap Summary
kandi X-RAY | scrollmagic-plugin-gsap Summary
Add animation.gsap.js plugin to ScrollMagic in ES6 with no problems
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of scrollmagic-plugin-gsap
scrollmagic-plugin-gsap Key Features
scrollmagic-plugin-gsap Examples and Code Snippets
yarn add -D scrollmagic gsap scrollmagic-plugin-gsap
import ScrollMagic from 'scrollmagic'
import gsap from 'gsap'
import { ScrollMagicPluginGsap } from 'scrollmagic-plugin-gsap'
ScrollMagicPluginGsap(ScrollMagic,
Community Discussions
Trending Discussions on scrollmagic-plugin-gsap
QUESTION
My Gatsby site can't be deployed to Netlify because of a WebpackError: ReferenceError: window is not defined
I've tried:
- Wrapping return statements in
if(window !== undefined)
checks which didn't work - Putting a require statement in my index.js:
if (typeof window !== 'undefined') { require('scrollmagic') require('scrollmagic-plugin-gsap') }
which didn't work
I noticed that the import statement import Scrollmagic from 'scrollmagic'
already causes the error because I once tried deploying the site without any scrollmagic code except for the import.
The scrollmagic part of my component looks like this (I deleted some irrelevant variable assignments in this example):
...ANSWER
Answered 2020-Apr-03 at 07:34I can't see where do you call window
on your code but the way to solve this all issues is to delay the window
call after the component is rendered using a componentDidMount
(in class-based component) or useEffect
with empty deps ([]
) in stateless-based component. So, you need to do something like this:
QUESTION
I'm trying to use ScrollMagic & gsap libraries in react, everything was fine until I tried to build my code, I tried all the import solutions I could find on the web but it doesn't seem to behave the same way.
I created a list of cards that scrolls horizontally when some section is reached, on the dev version it behaves exactly that way but when I'm in a production version (after build) it scrolls in diagonal way.
Here's some of my code and how I installed the libraries:
installing gsap:
...ANSWER
Answered 2020-Mar-09 at 15:32The problem that was causing that unwanted behavior was the perspective
element on the css, adding a perspective is necessary when using a 3d animation but in this case it should be not used since the animation is just a 2d scroll, that transforms the verticall scroll to a horizontal one, it took me couple of days to figure this out and I hope it will help others build such nice animations. There were some other issues with my code but I fixed everything and wanted to share this so it can be a reference to anyone who would want to make something similar.
Please find down below the final version of my code with a live demo on CodePen:
Live Demo Of 'React + ScrollMagic + Gsap : Horizontal with pined title to top' created by me.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install scrollmagic-plugin-gsap
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page