add pwa app

This commit is contained in:
Amir Mohamadi
2021-01-31 20:47:26 +03:30
parent faa0d48d87
commit 534fe02b3a
23 changed files with 1541 additions and 929 deletions
-19
View File
@@ -13,25 +13,6 @@
<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 {
htmlAttrs: {
+39
View File
@@ -0,0 +1,39 @@
<template>
<div class="pwa" :class="darkMode ? 'dark-mode' : null">
<div class="connection-status" v-if="$nuxt.isOffline">
<p>{{ staticData.connection }}</p>
</div>
<pwa-about/>
<pwa-header @darkModeStatus="changeTheme"/>
<nuxt/>
<page-load/>
</div>
</template>
<script>
export default {
data() {
return {
darkMode: false
}
},
computed: {
staticData() {
return this.$store.state.staticData.pwa[this.$route.params.lang]
}
},
methods: {
changeTheme(val) {
this.darkMode = val
}
},
head() {
return {
htmlAttrs: {
lang: this.$route.params.lang
}
}
}
}
</script>