Created
July 21, 2020 19:37
-
-
Save Bachana123/7f636a1af53b6c4ec3a22f511c8fd241 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/////// install first | |
npm i -D scrollmagic gsap scrollmagic-plugin-gsap | |
/////// plugin | |
/* eslint-disable import/no-webpack-loader-syntax */ | |
import Vue from 'vue' | |
import { TweenMax, TimelineMax } from 'gsap' | |
import * as ScrollMagic from 'scrollmagic' | |
import { ScrollMagicPluginGsap } from 'scrollmagic-plugin-gsap' | |
ScrollMagicPluginGsap(ScrollMagic, TweenMax, TimelineMax) | |
const GSAPScrollMagic = { | |
install(Vue, options) { | |
// GSAP | |
Vue.prototype.$GSAP = { | |
TweenMax, | |
TimelineMax | |
// Linear, | |
// Power1, | |
// Power2, | |
// Power3, | |
// Back, | |
} | |
// ScrollMagic | |
Vue.prototype.$ScrollMagic = ScrollMagic | |
} | |
} | |
Vue.use(GSAPScrollMagic) | |
//////// nuxt config | |
{ src: '~/plugins/gsap-scrollmagic.js', mode: 'client', ssr: false }, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment