diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 5fcd56272..a76ab1f2c 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -424,6 +424,16 @@ deleteAll: "全て削除" showFixedPostForm: "タイムライン上部に投稿フォームを表示する" newNoteRecived: "新しいノートがあります" useNotificationsPopup: "通知一覧をポップアップで表示" +sounds: "サウンド" +listen: "聴く" +none: "なし" +volume: "音量" + +_sfx: + note: "ノート" + notification: "通知" + chat: "チャット" + chatBg: "チャット(バックグラウンド)" _ago: unknown: "謎" diff --git a/src/client/app.vue b/src/client/app.vue index a3290486a..cfb17c05f 100644 --- a/src/client/app.vue +++ b/src/client/app.vue @@ -93,7 +93,7 @@ {{ $t('more') }} - + {{ $t('settings') }} @@ -578,13 +578,19 @@ export default Vue.extend({ onNotification(notification) { // TODO: ユーザーが画面を見てないと思われるとき(ブラウザやタブがアクティブじゃないなど)は送信しない - this.$root.stream.send('readNotification', { - id: notification.id - }); + if (true) { + this.$root.stream.send('readNotification', { + id: notification.id + }); - this.$root.new(MkToast, { - notification - }); + this.$root.new(MkToast, { + notification + }); + } + + const audio = new Audio(`/assets/sounds/${this.$store.state.device.sfxNotification}.mp3`); + audio.volume = this.$store.state.device.sfxVolume; + audio.play(); }, onMousedown(e) { diff --git a/src/client/assets/sounds/aisha/1.mp3 b/src/client/assets/sounds/aisha/1.mp3 new file mode 100644 index 000000000..493e46fe5 --- /dev/null +++ b/src/client/assets/sounds/aisha/1.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:37185482a492c277e04178be64a879f403a4d8a7f1b3c17f75849b3edca26a0f +size 34480 diff --git a/src/client/assets/sounds/aisha/2.mp3 b/src/client/assets/sounds/aisha/2.mp3 new file mode 100644 index 000000000..5c9c57b0e --- /dev/null +++ b/src/client/assets/sounds/aisha/2.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f5b3b259a7161d1d7ba6b37572748a85cd208c02d9d8f7b1272ebcabe0762bb0 +size 24031 diff --git a/src/client/assets/sounds/aisha/3.mp3 b/src/client/assets/sounds/aisha/3.mp3 new file mode 100644 index 000000000..a7bc14046 --- /dev/null +++ b/src/client/assets/sounds/aisha/3.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aa164bbe105f786ff85bce43e13f12e61552530b1fda0c22aeb1f19c4fb60196 +size 29256 diff --git a/src/client/assets/sounds/noizenecio/kick_gaba.mp3 b/src/client/assets/sounds/noizenecio/kick_gaba.mp3 new file mode 100644 index 000000000..2721348a9 --- /dev/null +++ b/src/client/assets/sounds/noizenecio/kick_gaba.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a77d6160ebdc0cf92444c9bed4ca7364b2d5ebda0394e8494971160b9b9d2846 +size 18866 diff --git a/src/client/assets/sounds/syuilo/pope1.mp3 b/src/client/assets/sounds/syuilo/pope1.mp3 new file mode 100644 index 000000000..a6ba0679f --- /dev/null +++ b/src/client/assets/sounds/syuilo/pope1.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e51c702cdc54322bad6451c0ee014624ed3b34f01555b85419fdaaa0fd04a2ea +size 19242 diff --git a/src/client/assets/sounds/syuilo/pope2.mp3 b/src/client/assets/sounds/syuilo/pope2.mp3 new file mode 100644 index 000000000..e8d116440 --- /dev/null +++ b/src/client/assets/sounds/syuilo/pope2.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:95d608e58c400ff40bba8a86cbe50e7a4a2f125e0248bfc079d830fa079e4b1c +size 19250 diff --git a/src/client/assets/sounds/syuilo/waon.mp3 b/src/client/assets/sounds/syuilo/waon.mp3 new file mode 100644 index 000000000..e424adb8f --- /dev/null +++ b/src/client/assets/sounds/syuilo/waon.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4b31a7ae9f2922cd16a360d4514b2f7b0f9e7f118b78458b9addd98e00781b7e +size 19242 diff --git a/src/client/components/timeline.vue b/src/client/components/timeline.vue index 407aeb216..ba367bf23 100644 --- a/src/client/components/timeline.vue +++ b/src/client/components/timeline.vue @@ -21,6 +21,11 @@ export default Vue.extend({ }, antenna: { required: false + }, + sound: { + type: Boolean, + required: false, + default: false, } }, @@ -46,6 +51,12 @@ export default Vue.extend({ const prepend = note => { (this.$refs.tl as any).prepend(note); + + if (this.sound) { + const audio = new Audio(`/assets/sounds/${this.$store.state.device.sfxNote}.mp3`); + audio.volume = this.$store.state.device.sfxVolume; + audio.play(); + } }; const onUserAdded = () => { diff --git a/src/client/components/ui/select.vue b/src/client/components/ui/select.vue index 3d22b8198..6266fb5a2 100644 --- a/src/client/components/ui/select.vue +++ b/src/client/components/ui/select.vue @@ -56,7 +56,7 @@ export default Vue.extend({ } }, filled(): boolean { - return this.v != '' && this.v != null; + return true; } }, mounted() { @@ -100,6 +100,7 @@ export default Vue.extend({ > .input { display: flex; + position: relative; &:before { content: ''; diff --git a/src/client/mios.ts b/src/client/mios.ts index 3bf026af7..e0eb99769 100644 --- a/src/client/mios.ts +++ b/src/client/mios.ts @@ -197,6 +197,10 @@ export default class MiOS extends EventEmitter { this.store.dispatch('mergeMe', { hasUnreadMessagingMessage: true }); + + const audio = new Audio(`/assets/sounds/${this.store.state.device.sfxChatBg}.mp3`); + audio.volume = this.store.state.device.sfxVolume; + audio.play(); }); main.on('readAllAntennas', () => { diff --git a/src/client/pages/index.home.vue b/src/client/pages/index.home.vue index c3bc71b11..14a385d1a 100644 --- a/src/client/pages/index.home.vue +++ b/src/client/pages/index.home.vue @@ -19,7 +19,7 @@ - + diff --git a/src/client/pages/messaging-room.vue b/src/client/pages/messaging-room.vue index b2584393a..aa0c4c93b 100644 --- a/src/client/pages/messaging-room.vue +++ b/src/client/pages/messaging-room.vue @@ -185,11 +185,9 @@ export default Vue.extend({ onMessage(message) { // サウンドを再生する - if (this.$store.state.device.enableSounds) { - const sound = new Audio(`${url}/assets/message.mp3`); - sound.volume = this.$store.state.device.soundVolume; - sound.play(); - } + const audio = new Audio(`/assets/sounds/${this.$store.state.device.sfxChat}.mp3`); + audio.volume = this.$store.state.device.sfxVolume; + audio.play(); const isBottom = this.isBottom(); diff --git a/src/client/pages/settings/index.vue b/src/client/pages/preferences/index.vue similarity index 60% rename from src/client/pages/settings/index.vue rename to src/client/pages/preferences/index.vue index b3ef4d17b..419395918 100644 --- a/src/client/pages/settings/index.vue +++ b/src/client/pages/preferences/index.vue @@ -5,6 +5,36 @@ +
+
{{ $t('sounds') }}
+
+ {{ $t('volume') }} + +
+
+ + + + + + + + + + + + + + + + + + + + +
+
+
{{ $t('accessibility') }}
@@ -45,7 +75,7 @@