Files
cnm/src/root/home/home.ts

205 lines
4.6 KiB
TypeScript
Raw Normal View History

2019-12-28 11:16:53 +01:00
import Vue from 'vue'
import { Component } from 'vue-property-decorator'
2020-07-11 17:07:53 +02:00
import { GlobalStore, UserStore } from '@store'
2019-12-28 11:16:53 +01:00
import { Logo } from '../../components/logo'
import { Footer } from '../../components/Footer'
import VueScrollReveal from 'vue-scroll-reveal'
import { tools } from '@src/store/Modules/tools'
2020-07-11 17:07:53 +02:00
import { toolsext } from '@src/store/Modules/toolsext'
2019-12-28 11:16:53 +01:00
import { Screen } from 'quasar'
2020-07-11 17:07:53 +02: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-12-28 11:16:53 +01:00
@Component({
2020-07-11 17:07:53 +02:00
components: { Logo, Footer }
2019-12-28 11:16:53 +01:00
})
2020-07-11 17:07:53 +02:00
export default class Home extends Vue {
2019-12-28 11:16:53 +01:00
public text: string = ''
public visibile: boolean = false
public cardvisible: string = 'hidden'
public displaycard: string = 'block'
public $t: any
// 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'
public $q
public polling
public slide = 'first'
2020-07-11 17:07:53 +02:00
public slide2 = 1
2019-12-28 11:16:53 +01:00
public animare: number = 0
2020-07-11 17:07:53 +02:00
public getImmagini = [
2019-12-28 11:16:53 +01:00
{
2020-07-11 17:07:53 +02:00
title: '', subtitle: '',
img: '../../statics/images/eventi_esterni/IMG_6035.jpg'
2019-12-28 11:16:53 +01:00
},
{
2020-07-11 17:07:53 +02:00
title: '', subtitle: '',
img: '../../statics/images/eventi_esterni/IMG_6037.jpg'
2019-12-28 11:16:53 +01:00
},
{
2020-07-11 17:07:53 +02:00
title: '', subtitle: '',
img: '../../statics/images/eventi_esterni/IMG_6401.jpg'
2019-12-28 11:16:53 +01:00
},
{
2020-07-11 17:07:53 +02:00
title: '', subtitle: '',
img: '../../statics/images/eventi_esterni/IMG_7203.jpg'
2019-12-28 11:16:53 +01:00
},
{
2020-07-11 17:07:53 +02:00
title: '', subtitle: '',
img: '../../statics/images/eventi_esterni/IMG_7209.jpg'
2019-12-28 11:16:53 +01:00
}
]
constructor() {
super()
// console.log('Home constructor...')
this.initprompt()
}
2020-07-11 17:07:53 +02:00
get getappname(){
return this.$t('msg.myAppName')
2019-12-28 11:16:53 +01:00
}
2020-07-11 17:07:53 +02:00
get heightgallery () {
if (Screen.width < 400) {
return '200px'
}else if (Screen.width < 600) {
return '300px'
} else {
return '600px'
}
2019-12-28 11:16:53 +01:00
}
get tools() {
return tools
}
public mounted() {
let primo = true
const mytime = 10000
this.polling = setInterval(() => {
this.firstClassSection = 'landing_background fade homep-cover-img ' + (primo ? 'homep-cover-img-2' : 'homep-cover-img-1')
primo = !primo
// console.log('this.firstClassSection', this.firstClassSection)
}, mytime)
2020-07-11 17:07:53 +02:00
}
2020-07-11 17:07:53 +02:00
get appname() {
return process.env.APP_NAME
2019-12-28 11:16:53 +01:00
}
public beforeDestroy() {
2020-07-11 17:07:53 +02:00
console.log('beforeDestroy')
2019-12-28 11:16:53 +01:00
clearInterval(this.polling)
}
public created() {
this.animare = process.env.DEV ? 0 : 8000
GlobalStore.actions.prova()
2020-01-13 23:52:14 +01:00
}
2019-12-28 11:16:53 +01:00
get isLogged() {
return UserStore.state.isLogged
}
2020-07-11 17:07:53 +02:00
public meta() {
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' },
equiv: { 'http-equiv': 'Content-Type', 'content': 'text/html; charset=UTF-8' }
}
}
}
2019-12-28 11:16:53 +01:00
public mystilecard() {
return {
visibility: this.cardvisible,
display: this.displaycard
}
}
get conta() {
return GlobalStore.state.conta
}
public getenv(myvar) {
return process.env[myvar]
}
set conta(valore) {
GlobalStore.actions.setConta(valore)
const my = this.$q.lang.isoName
tools.showNotif(this.$q, String(my))
}
public initprompt() {
2020-07-11 17:07:53 +02:00
window.addEventListener('beforeinstallprompt', function (event) {
2019-12-28 11:16:53 +01:00
// console.log('******************************** beforeinstallprompt fired')
event.preventDefault()
// console.log('§§§§§§§§§§§§§§§§§§§§ IMPOSTA DEFERRED PROMPT !!!!!!!!!!!!!!!!! ')
// #Todo++ IMPOSTA DEFERRED PROMPT
return false
})
}
get isInCostruction() {
return process.env.IN_CONSTRUCTION === '1'
}
public getPermission() {
return Notification.permission
}
public NotServiceWorker() {
return (!('serviceWorker' in navigator))
}
public PagLogin() {
this.$router.replace('/signin')
}
public PagReg() {
this.$router.replace('/signup')
}
public openCreatePostModal() {
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'
}
}
}