From 3b690117d068149588acff8a5e840935414874c0 Mon Sep 17 00:00:00 2001 From: Samyak Jain <56000318+samyakkkk@users.noreply.github.com> Date: Sun, 18 Aug 2024 10:09:00 +0530 Subject: [PATCH] (feat): add a sound validation on agent submit button --- web/src/lib/components/CreateAgentDialog.svelte | 12 ++++++++++++ web/static/whoosh.mp3 | Bin 0 -> 9216 bytes 2 files changed, 12 insertions(+) create mode 100644 web/static/whoosh.mp3 diff --git a/web/src/lib/components/CreateAgentDialog.svelte b/web/src/lib/components/CreateAgentDialog.svelte index 5e02278..02d6805 100644 --- a/web/src/lib/components/CreateAgentDialog.svelte +++ b/web/src/lib/components/CreateAgentDialog.svelte @@ -21,10 +21,22 @@ { id: 'pub', icon: 'icons8-dart-96.png', label: 'Pub', placeholder: 'https://pub.dev/packages/name' }, ]; + let soundEffect: HTMLAudioElement | null = null; + + if (typeof window !== 'undefined') { + // Preload the sound effect + soundEffect = new Audio('whoosh.mp3'); + soundEffect.preload = 'auto'; + soundEffect.volume = 0.5 + } + const onCreateAgent = () => { value = value.trim(); const { isValid } = validateURL(value, selectedPlatform); if (isValid) { + // Play the sound effect + soundEffect?.play(); + appInsights.trackEvent({ name: "CreateAgentSubmitted", properties: { platform: selectedPlatform, url: value }, diff --git a/web/static/whoosh.mp3 b/web/static/whoosh.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..a60273eb5dbd841490f06a62b5db1e64f04774c7 GIT binary patch literal 9216 zcmeI&pOn^QcyFhe>r=I$Vofqn=pk;)gu2?Q`Oo_kjYmo%y zJR^KGlxqMRi?Qf&(;Pj8l_QH3Zywao?vPP5wG>X1e&Aflw#^2rh&#h5-&KVBhX>tC3@}3Ws;F zzGf8o2om19(ez4$zk*DzC$K@eMR^jgZw&I`A472uvK})~7y*t$djci82v1691hS|HSNQM?Xcn)8?0lEJAvrU~BPA&p^rP zShbyt(74l{6!29onp0H8t!hicAph;DBF`U{=|065(c zE%@`F|38V7USZ8mg+n?;^HA+V|GIz5{EGr+FK~u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