From f5fec3d008f6414d43606205457e5477b4abb6cd Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 10 Mar 2018 01:48:16 +0900 Subject: [PATCH] :v: --- .../app/common/views/components/othello.vue | 12 +++++ src/web/app/desktop/script.ts | 3 ++ .../desktop/views/components/game-window.vue | 19 +++++-- src/web/app/desktop/views/pages/othello.vue | 50 +++++++++++++++++++ src/web/app/mobile/script.ts | 3 +- .../app/mobile/views/components/ui.nav.vue | 2 +- src/web/app/mobile/views/pages/othello.vue | 36 ++++++++++++- 7 files changed, 119 insertions(+), 6 deletions(-) create mode 100644 src/web/app/desktop/views/pages/othello.vue diff --git a/src/web/app/common/views/components/othello.vue b/src/web/app/common/views/components/othello.vue index d4157eb76..70bb6b2ef 100644 --- a/src/web/app/common/views/components/othello.vue +++ b/src/web/app/common/views/components/othello.vue @@ -67,6 +67,7 @@ export default Vue.extend({ components: { XGameroom }, + props: ['initGame'], data() { return { game: null, @@ -80,6 +81,16 @@ export default Vue.extend({ connectionId: null }; }, + watch: { + game(g) { + this.$emit('gamed', g); + } + }, + created() { + if (this.initGame) { + this.game = this.initGame; + } + }, mounted() { this.connection = (this as any).os.streams.othelloStream.getConnection(); this.connectionId = (this as any).os.streams.othelloStream.use(); @@ -162,6 +173,7 @@ export default Vue.extend({ .mk-othello color #677f84 + background #fff > .matching > h1 diff --git a/src/web/app/desktop/script.ts b/src/web/app/desktop/script.ts index 78549741b..25a60d7ec 100644 --- a/src/web/app/desktop/script.ts +++ b/src/web/app/desktop/script.ts @@ -28,6 +28,7 @@ import MkHomeCustomize from './views/pages/home-customize.vue'; import MkMessagingRoom from './views/pages/messaging-room.vue'; import MkPost from './views/pages/post.vue'; import MkSearch from './views/pages/search.vue'; +import MkOthello from './views/pages/othello.vue'; /** * init @@ -80,6 +81,8 @@ init(async (launch) => { { path: '/i/drive/folder/:folder', component: MkDrive }, { path: '/selectdrive', component: MkSelectDrive }, { path: '/search', component: MkSearch }, + { path: '/othello', component: MkOthello }, + { path: '/othello/:game', component: MkOthello }, { path: '/:user', component: MkUser }, { path: '/:user/:post', component: MkPost } ]); diff --git a/src/web/app/desktop/views/components/game-window.vue b/src/web/app/desktop/views/components/game-window.vue index bf339092a..3c8bf40e1 100644 --- a/src/web/app/desktop/views/components/game-window.vue +++ b/src/web/app/desktop/views/components/game-window.vue @@ -1,14 +1,27 @@ diff --git a/src/web/app/desktop/views/pages/othello.vue b/src/web/app/desktop/views/pages/othello.vue new file mode 100644 index 000000000..160dd9a35 --- /dev/null +++ b/src/web/app/desktop/views/pages/othello.vue @@ -0,0 +1,50 @@ + + + diff --git a/src/web/app/mobile/script.ts b/src/web/app/mobile/script.ts index 27c18c5ae..2b57b78ad 100644 --- a/src/web/app/mobile/script.ts +++ b/src/web/app/mobile/script.ts @@ -69,7 +69,8 @@ init((launch) => { { path: '/i/drive/file/:file', component: MkDrive }, { path: '/selectdrive', component: MkSelectDrive }, { path: '/search', component: MkSearch }, - { path: '/game/othello', component: MkOthello }, + { path: '/othello', component: MkOthello }, + { path: '/othello/:game', component: MkOthello }, { path: '/:user', component: MkUser }, { path: '/:user/followers', component: MkFollowers }, { path: '/:user/following', component: MkFollowing }, diff --git a/src/web/app/mobile/views/components/ui.nav.vue b/src/web/app/mobile/views/components/ui.nav.vue index a58225a17..ba35a2783 100644 --- a/src/web/app/mobile/views/components/ui.nav.vue +++ b/src/web/app/mobile/views/components/ui.nav.vue @@ -18,7 +18,7 @@
  • %fa:home%%i18n:mobile.tags.mk-ui-nav.home%%fa:angle-right%
  • %fa:R bell%%i18n:mobile.tags.mk-ui-nav.notifications%%fa:angle-right%
  • %fa:R comments%%i18n:mobile.tags.mk-ui-nav.messaging%%fa:angle-right%
  • -
  • %fa:gamepad%ゲーム%fa:angle-right%
  • +
  • %fa:gamepad%ゲーム%fa:angle-right%