From 94cbbf8895fe6d3857d916347f1646bb86efc51f Mon Sep 17 00:00:00 2001 From: Lukas Bachschwell Date: Thu, 9 Apr 2020 13:30:46 +0200 Subject: [PATCH] Changes for pitch2 --- package.json | 4 +- src/components/Kanban/index.vue | 332 ++++++++++++++++++++++++------- src/layout/clean.vue | 5 + src/layout/components/Navbar.vue | 25 +++ src/router/index.js | 15 ++ src/views/dashboard/index.vue | 6 + src/views/draggame/index.vue | 187 +++++++++++++++++ 7 files changed, 498 insertions(+), 76 deletions(-) create mode 100644 src/layout/clean.vue create mode 100644 src/views/draggame/index.vue diff --git a/package.json b/package.json index be6ec0d..9723271 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "axios": "0.18.1", "clipboard": "2.0.4", "codemirror": "5.45.0", + "dragula": "^3.7.2", "driver.js": "0.9.5", "dropzone": "5.5.1", "echarts": "4.2.1", @@ -61,7 +62,8 @@ "vue-splitpane": "1.0.4", "vuedraggable": "2.20.0", "vuex": "3.1.0", - "xlsx": "0.14.1" + "xlsx": "0.14.1", + "xstate": "^4.8.0" }, "devDependencies": { "@babel/core": "7.0.0", diff --git a/src/components/Kanban/index.vue b/src/components/Kanban/index.vue index 82f7dd7..491dab0 100644 --- a/src/components/Kanban/index.vue +++ b/src/components/Kanban/index.vue @@ -1,99 +1,281 @@ - +/* Dragula CSS */ + +.gu-mirror { + position: fixed !important; + margin: 0 !important; + z-index: 9999 !important; + opacity: 0.8; + list-style-type: none; +} + +.gu-hide { + display: none !important; +} + +.gu-unselectable { + -webkit-user-select: none !important; + -moz-user-select: none !important; + -ms-user-select: none !important; + user-select: none !important; +} + +.gu-transit { + opacity: 0.2; +} + diff --git a/src/layout/clean.vue b/src/layout/clean.vue new file mode 100644 index 0000000..aeb92ae --- /dev/null +++ b/src/layout/clean.vue @@ -0,0 +1,5 @@ + diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index 942906b..2cba34f 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -87,6 +87,18 @@ export default { }).catch((err) => { console.log('ThaErr', err) }) + + request({ + url: 'https://joinbot.tk/kvs/gameopen', + method: 'get', + headers: { 'x-api-key': 'PMl`&xWpZ1vE)M]G;{8qIXx4k!ce|n' } + }).then((result) => { + if (result === 1) { + this.openGame() + } + }).catch((err) => { + console.log('ThaErr', err) + }) }, 1000) }, beforeDestroy() { @@ -100,6 +112,19 @@ export default { async logout() { await this.$store.dispatch('user/logout') this.$router.push(`/login?redirect=${this.$route.fullPath}`) + }, + openGame() { + window.open('/#/draggame/index', '', '"width=800,height=800"') + request({ + url: 'https://joinbot.tk/kvs/gameopen', + method: 'post', + headers: { 'x-api-key': 'PMl`&xWpZ1vE)M]G;{8qIXx4k!ce|n' }, + data: '0' + }).then((result) => { + + }).catch((err) => { + console.log('ThaErr', err) + }) } } } diff --git a/src/router/index.js b/src/router/index.js index 32c77f5..99bab46 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -6,6 +6,7 @@ Vue.use(Router) /* Layout */ import Layout from '@/layout' +import Clean from '@/layout/clean' /* Router Modules */ import componentsRouter from './modules/components' @@ -111,6 +112,20 @@ export const constantRoutes = [ meta: { title: 'Profil', icon: 'user', noCache: true } } ] + }, + { + path: '/draggame', + component: Clean, + redirect: '/draggame/index', + hidden: true, + children: [ + { + path: 'index', + component: () => import('@/views/draggame/index'), + name: 'Draggame', + meta: { title: 'Draggame', icon: 'user', noCache: true } + } + ] } ] diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index 1720ea8..c8b3939 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -1,5 +1,6 @@ @@ -26,6 +27,11 @@ export default { if (!this.roles.includes('admin')) { this.currentRole = 'editorDashboard' } + }, + methods: { + open() { + window.open('/#/draggame/index', '', '"width=800,height=800"') + } } } diff --git a/src/views/draggame/index.vue b/src/views/draggame/index.vue new file mode 100644 index 0000000..be1ca90 --- /dev/null +++ b/src/views/draggame/index.vue @@ -0,0 +1,187 @@ + + + + +