added animations and pageLoad and preLoader

This commit is contained in:
Amir Mohamadi
2020-12-19 13:26:55 +03:30
parent bc5e617778
commit 9433eb84ac
57 changed files with 13099 additions and 494 deletions
+22 -2
View File
@@ -2,8 +2,11 @@
<div>
<SiteHeader/>
<nuxt/>
<SiteFooterHomePage v-if="this.$route.name === 'lang'"></SiteFooterHomePage>
<SiteFooterGlobal v-else></SiteFooterGlobal>
<SiteFooterHomePage v-if="this.$route.name === 'lang'"/>
<SiteFooterGlobal v-else/>
<off-canvas/>
<page-load/>
<pre-loader/>
</div>
</template>
@@ -11,6 +14,23 @@
<script>
export default {
mounted() {
////////////////////////////////////////// global router guards
this.$router.beforeEach((to, from, next) => {
this.$gsap.timeline({
onComplete: () => {
next()
}
})
.to($('.page-load'), {autoAlpha: 1, duration: 0.3})
.fromTo($('.page-load svg'), {opacity: 0, scale: 1, y: 10}, {opacity: 1, y: 0, duration: 0.15})
.fromTo($('.page-load p'), {opacity: 0, scale: 1, y: 10}, {opacity: 1, y: 0, duration: 0.15})
})
this.$router.afterEach((to, from) => {
this.$gsap.timeline({delay: 0.3})
.to($('.page-load p,.page-load svg'), {opacity: 0, scale: 0.5, duration: 0.15})
.to($('.page-load'), {autoAlpha: 0, duration: 0.5})
})
},
head() {
return {