2018-11-08 01:09:33 +01:00
|
|
|
import Vue from 'vue'
|
2018-11-17 20:32:28 +01:00
|
|
|
import { Component } from 'vue-property-decorator'
|
2019-03-04 20:29:30 +01:00
|
|
|
import { GlobalStore, UserStore } from '@store'
|
2018-11-08 01:09:33 +01:00
|
|
|
|
2019-01-30 01:05:31 +01:00
|
|
|
import { Logo } from '../../components/logo'
|
2019-01-08 01:22:09 +01:00
|
|
|
|
2019-10-10 16:53:33 +02:00
|
|
|
import { Footer } from '../../components/Footer'
|
|
|
|
|
|
2019-03-13 13:40:17 +01:00
|
|
|
import VueScrollReveal from 'vue-scroll-reveal'
|
|
|
|
|
import { tools } from '@src/store/Modules/tools'
|
2019-10-10 16:53:33 +02:00
|
|
|
import { toolsext } from '@src/store/Modules/toolsext'
|
|
|
|
|
import { Screen } from 'quasar'
|
2019-03-09 02:56:02 +01:00
|
|
|
|
|
|
|
|
Vue.use(VueScrollReveal, {
|
|
|
|
|
class: 'v-scroll-reveal', // A CSS class applied to elements with the v-scroll-reveal directive; useful for animation overrides.
|
|
|
|
|
duration: 1200,
|
|
|
|
|
scale: 0.95,
|
|
|
|
|
distance: '10px',
|
|
|
|
|
rotate: {
|
|
|
|
|
x: 0,
|
|
|
|
|
y: 0,
|
|
|
|
|
z: 0
|
|
|
|
|
}
|
|
|
|
|
// mobile: true
|
2019-03-13 13:40:17 +01:00
|
|
|
})
|
2019-03-09 02:56:02 +01:00
|
|
|
|
2018-11-08 01:09:33 +01:00
|
|
|
@Component({
|
2019-10-10 16:53:33 +02:00
|
|
|
components: { Logo, Footer }
|
2018-11-08 01:09:33 +01:00
|
|
|
})
|
|
|
|
|
export default class Home extends Vue {
|
2019-03-13 13:40:17 +01:00
|
|
|
public text: string = ''
|
|
|
|
|
public visibile: boolean = false
|
|
|
|
|
public cardvisible: string = 'hidden'
|
|
|
|
|
public displaycard: string = 'block'
|
|
|
|
|
public $t: any
|
2019-03-14 01:24:59 +01:00
|
|
|
// public firstClassSection: string = 'landing_background fade homep-cover-img animate-fade homep-cover-img-1'
|
|
|
|
|
public firstClassSection: string = 'fade homep-cover-img animate-fade homep-cover-img-1'
|
2018-11-11 19:27:04 +01:00
|
|
|
public $q
|
2019-03-13 13:40:17 +01:00
|
|
|
public polling
|
2019-03-14 01:24:59 +01:00
|
|
|
public slide = 'first'
|
2019-03-16 23:47:13 +01:00
|
|
|
public animare: number = 0
|
2018-11-11 19:27:04 +01:00
|
|
|
|
2018-11-08 01:09:33 +01:00
|
|
|
constructor() {
|
|
|
|
|
super()
|
2019-01-31 13:52:52 +01:00
|
|
|
// console.log('Home constructor...')
|
2018-11-08 01:09:33 +01:00
|
|
|
this.initprompt()
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-10 21:06:42 +02:00
|
|
|
get mythis() {
|
|
|
|
|
return this
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-13 13:40:17 +01:00
|
|
|
public mounted() {
|
2019-03-08 02:04:56 +01:00
|
|
|
let primo = true
|
2019-03-13 13:40:17 +01:00
|
|
|
const mytime = 10000
|
2019-03-08 02:04:56 +01:00
|
|
|
this.polling = setInterval(() => {
|
|
|
|
|
|
2019-03-14 01:24:59 +01:00
|
|
|
this.firstClassSection = 'landing_background fade homep-cover-img ' + (primo ? 'homep-cover-img-2' : 'homep-cover-img-1')
|
2019-03-08 02:04:56 +01:00
|
|
|
primo = !primo
|
2019-02-05 18:17:36 +01:00
|
|
|
|
2019-03-09 02:56:02 +01:00
|
|
|
// console.log('this.firstClassSection', this.firstClassSection)
|
2019-03-08 02:04:56 +01:00
|
|
|
|
|
|
|
|
}, mytime)
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-15 02:01:03 +01:00
|
|
|
get appname() {
|
2019-10-18 01:47:36 +02:00
|
|
|
return this.$t('msg.myAppName')
|
2019-03-15 02:01:03 +01:00
|
|
|
}
|
|
|
|
|
|
2019-03-13 13:40:17 +01:00
|
|
|
public beforeDestroy() {
|
2019-03-08 02:04:56 +01:00
|
|
|
console.log('beforeDestroy')
|
|
|
|
|
clearInterval(this.polling)
|
|
|
|
|
}
|
2019-03-13 13:40:17 +01:00
|
|
|
public created() {
|
2019-03-16 23:47:13 +01:00
|
|
|
this.animare = process.env.DEV ? 0 : 8000
|
2019-02-22 10:23:00 +01:00
|
|
|
|
2019-02-05 18:17:36 +01:00
|
|
|
GlobalStore.actions.prova()
|
2018-12-26 21:02:16 +01:00
|
|
|
}
|
|
|
|
|
|
2019-05-03 20:31:47 +02:00
|
|
|
get tools() {
|
|
|
|
|
return tools
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-08 02:04:56 +01:00
|
|
|
get isLogged() {
|
2019-03-04 20:29:30 +01:00
|
|
|
return UserStore.state.isLogged
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-08 02:04:56 +01:00
|
|
|
get TelegramSupport() {
|
|
|
|
|
return process.env.TELEGRAM_SUPPORT
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-15 02:01:03 +01:00
|
|
|
get FBPage() {
|
|
|
|
|
return process.env.URL_FACEBOOK
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-13 13:40:17 +01:00
|
|
|
public meta() {
|
2019-02-22 10:23:00 +01:00
|
|
|
return {
|
|
|
|
|
keywords: { name: 'keywords', content: 'Quasar website' },
|
|
|
|
|
// meta tags
|
|
|
|
|
meta: {
|
|
|
|
|
mykey: { name: 'mykey', content: 'Key 1' },
|
|
|
|
|
description: { name: 'description', content: 'Page 1' },
|
|
|
|
|
keywords: { name: 'keywords', content: 'Quasar website' },
|
2019-03-13 13:40:17 +01:00
|
|
|
equiv: { 'http-equiv': 'Content-Type', 'content': 'text/html; charset=UTF-8' }
|
2019-02-22 10:23:00 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-13 13:40:17 +01:00
|
|
|
public mystilecard() {
|
2018-11-08 01:09:33 +01:00
|
|
|
return {
|
|
|
|
|
visibility: this.cardvisible,
|
|
|
|
|
display: this.displaycard
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get conta() {
|
2018-12-26 21:02:16 +01:00
|
|
|
return GlobalStore.state.conta
|
2018-11-08 01:09:33 +01:00
|
|
|
}
|
2019-02-05 18:17:36 +01:00
|
|
|
|
2019-03-13 13:40:17 +01:00
|
|
|
public getenv(myvar) {
|
2019-03-08 02:04:56 +01:00
|
|
|
return process.env[myvar]
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-08 01:09:33 +01:00
|
|
|
set conta(valore) {
|
2018-11-17 20:32:28 +01:00
|
|
|
GlobalStore.actions.setConta(valore)
|
2019-03-13 13:40:17 +01:00
|
|
|
const my = this.$q.lang.isoName
|
|
|
|
|
tools.showNotif(this.$q, String(my))
|
2018-11-08 01:09:33 +01:00
|
|
|
}
|
|
|
|
|
|
2019-03-13 13:40:17 +01:00
|
|
|
public initprompt() {
|
2019-05-03 20:31:47 +02:00
|
|
|
window.addEventListener('beforeinstallprompt', (event) => {
|
2019-02-13 18:48:30 +01:00
|
|
|
// console.log('******************************** beforeinstallprompt fired')
|
2018-11-08 01:09:33 +01:00
|
|
|
event.preventDefault()
|
2019-02-14 18:38:23 +01:00
|
|
|
// console.log('§§§§§§§§§§§§§§§§§§§§ IMPOSTA DEFERRED PROMPT !!!!!!!!!!!!!!!!! ')
|
|
|
|
|
// #Todo++ IMPOSTA DEFERRED PROMPT
|
2018-11-08 01:09:33 +01:00
|
|
|
return false
|
|
|
|
|
})
|
2019-02-01 04:10:31 +01:00
|
|
|
|
2018-11-08 01:09:33 +01:00
|
|
|
}
|
|
|
|
|
|
2019-03-13 13:40:17 +01:00
|
|
|
get isInCostruction() {
|
2019-03-04 20:29:30 +01:00
|
|
|
return process.env.IN_CONSTRUCTION === '1'
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-13 13:40:17 +01:00
|
|
|
public getPermission() {
|
2019-02-04 16:47:15 +01:00
|
|
|
return Notification.permission
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-13 13:40:17 +01:00
|
|
|
public NotServiceWorker() {
|
2019-02-14 18:38:23 +01:00
|
|
|
return (!('serviceWorker' in navigator))
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-13 13:40:17 +01:00
|
|
|
public PagLogin() {
|
2019-03-04 20:29:30 +01:00
|
|
|
this.$router.replace('/signin')
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-13 13:40:17 +01:00
|
|
|
public PagReg() {
|
2019-03-04 20:29:30 +01:00
|
|
|
this.$router.replace('/signup')
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-03 20:31:47 +02:00
|
|
|
// public test_fetch() {
|
|
|
|
|
// fetch('https:/httpbin.org/post', {
|
|
|
|
|
// method: 'POST',
|
|
|
|
|
// headers: {
|
|
|
|
|
// 'Content-Type': 'application/json',
|
|
|
|
|
// 'Accept': 'application/json'
|
|
|
|
|
// },
|
|
|
|
|
// // mode: 'no-cors',
|
|
|
|
|
// mode: 'cors',
|
|
|
|
|
// body: JSON.stringify({ message: 'Does this work?' })
|
|
|
|
|
// }).then(function(response) {
|
|
|
|
|
// console.log(response)
|
|
|
|
|
// if (response) {
|
|
|
|
|
// return response.json()
|
|
|
|
|
// }
|
|
|
|
|
// else {
|
|
|
|
|
// return null
|
|
|
|
|
// }
|
|
|
|
|
// }).then(function(data) {
|
|
|
|
|
// console.log(data)
|
|
|
|
|
// }).catch(function(err) {
|
|
|
|
|
// console.log(err)
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
//
|
2018-11-08 01:09:33 +01:00
|
|
|
|
2019-03-13 13:40:17 +01:00
|
|
|
public openCreatePostModal() {
|
2018-11-08 01:09:33 +01:00
|
|
|
console.log('APERTO ! openCreatePostModal')
|
|
|
|
|
|
|
|
|
|
this.conta = this.conta + 1
|
|
|
|
|
|
|
|
|
|
this.visibile = !this.visibile
|
|
|
|
|
|
|
|
|
|
if (this.visibile) {
|
|
|
|
|
this.displaycard = 'block'
|
|
|
|
|
this.cardvisible = 'visible'
|
|
|
|
|
} else {
|
|
|
|
|
this.displaycard = 'block'
|
|
|
|
|
this.cardvisible = 'hidden'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
2019-03-08 02:04:56 +01:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
backgroundSequence() {
|
|
|
|
|
window.clearTimeout()
|
|
|
|
|
let k = 0
|
|
|
|
|
for (let i = 0; i < bgImageArray.length; i++) {
|
|
|
|
|
const mythis = this
|
|
|
|
|
setTimeout(function() {
|
|
|
|
|
document.documentElement.style.background = 'url(' + mythis.base + mythis.bgImageArray[k] + ') no-repeat center center fixed'
|
|
|
|
|
document.documentElement.style.backgroundSize = 'cover'
|
|
|
|
|
if ((k + 1) === mythis.bgImageArray.length) { setTimeout(function() { mythis.backgroundSequence() }, (mythis.secs * 1000))} else { k++ }
|
|
|
|
|
}, (mythis.secs * 1000) * i)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
backgroundSequence()
|
|
|
|
|
*/
|
2018-11-08 01:09:33 +01:00
|
|
|
}
|