From b9445cf832afb2b6550b5dfcc87ee4b87f4d11c5 Mon Sep 17 00:00:00 2001 From: ari melody Date: Mon, 8 Jul 2024 11:56:26 +0100 Subject: [PATCH] tweaked sounds on some buttons, renamed play_sound to playSound --- src/lib/sound.js | 6 +++--- src/lib/stores/compose.js | 4 ++++ src/lib/ui/Button.svelte | 4 ++-- src/lib/ui/Composer.svelte | 5 ++++- src/lib/ui/Navigation.svelte | 4 ++-- src/lib/ui/post/ActionBar.svelte | 11 ++++++++--- src/lib/ui/post/ActionButton.svelte | 4 ++-- src/lib/ui/post/ReactionButton.svelte | 4 ++-- 8 files changed, 27 insertions(+), 15 deletions(-) create mode 100644 src/lib/stores/compose.js diff --git a/src/lib/sound.js b/src/lib/sound.js index 3aa0e58..377b833 100644 --- a/src/lib/sound.js +++ b/src/lib/sound.js @@ -6,12 +6,12 @@ let sounds; if (typeof Audio !== typeof undefined) { sounds = { "default": new Audio(sound_log), - "post": new Audio(sound_hello), - "boost": new Audio(sound_success), + "post": new Audio(sound_success), + "boost": new Audio(sound_hello), }; } -export function play_sound(name) { +export function playSound(name) { if (name === false) return; if (!name) name = "default"; const sound = sounds[name]; diff --git a/src/lib/stores/compose.js b/src/lib/stores/compose.js new file mode 100644 index 0000000..2fe3b96 --- /dev/null +++ b/src/lib/stores/compose.js @@ -0,0 +1,4 @@ +import { writable } from 'svelte/store'; + +export const show = writable(false); +export const reply_post = writable(null); diff --git a/src/lib/ui/Button.svelte b/src/lib/ui/Button.svelte index ea68fc4..22e4d87 100644 --- a/src/lib/ui/Button.svelte +++ b/src/lib/ui/Button.svelte @@ -1,5 +1,5 @@ diff --git a/src/lib/ui/post/ReactionButton.svelte b/src/lib/ui/post/ReactionButton.svelte index c6355f8..6b933b1 100644 --- a/src/lib/ui/post/ReactionButton.svelte +++ b/src/lib/ui/post/ReactionButton.svelte @@ -1,5 +1,5 @@