Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add animation on scroll in about-us page. #66

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
"@nuxtjs/robots": "^2.4.2",
"@nuxtjs/sitemap": "^2.4.0",
"core-js": "^3.21.1",
"gsap": "^3.11.0",
"nuxt": "^2.15.8",
"nuxt-gsap-module": "^1.7.1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove nuxt-gsap-module

"opti-image": "^0.10.0",
"particles.js": "^2.0.0",
"vue-lottie": "^0.2.1"
Expand All @@ -39,7 +41,6 @@
"eslint-plugin-vuejs-accessibility": "^0.7.1",
"husky": "^7.0.4",
"is-ci": "^3.0.1",
"nuxt-gsap-module": "^1.6.0",
"nuxt-purge-icons-module": "^0.7.0",
"nuxt-windicss": "^2.2.5",
"prettier": "^2.1.2",
Expand Down
27 changes: 25 additions & 2 deletions pages/aboutus/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</h1>
<section class="w-9/10 mx-auto">
<figure v-for="(con, idx) in content" :key="con.heading">
<about-us-card :index="idx" :heading="con.heading" :image="con.image" :text="con.text" />
<about-us-card :class="con.class" :index="idx" :heading="con.heading" :image="con.image" :text="con.text" />
<nuxt-img
v-if="!(idx & 1) && (idx != content.length - 1)"
src="/aboutus/4.webp"
Expand Down Expand Up @@ -66,14 +66,14 @@

<script lang="ts">
import { defineComponent } from '@nuxtjs/composition-api'
import { gsap } from 'gsap'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gsap isn't there in package.json

import AboutUsCard from '~/components/about-us/aboutuscard.vue'
import aboutuslogo from '~/components/about-us/aboutuslogo.vue'
import achievementslogo from '~/components/about-us/achievementslogo.vue'
import carousel3d from '~/components/about-us/carousel/carousel-3d.vue'
import slide from '~/components/about-us/carousel/carousel-slide.vue'
import youtube from '~/components/about-us/youtube.vue'
import LoadingSpinner from '~/components/LoadingSpinner.vue'

export default defineComponent({
components: {
aboutuslogo,
Expand All @@ -89,6 +89,7 @@ export default defineComponent({
slides: [] as any,
content: [
{
class: 'text1',
heading: 'WHAT IS SDG?',
image: '/aboutus/1.webp',
text: `One of the prominent pillars of COPS, IIT (BHU) is SDG. With the
Expand All @@ -102,6 +103,7 @@ export default defineComponent({
a fully functional mobile application.`
},
{
class: 'text2',
heading: 'WHAT WE DO?',
image: '/aboutus/2.webp',
text: `Whether Mobile Development, Desktop Development, Web Development, Game
Expand All @@ -114,6 +116,7 @@ export default defineComponent({
of our sought-after workshops.`
},
{
class: 'text3',
heading: 'OUR AREAS OF INTEREST',
image: '/aboutus/3.webp',
text: `Our motto is constantly learning and revamping. Hackalog, our very own
Expand Down Expand Up @@ -143,6 +146,26 @@ export default defineComponent({
'One of the most prominent pillars of COPS, IIT (BHU) is SDG. We at Software Development Group are here to unravel all these mysteries for you to perceive, prepare and produce. We got you taken care of, from displaying Hello World on your Local Host to developing a fully functional mobile application. Whether Mobile Development, Desktop Development, Web Development, Game Development, or Cloud Development, we manufacture all units here.'
}
]
},
mounted () {
this.content.forEach((idx) => {
gsap.timeline({
scrollTrigger: {
trigger: '.' + idx.class,
start: 'center center',
end: 'bottom top',
scrub: true,
pin: true
}
})
.from('.' + idx.class, {
opacity: 0,
y: 50
})
.to('.' + idx.class, {
opacity: 1
})
})
}
})
</script>
Loading