diff --git a/package.json b/package.json index a988e5731d8eab3d8e79a84b7d98f76c0b10a2c1..e4bcae1a2cdd6e89de62fa08f1be46fb3a03c981 100644 --- a/package.json +++ b/package.json @@ -182,6 +182,7 @@ "uglifyjs-webpack-plugin": "1.2.0", "url-loader": "^0.6.2", "uuid": "3.2.1", + "v-animate-css": "0.0.2", "vhost": "3.0.2", "vue": "2.5.13", "vue-cropperjs": "2.2.0", diff --git a/src/web/app/common/views/components/othello.game.vue b/src/web/app/common/views/components/othello.game.vue index 31030f614fc13eae258e82fc37427dbae2eec54e..26612daeac7c8e899d1e01f08752db993fa473bb 100644 --- a/src/web/app/common/views/components/othello.game.vue +++ b/src/web/app/common/views/components/othello.game.vue @@ -2,13 +2,16 @@ <div class="root"> <header><b>{{ blackUser.name }}</b>(é»’) vs <b>{{ whiteUser.name }}</b>(白)</header> - <p class="turn" v-if="!iAmPlayer && !game.is_ended">{{ turnUser.name }}ã®ã‚¿ãƒ¼ãƒ³ã§ã™<mk-ellipsis/></p> - <p class="turn" v-if="logPos != logs.length">{{ turnUser.name }}ã®ã‚¿ãƒ¼ãƒ³</p> - <p class="turn" v-if="iAmPlayer && !game.is_ended">{{ isMyTurn ? 'ã‚ãªãŸã®ã‚¿ãƒ¼ãƒ³ã§ã™' : '相手ã®ã‚¿ãƒ¼ãƒ³ã§ã™' }}<mk-ellipsis v-if="!isMyTurn"/></p> - <p class="result" v-if="game.is_ended && logPos == logs.length"> - <template v-if="game.winner"><b>{{ game.winner.name }}</b>ã®å‹ã¡{{ game.settings.is_llotheo ? ' (ãƒã‚»ã‚ª)' : '' }}</template> - <template v-else>引ã分ã‘</template> - </p> + <div style="overflow: hidden"> + <p class="turn" v-if="!iAmPlayer && !game.is_ended">{{ turnUser.name }}ã®ã‚¿ãƒ¼ãƒ³ã§ã™<mk-ellipsis/></p> + <p class="turn" v-if="logPos != logs.length">{{ turnUser.name }}ã®ã‚¿ãƒ¼ãƒ³</p> + <p class="turn1" v-if="iAmPlayer && !game.is_ended && !isMyTurn">相手ã®ã‚¿ãƒ¼ãƒ³ã§ã™<mk-ellipsis/></p> + <p class="turn2" v-if="iAmPlayer && !game.is_ended && isMyTurn" v-animate-css="{ classes: 'tada', iteration: 'infinite' }">ã‚ãªãŸã®ã‚¿ãƒ¼ãƒ³ã§ã™</p> + <p class="result" v-if="game.is_ended && logPos == logs.length"> + <template v-if="game.winner"><b>{{ game.winner.name }}</b>ã®å‹ã¡{{ game.settings.is_llotheo ? ' (ãƒã‚»ã‚ª)' : '' }}</template> + <template v-else>引ã分ã‘</template> + </p> + </div> <div class="board" :style="{ 'grid-template-rows': `repeat(${ game.settings.map.length }, 1fr)`, 'grid-template-columns': `repeat(${ game.settings.map[0].length }, 1fr)` }"> <div v-for="(stone, i) in o.board" diff --git a/src/web/app/common/views/components/othello.vue b/src/web/app/common/views/components/othello.vue index 70bb6b2ef5163ad1ec0d2c4a018fd4d637f98707..81da02d1c4e4799a49a0b5f61cdd680977d480d1 100644 --- a/src/web/app/common/views/components/othello.vue +++ b/src/web/app/common/views/components/othello.vue @@ -39,21 +39,21 @@ </section> <section v-if="myGames.length > 0"> <h2>自分ã®å¯¾å±€</h2> - <div class="game" v-for="g in myGames" tabindex="-1" @click="go(g)"> + <a class="game" v-for="g in myGames" tabindex="-1" @click.prevent="go(g)" :href="`/othello/${g.id}`"> <img :src="`${g.user1.avatar_url}?thumbnail&size=32`" alt=""> <img :src="`${g.user2.avatar_url}?thumbnail&size=32`" alt=""> <span><b>{{ g.user1.name }}</b> vs <b>{{ g.user2.name }}</b></span> <span class="state">{{ g.is_ended ? '終了' : '進行ä¸' }}</span> - </div> + </a> </section> <section v-if="games.length > 0"> <h2>ã¿ã‚“ãªã®å¯¾å±€</h2> - <div class="game" v-for="g in games" tabindex="-1" @click="go(g)"> + <a class="game" v-for="g in games" tabindex="-1" @click.prevent="go(g)" :href="`/othello/${g.id}`"> <img :src="`${g.user1.avatar_url}?thumbnail&size=32`" alt=""> <img :src="`${g.user2.avatar_url}?thumbnail&size=32`" alt=""> <span><b>{{ g.user1.name }}</b> vs <b>{{ g.user2.name }}</b></span> <span class="state">{{ g.is_ended ? '終了' : '進行ä¸' }}</span> - </div> + </a> </section> </div> </div> @@ -265,8 +265,10 @@ export default Vue.extend({ line-height 32px .game + display block margin 8px 0 padding 8px + color #677f84 border solid 1px #e1e5e8 border-radius 6px cursor pointer diff --git a/src/web/app/init.ts b/src/web/app/init.ts index 52d2ecf99abef2afc60997624930e1a47475a854..28adfd3b07275c8c1202d1ea1f9a5a3e95f87c81 100644 --- a/src/web/app/init.ts +++ b/src/web/app/init.ts @@ -6,6 +6,7 @@ import Vue from 'vue'; import VueRouter from 'vue-router'; import VModal from 'vue-js-modal'; import * as TreeView from 'vue-json-tree-view'; +import VAnimateCss from 'v-animate-css'; import Element from 'element-ui'; import ElementLocaleEn from 'element-ui/lib/locale/lang/en'; import ElementLocaleJa from 'element-ui/lib/locale/lang/ja'; @@ -25,6 +26,7 @@ switch (lang) { Vue.use(VueRouter); Vue.use(VModal); Vue.use(TreeView); +Vue.use(VAnimateCss); Vue.use(Element, { locale: elementLocale }); // Register global directives