diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 5fcd562720..a76ab1f2c5 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 a3290486a7..cfb17c05f9 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 0000000000..d8e9a2f265 Binary files /dev/null and b/src/client/assets/sounds/aisha/1.mp3 differ diff --git a/src/client/assets/sounds/aisha/2.mp3 b/src/client/assets/sounds/aisha/2.mp3 new file mode 100644 index 0000000000..477c2eba43 Binary files /dev/null and b/src/client/assets/sounds/aisha/2.mp3 differ diff --git a/src/client/assets/sounds/aisha/3.mp3 b/src/client/assets/sounds/aisha/3.mp3 new file mode 100644 index 0000000000..fe0d8063df Binary files /dev/null and b/src/client/assets/sounds/aisha/3.mp3 differ 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 0000000000..616b506c4f Binary files /dev/null and b/src/client/assets/sounds/noizenecio/kick_gaba.mp3 differ diff --git a/src/client/assets/sounds/syuilo/pope1.mp3 b/src/client/assets/sounds/syuilo/pope1.mp3 new file mode 100644 index 0000000000..585bb0407e Binary files /dev/null and b/src/client/assets/sounds/syuilo/pope1.mp3 differ diff --git a/src/client/assets/sounds/syuilo/pope2.mp3 b/src/client/assets/sounds/syuilo/pope2.mp3 new file mode 100644 index 0000000000..83865b989e Binary files /dev/null and b/src/client/assets/sounds/syuilo/pope2.mp3 differ diff --git a/src/client/assets/sounds/syuilo/waon.mp3 b/src/client/assets/sounds/syuilo/waon.mp3 new file mode 100644 index 0000000000..c5797f066e Binary files /dev/null and b/src/client/assets/sounds/syuilo/waon.mp3 differ diff --git a/src/client/components/timeline.vue b/src/client/components/timeline.vue index 407aeb2161..ba367bf23d 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 3d22b8198e..6266fb5a2d 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 3bf026af7f..e0eb99769e 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 c3bc71b114..14a385d1a8 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 b2584393a0..aa0c4c93b8 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 b3ef4d17b9..4193959188 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 @@