Gathering detailed insights and metrics for bd-nuxt-gsap-module
Gathering detailed insights and metrics for bd-nuxt-gsap-module
Gathering detailed insights and metrics for bd-nuxt-gsap-module
Gathering detailed insights and metrics for bd-nuxt-gsap-module
npm install bd-nuxt-gsap-module
Typescript
Module System
Node Version
NPM Version
69.3
Supply Chain
98.7
Quality
74.9
Maintenance
100
Vulnerability
99.5
License
Total Downloads
592
Last Day
1
Last Week
1
Last Month
15
Last Year
85
Minified
Minified + Gzipped
Latest Version
1.6.0
Package Id
bd-nuxt-gsap-module@1.6.0
Unpacked Size
18.53 kB
Size
4.01 kB
File Count
4
NPM Version
8.1.0
Node Version
16.13.0
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
-90.9%
1
Compared to previous week
Last Month
50%
15
Compared to previous month
Last Year
-22.7%
85
Compared to previous year
1
GSAP module for Nuxt.js
GSAP
javascript animation libraryv-gsap
directive 🔥this.$gsap
Club GreenSock
premium pluginsZero-config
setup ready to go 🚀nuxt-gsap-module
dependency to your project1$ npm install --save-dev nuxt-gsap-module # or yarn add --dev nuxt-gsap-module
nuxt-gsap-module
to the buildModules
section of nuxt.config.js
1// nuxt.config.js 2 3export default { 4 buildModules: ['nuxt-gsap-module'], 5 6 gsap: { 7 /* module options */ 8 } 9}
That's it! Start developing your app ✨
Here are some code examples
v-gsap.set
1<!-- index.vue --> 2 3<template> 4 <p v-gsap.set="{ x: 100, y: 50 }">NUXT GSAP</p> 5</template>
v-gsap.to
1<!-- index.vue --> 2 3<template> 4 <h1 5 v-gsap.to="{ 6 rotation: 360, 7 x: 150, 8 duration: 2 9 }" 10 > 11 NUXT GSAP 12 </h1> 13</template>
v-gsap.from
1<!-- index.vue --> 2 3<template> 4 <span 5 v-gsap.from="{ 6 opacity: 0, 7 x: -200, 8 duration: 1 9 }" 10 > 11 NUXT GSAP 12 </span> 13</template>
v-gsap.fromTo
1<!-- index.vue --> 2 3<template> 4 <p 5 v-gsap.fromTo="[ 6 { opacity: 0, y: -350 }, 7 { opacity: 1, y: 0, duration: 3 } 8 ]" 9 > 10 NUXT GSAP 11 </p> 12</template>
1// index.vue 2 3{ 4 mounted() { 5 this.boxRotation() 6 }, 7 8 methods: { 9 boxRotation() { 10 const gsap = this.$gsap 11 gsap.to('.box', { rotation: 27, x: 100, duration: 1 }) 12 } 13 } 14}
1// nuxt.config.js 2 3{ 4 // Enable module 5 buildModules: ['nuxt-gsap-module'], 6 7 // Add global page transition 8 pageTransition: { 9 name: 'page', 10 mode: 'out-in', 11 css: false, 12 13 beforeEnter(el) { 14 this.$gsap.set(el, { 15 opacity: 0 16 }) 17 }, 18 19 enter(el, done) { 20 this.$gsap.to(el, { 21 opacity: 1, 22 duration: 0.5, 23 ease: 'power2.inOut', 24 onComplete: done 25 }) 26 }, 27 28 leave(el, done) { 29 this.$gsap.to(el, { 30 opacity: 0, 31 duration: 0.5, 32 ease: 'power2.inOut', 33 onComplete: done 34 }) 35 } 36 } 37}
✅ The module automatically registers plugins globally (after plugin activation in the settings), so you won’t have to worry about it (applies to all plugins).
1// nuxt.config.js 2 3{ 4 gsap: { 5 extraPlugins: { 6 /** 7 * After activation, plugins are automatically 8 * registered and available globally 9 */ 10 scrollTo: true, 11 scrollTrigger: true 12 }, 13 extraEases: { 14 expoScaleEase: true 15 } 16 } 17}
1// Usage 2 3export default { 4 mounted() { 5 this.animateOnScroll() 6 }, 7 8 methods: { 9 animateOnScroll() { 10 this.$gsap.to(window, { duration: 2, scrollTo: 1000 }) 11 12 this.$gsap.to('.box', { 13 x: 500, 14 ease: 'Power1.easeInOut', 15 scrollTrigger: { 16 trigger: '.content', 17 pin: true, 18 end: 'bottom', 19 scrub: true 20 } 21 }) 22 } 23 } 24}
Default options
1// nuxt.config.js 2 3{ 4 gsap: { 5 extraPlugins: { 6 cssRule: false, 7 draggable: false, 8 easel: false, 9 motionPath: false, 10 pixi: false, 11 text: false, 12 scrollTo: false, 13 scrollTrigger: false 14 }, 15 extraEases: { 16 expoScaleEase: false, 17 roughEase: false, 18 slowMo: false, 19 } 20 } 21}
gsap
true
✅ GSAP's core is enabled by default so there is no need for additional configuration.
1// nuxt.config.js 2 3{ 4 buildModules: ['nuxt-gsap-module'] 5}
Available globally
1// Access GSAP by using 2this.$gsap 3 4// or 5const gsap = this.$gsap 6gsap.to('.box', { rotation: 27, x: 100, duration: 1 })
Use in templates
1<div v-gsap.to="{ /* ... */ }"></div>
1<div v-gsap.from="{ /* ... */ }"></div>
1<div v-gsap.fromTo="[{ /* ... */ }, { /* ... */ }]"></div>
1<div v-gsap.set="{ /* ... */ }"></div>
cssRule
false
1// nuxt.config.js 2 3{ 4 gsap: { 5 extraPlugins: { 6 cssRule: true 7 } 8 } 9}
1// Access the plugin by using 2this.$CSSRulePlugin
draggable
false
1// nuxt.config.js 2 3{ 4 gsap: { 5 extraPlugins: { 6 draggable: true 7 } 8 } 9}
1// Access the plugin by using 2this.$Draggable
easel
false
1// nuxt.config.js 2 3{ 4 gsap: { 5 extraPlugins: { 6 easel: true 7 } 8 } 9}
1// Access the plugin by using 2this.$EaselPlugin
motionPath
false
1// nuxt.config.js 2 3{ 4 gsap: { 5 extraPlugins: { 6 motionPath: true 7 } 8 } 9}
1// Access the plugin by using 2this.$MotionPathPlugin
pixi
false
1// nuxt.config.js 2 3{ 4 gsap: { 5 extraPlugins: { 6 pixi: true 7 } 8 } 9}
1// Access the plugin by using 2this.$PixiPlugin
text
false
1// nuxt.config.js 2 3{ 4 gsap: { 5 extraPlugins: { 6 text: true 7 } 8 } 9}
1// Access the plugin by using 2this.$TextPlugin
scrollTo
false
1// nuxt.config.js 2 3{ 4 gsap: { 5 extraPlugins: { 6 scrollTo: true 7 } 8 } 9}
1// Access the plugin by using 2this.$ScrollToPlugin
scrollTrigger
false
1// nuxt.config.js 2 3{ 4 gsap: { 5 extraPlugins: { 6 scrollTrigger: true 7 } 8 } 9}
1// Access the plugin by using 2this.$ScrollTrigger
expoScaleEase
false
1// nuxt.config.js 2 3{ 4 gsap: { 5 extraEases: { 6 expoScaleEase: true 7 } 8 } 9}
1// Access the plugin by using 2this.$ExpoScaleEase
roughEase
false
1// nuxt.config.js 2 3{ 4 gsap: { 5 extraEases: { 6 roughEase: true 7 } 8 } 9}
1// Access the plugin by using 2this.$RoughEase
slowMo
false
1// nuxt.config.js 2 3{ 4 gsap: { 5 extraEases: { 6 slowMo: true 7 } 8 } 9}
1// Access the plugin by using 2this.$SlowMo
nuxt-gsap-module
supports Club GreenSock premium plugins. They can be easily activated via module
settings, just like the free ones.
Installation
premium
plugins as usual.customEase
false
1// nuxt.config.js 2 3{ 4 gsap: { 5 clubPlugins: { 6 customEase: true 7 } 8 } 9}
1// Access the plugin by using 2this.$CustomEase
customBounce
false
1// nuxt.config.js 2 3{ 4 gsap: { 5 clubPlugins: { 6 customBounce: true 7 } 8 } 9}
1// Access the plugin by using 2this.$CustomBounce
customWiggle
false
1// nuxt.config.js 2 3{ 4 gsap: { 5 clubPlugins: { 6 customWiggle: true 7 } 8 } 9}
1// Access the plugin by using 2this.$CustomWiggle
drawSVG
false
1// nuxt.config.js 2 3{ 4 gsap: { 5 clubPlugins: { 6 drawSVG: true 7 } 8 } 9}
1// Access the plugin by using 2this.$DrawSVGPlugin
flip
false
1// nuxt.config.js 2 3{ 4 gsap: { 5 clubPlugins: { 6 flip: true 7 } 8 } 9}
1// Access the plugin by using 2this.$Flip
gsDevTools
false
1// nuxt.config.js 2 3{ 4 gsap: { 5 clubPlugins: { 6 gsDevTools: true 7 } 8 } 9}
1// Access the plugin by using 2this.$GSDevTools
inertia
false
1// nuxt.config.js 2 3{ 4 gsap: { 5 clubPlugins: { 6 inertia: true 7 } 8 } 9}
1// Access the plugin by using 2this.$InertiaPlugin
morphSVG
false
1// nuxt.config.js 2 3{ 4 gsap: { 5 clubPlugins: { 6 morphSVG: true 7 } 8 } 9}
1// Access the plugin by using 2this.$MorphSVGPlugin
motionPathHelper
false
1// nuxt.config.js 2 3{ 4 gsap: { 5 clubPlugins: { 6 motionPathHelper: true 7 } 8 } 9}
1// Access the plugin by using 2this.$MotionPathHelper
physics2D
false
1// nuxt.config.js 2 3{ 4 gsap: { 5 clubPlugins: { 6 physics2D: true 7 } 8 } 9}
1// Access the plugin by using 2this.$Physics2DPlugin
physicsProps
false
1// nuxt.config.js 2 3{ 4 gsap: { 5 clubPlugins: { 6 physicsProps: true 7 } 8 } 9}
1// Access the plugin by using 2this.$PhysicsPropsPlugin
scrambleText
false
1// nuxt.config.js 2 3{ 4 gsap: { 5 clubPlugins: { 6 scrambleText: true 7 } 8 } 9}
1// Access the plugin by using 2this.$ScrambleTextPlugin
splitText
false
1// nuxt.config.js 2 3{ 4 gsap: { 5 clubPlugins: { 6 splitText: true 7 } 8 } 9}
1// Access the plugin by using 2this.$SplitText
GSAP
For more information, check the official GSAP site.
Copyright (c) GreenSock
Nuxt GSAP module
Copyright (c) Ivo Dolenc
No vulnerabilities found.
No security vulnerabilities found.