summaryrefslogtreecommitdiff
path: root/src/web
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-03-11 01:55:46 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-03-11 01:55:50 +0900
commitd103a57073772c70082ed6ecc632991ac98e68b1 (patch)
tree174f4785038c115a866487d9c48a36ba51b40477 /src/web
parentMerge pull request #1229 from syuilo/othello-eighteightH16-map (diff)
downloadmisskey-d103a57073772c70082ed6ecc632991ac98e68b1.tar.gz
misskey-d103a57073772c70082ed6ecc632991ac98e68b1.tar.bz2
misskey-d103a57073772c70082ed6ecc632991ac98e68b1.zip
#1232
Diffstat (limited to 'src/web')
-rw-r--r--src/web/app/common/views/components/othello.game.vue15
-rw-r--r--src/web/assets/othello-put-me.mp3bin0 -> 15672 bytes
-rw-r--r--src/web/assets/othello-put-you.mp3bin0 -> 26121 bytes
3 files changed, 15 insertions, 0 deletions
diff --git a/src/web/app/common/views/components/othello.game.vue b/src/web/app/common/views/components/othello.game.vue
index a84dcedd44..77be458879 100644
--- a/src/web/app/common/views/components/othello.game.vue
+++ b/src/web/app/common/views/components/othello.game.vue
@@ -38,6 +38,7 @@
<script lang="ts">
import Vue from 'vue';
import Othello, { Color } from '../../../../../common/othello/core';
+import { url } from '../../../config';
export default Vue.extend({
props: ['game', 'connection'],
@@ -134,6 +135,13 @@ export default Vue.extend({
this.o.put(this.myColor, pos);
+ // サウンドを再生する
+ if ((this as any).os.isEnableSounds) {
+ const sound = new Audio(`${url}/assets/othello-put-me.mp3`);
+ sound.volume = localStorage.getItem('soundVolume') ? parseInt(localStorage.getItem('soundVolume'), 10) / 100 : 1;
+ sound.play();
+ }
+
this.connection.send({
type: 'set',
pos
@@ -150,6 +158,13 @@ export default Vue.extend({
this.o.put(x.color, x.pos);
this.checkEnd();
this.$forceUpdate();
+
+ // サウンドを再生する
+ if ((this as any).os.isEnableSounds && x.color != this.myColor) {
+ const sound = new Audio(`${url}/assets/othello-put-you.mp3`);
+ sound.volume = localStorage.getItem('soundVolume') ? parseInt(localStorage.getItem('soundVolume'), 10) / 100 : 1;
+ sound.play();
+ }
},
checkEnd() {
diff --git a/src/web/assets/othello-put-me.mp3 b/src/web/assets/othello-put-me.mp3
new file mode 100644
index 0000000000..4e0e72091c
--- /dev/null
+++ b/src/web/assets/othello-put-me.mp3
Binary files differ
diff --git a/src/web/assets/othello-put-you.mp3 b/src/web/assets/othello-put-you.mp3
new file mode 100644
index 0000000000..9244189c2d
--- /dev/null
+++ b/src/web/assets/othello-put-you.mp3
Binary files differ