summaryrefslogtreecommitdiff
path: root/src/web/app/common
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-03-08 22:11:08 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-03-08 22:11:08 +0900
commit2c5d1c62395d9d5a7162aaf9a823a140ca00c885 (patch)
tree7cd7bce027e79ee16b875aac2fa03772995d9d81 /src/web/app/common
parentv4018 (diff)
downloadmisskey-2c5d1c62395d9d5a7162aaf9a823a140ca00c885.tar.gz
misskey-2c5d1c62395d9d5a7162aaf9a823a140ca00c885.tar.bz2
misskey-2c5d1c62395d9d5a7162aaf9a823a140ca00c885.zip
:v:
Diffstat (limited to 'src/web/app/common')
-rw-r--r--src/web/app/common/views/components/othello.game.vue11
-rw-r--r--src/web/app/common/views/components/othello.room.vue47
2 files changed, 38 insertions, 20 deletions
diff --git a/src/web/app/common/views/components/othello.game.vue b/src/web/app/common/views/components/othello.game.vue
index f0254a0b71..b50d709d4a 100644
--- a/src/web/app/common/views/components/othello.game.vue
+++ b/src/web/app/common/views/components/othello.game.vue
@@ -12,7 +12,7 @@
<div class="board" :style="{ 'grid-template-rows': `repeat(${ game.settings.map.size }, 1fr)`, 'grid-template-columns': `repeat(${ game.settings.map.size }, 1fr)` }">
<div v-for="(stone, i) in o.board"
- :class="{ empty: stone == null, none: o.map.data[i] == ' ', myTurn: !game.is_ended && isMyTurn, can: turnUser ? o.canPut(turnUser.id == blackUser.id ? 'black' : 'white', i) : null, prev: o.prevPos == i }"
+ :class="{ empty: stone == null, none: o.map.data[i] == ' ', isEnded: game.is_ended, myTurn: !game.is_ended && isMyTurn, can: turnUser ? o.canPut(turnUser.id == blackUser.id ? 'black' : 'white', i) : null, prev: o.prevPos == i }"
@click="set(i)"
>
<img v-if="stone == 'black'" :src="`${blackUser.avatar_url}?thumbnail&size=128`" alt="">
@@ -200,13 +200,13 @@ export default Vue.extend({
user-select none
&.empty
- border solid 2px #f5f5f5
+ border solid 2px #eee
&.empty.can
- background #f5f5f5
+ background #eee
&.empty.myTurn
- border-color #eee
+ border-color #ddd
&.can
background #eee
@@ -222,6 +222,9 @@ export default Vue.extend({
&.prev
box-shadow 0 0 0 4px rgba($theme-color, 0.7)
+ &.isEnded
+ border-color #ddd
+
&.none
border-color transparent !important
diff --git a/src/web/app/common/views/components/othello.room.vue b/src/web/app/common/views/components/othello.room.vue
index 445a0b45d6..bcae37b227 100644
--- a/src/web/app/common/views/components/othello.room.vue
+++ b/src/web/app/common/views/components/othello.room.vue
@@ -5,7 +5,9 @@
<p>ゲームの設定</p>
<el-select v-model="mapName" placeholder="マップを選択" @change="onMapChange">
- <el-option v-for="m in maps" :key="m.name" :label="m.name" :value="m.name"/>
+ <el-option-group v-for="c in mapCategories" :key="c" :label="c">
+ <el-option v-for="m in maps" v-if="m.category == c" :key="m.name" :label="m.name" :value="m.name"/>
+ </el-option-group>
</el-select>
<div class="board" :style="{ 'grid-template-rows': `repeat(${ game.settings.map.size }, 1fr)`, 'grid-template-columns': `repeat(${ game.settings.map.size }, 1fr)` }">
@@ -21,18 +23,20 @@
<mk-switch v-model="game.settings.is_llotheo" @change="onIsLlotheoChange" text="石の少ない方が勝ち(ロセオ)"/>
</div>
- <p class="status">
- <template v-if="isAccepted && isOpAccepted">ゲームは数秒後に開始されます<mk-ellipsis/></template>
- <template v-if="isAccepted && !isOpAccepted">相手の準備が完了するのを待っています<mk-ellipsis/></template>
- <template v-if="!isAccepted && isOpAccepted">あなたの準備が完了するのを待っています</template>
- <template v-if="!isAccepted && !isOpAccepted">準備中<mk-ellipsis/></template>
- </p>
+ <footer>
+ <p class="status">
+ <template v-if="isAccepted && isOpAccepted">ゲームは数秒後に開始されます<mk-ellipsis/></template>
+ <template v-if="isAccepted && !isOpAccepted">相手の準備が完了するのを待っています<mk-ellipsis/></template>
+ <template v-if="!isAccepted && isOpAccepted">あなたの準備が完了するのを待っています</template>
+ <template v-if="!isAccepted && !isOpAccepted">準備中<mk-ellipsis/></template>
+ </p>
- <div class="actions">
- <el-button @click="exit">キャンセル</el-button>
- <el-button type="primary" @click="accept" v-if="!isAccepted">準備完了</el-button>
- <el-button type="primary" @click="cancel" v-if="isAccepted">準備続行</el-button>
- </div>
+ <div class="actions">
+ <el-button @click="exit">キャンセル</el-button>
+ <el-button type="primary" @click="accept" v-if="!isAccepted">準備完了</el-button>
+ <el-button type="primary" @click="cancel" v-if="isAccepted">準備続行</el-button>
+ </div>
+ </footer>
</div>
</template>
@@ -53,6 +57,10 @@ export default Vue.extend({
},
computed: {
+ mapCategories(): string[] {
+ const categories = Object.entries(maps).map(x => x[1].category);
+ return categories.filter((item, pos) => categories.indexOf(item) == pos);
+ },
isAccepted(): boolean {
if (this.game.user1_id == (this as any).os.i.id && this.game.user1_accepted) return true;
if (this.game.user2_id == (this as any).os.i.id && this.game.user2_accepted) return true;
@@ -142,7 +150,7 @@ export default Vue.extend({
> div
background transparent
- border solid 2px #eee
+ border solid 2px #ddd
border-radius 6px
overflow hidden
@@ -157,8 +165,15 @@ export default Vue.extend({
> .rules
max-width 300px
- margin 0 auto
+ margin 0 auto 32px auto
+
+ > footer
+ position sticky
+ bottom 0
+ padding 16px
+ background rgba(255, 255, 255, 0.9)
+ border-top solid 1px #c4cdd4
- > .actions
- margin-bottom 16px
+ > .status
+ margin 0 0 16px 0
</style>