diff --git a/.env.development b/.env.development index 13c95d3..fea6886 100644 --- a/.env.development +++ b/.env.development @@ -6,7 +6,7 @@ LANG_DEFAULT='it' MONGODB_HOST='http://localhost:3000' PAO_APP_ID='KKPPAA5KJK435J3KSS9F9D8S9F8SD98F9SDF' MASTER_KEY='KKPPSS5KJK435J3KSS9F9D8S9F8SD3CR3T' -LOGO_REG='quasar-logo-full.svg' +LOGO_REG='freeplanet-logo-full.svg' TEST_EMAIL='paolo.arena77@gmail.com' TEST_USERNAME='paoloar77' TEST_PASSWORD='mypassword@1A' diff --git a/package-lock.json b/package-lock.json index 74763de..ed904c0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10611,6 +10611,11 @@ "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=", "dev": true }, + "gsap": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/gsap/-/gsap-2.0.2.tgz", + "integrity": "sha512-WyT0uuDNb+5xMccx4SsVcI1CwvIL0BPgP8TyJJmMWT/btGXUNtKesnkXFMMshYs37renFhDo1P5NEoizeonviQ==" + }, "gzip-size": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-5.0.0.tgz", diff --git a/package.json b/package.json index d0192e6..f3e58d9 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "google-translate-api": "^2.3.0", "graphql": "^0.13.2", "graphql-tag": "^2.8.0", + "gsap": "^2.0.2", "js-cookie": "^2.2.0", "localforage": "^1.7.3", "normalize.css": "^8.0.0", diff --git a/src/components/categories/index.ts b/src/components/categories/index.ts index a391328..fb62135 100644 --- a/src/components/categories/index.ts +++ b/src/components/categories/index.ts @@ -1,2 +1,3 @@ export * from './SingleCat' export * from './category' +export * from './tabledata' diff --git a/src/components/categories/tabledata/index.ts b/src/components/categories/tabledata/index.ts new file mode 100644 index 0000000..5825f39 --- /dev/null +++ b/src/components/categories/tabledata/index.ts @@ -0,0 +1 @@ +export {default as TableData} from './tabledata.vue' diff --git a/src/components/categories/tabledata/tabledata.scss b/src/components/categories/tabledata/tabledata.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/components/categories/tabledata/tabledata.ts b/src/components/categories/tabledata/tabledata.ts new file mode 100644 index 0000000..82fa0e2 --- /dev/null +++ b/src/components/categories/tabledata/tabledata.ts @@ -0,0 +1,198 @@ +import Vue from 'vue' +import { Component, Watch } from 'vue-property-decorator' + +import { ICategory } from '@src/model' + +require('./tabledata.scss') + + +@Component({ +}) +export default class Tabledata extends Vue { + $q: any + + filter: boolean = false + title: string = '' + category: string = '' + categories_loc: any[] = [{}] + categories_arr: any[] = [{}] + selected: any [] = [] + selectedSecond: any [] = [] + + data: any [] = [{ + id: 0, + descr_it: 'Frozen Yogurt', + descr_en: '', + descr_es: '' + }, + { + id: 1, + descr_it: 'Secondo', + descr_en: '', + descr_es: '' + }] + + columns: any [] = [ + { + name: 'descr_it', + required: true, + label: 'IT', + align: 'left', + field: 'descr_it', + sortable: true, + classes: 'my-class', + }, + { + name: 'descr_en', + label: 'EN', + align: 'left', + field: 'descr_en', + sortable: true, + classes: 'my-class', + }, + { + name: 'descr_es', + label: 'ES', + align: 'left', + field: 'descr_es', + sortable: true, + classes: 'my-class', + } + ] + + @Watch('categories_loc') valueChanged() { + this.updatetable() + } + + + created() { + this.loadCat() + } + + async loadCat() { + await this.$db.categories.toArray().then(ris => this.categories_loc = ris) + + this.updatetable() + } + + initcat() { + + const objcat: ICategory = { + descr_it: '', + descr_en: '', + descr_es: '' + } + return objcat + + } + + async insertCategory() { + + const objcat = this.initcat() + + let myid = 0 + objcat.descr_it = this.category + + // Add to Indexdb + await this.$db.categories.add(objcat + ).then(ris => { + myid = ris + }) + + objcat.id = myid + + // Add into the memory + this.categories_loc.push(objcat) + + // empty the field + this.category = '' + } + + async deleteCategory(myarrobj) { + + await myarrobj.forEach(myobj => { + + if (myobj.id !== undefined) { + console.log('KEY = ', myobj.id) + + // Delete item + let deleteCount = this.$db.categories + .where('id').equals(myobj.id) + .delete() + + console.log('deleteCount = ', deleteCount) + if (deleteCount > 0) { + // Remove into the memory + this.categories_loc.slice(this.categories_loc.indexOf(myobj), 1) + + this.updatetable() + + return deleteCount + } + } + }) + + } + + updatetable() { + + this.filterCategories() + this.categories_arr = [...this.categories_loc] + + } + + async filterCategories() { + + if (this.filter) { + // #Todo If need to filter the output database ... + this.$db.categories + .where('descr_it').notEqual('nonlovedi') + .toArray() + .then((response) => { + Promise.all(response.map(key => key)) + .then((myarr) => { + this.categories_loc = [...myarr] + return this.categories_loc + }) + }) + } else { + return this.categories_loc + } + } + + deleteRow() { + console.log('SEL = ', this.selectedSecond) + + const seldel = [...this.selectedSecond] + if (this.deleteCategory(this.selectedSecond)) { + this.$q.notify({ + color: 'primary', + icon: 'delete', + message: `Deleted ` + (seldel.length.toString()) + ' item' + }) + + + } + + } + + /* + await db.transaction('rw', [db.friends], async () => { + const friend = await db.friends.get(1); + ++friend.age; + await db.friends.put(friend); + }); + */ + + async modify() { + // esempio da sistemare + await this.$db.transaction('rw', [this.$db.categories], async () => { + const friend = await this.$db.get(1) + ++friend.age + await this.$db.put(friend) + }) + + } + + +} diff --git a/src/components/categories/tabledata/tabledata.vue b/src/components/categories/tabledata/tabledata.vue new file mode 100644 index 0000000..6275a06 --- /dev/null +++ b/src/components/categories/tabledata/tabledata.vue @@ -0,0 +1,61 @@ + + diff --git a/src/components/index.ts b/src/components/index.ts index f81a1f4..9c2aff8 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -1,2 +1,3 @@ export * from './categories' +export * from './logo' diff --git a/src/components/logo/index.ts b/src/components/logo/index.ts new file mode 100644 index 0000000..3691656 --- /dev/null +++ b/src/components/logo/index.ts @@ -0,0 +1 @@ +export {default as Logo} from './logo.vue' diff --git a/src/components/logo/logo.scss b/src/components/logo/logo.scss new file mode 100644 index 0000000..0512e96 --- /dev/null +++ b/src/components/logo/logo.scss @@ -0,0 +1,48 @@ +.svgclass{ + color: white; + transform: translateY(0px); + +} + +.svgclass_animate { + transform: translateY(-70px); + color: red; +} + +#sun { + animation: around 5s infinite; + +} + +@keyframes gravity{ + 0%{ + transform: rotateY(0deg); + } + 100%{ + transform: rotateY(360deg); + } +} + + +@keyframes around { + 0% { + cx: 20; + cy: 22; + } + 20% { + cx: 25; + cy: 24; + } + 50% { + cx: 40; + cy: 26; + } + 80% { + cx: 55; + cy: 24; + } + 100% { + cx: 60; + cy: 22; + } +} diff --git a/src/components/logo/logo.ts b/src/components/logo/logo.ts new file mode 100644 index 0000000..2afa32d --- /dev/null +++ b/src/components/logo/logo.ts @@ -0,0 +1,32 @@ +import Vue from 'vue' +import { Component } from 'vue-property-decorator' + +require('./logo.scss') + +import { TimelineLite, Back } from 'gsap' + +@Component({ + +}) +export default class Logo extends Vue { + svgclass: string = 'svgclass' + created() { + this.animate() + } + + animate () { + const timeline = new TimelineLite() + + timeline.to('#sun', 5, { + cy: 20, + cx: 60, + ease: Back.easeInOut // Specify an ease + }) + + } + + public logoimg() { + return process.env.LOGO_REG + } + +} diff --git a/src/components/logo/logo.vue b/src/components/logo/logo.vue new file mode 100644 index 0000000..fe3f485 --- /dev/null +++ b/src/components/logo/logo.vue @@ -0,0 +1,7 @@ + + diff --git a/src/layouts/drawer/menuOne.vue b/src/layouts/drawer/menuOne.vue index 5c56e30..90a266d 100644 --- a/src/layouts/drawer/menuOne.vue +++ b/src/layouts/drawer/menuOne.vue @@ -3,13 +3,15 @@
@@ -61,6 +62,11 @@