From 8a5c1f1bb3fa8ab024f83df394668483d44b6821 Mon Sep 17 00:00:00 2001 From: Freddy Boulton Date: Mon, 16 Dec 2024 08:27:01 -0800 Subject: [PATCH] Code (#40) --- frontend/shared/AudioWave.svelte | 21 +++++++++++++-------- pyproject.toml | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/frontend/shared/AudioWave.svelte b/frontend/shared/AudioWave.svelte index 2464ef1..156006b 100644 --- a/frontend/shared/AudioWave.svelte +++ b/frontend/shared/AudioWave.svelte @@ -64,6 +64,9 @@ animationId = requestAnimationFrame(updateVisualization); } + + $: maxPulseScale = 1 + (pulseIntensity * 10); // Scale from 1x to 3x based on intensity +
@@ -75,6 +78,8 @@ class="pulse-ring" style:background={pulse_color} style:animation-delay={`${i * 0.4}s`} + style:--max-scale={maxPulseScale} + style:opacity={0.5 * pulseIntensity} /> {/each} {/if} @@ -167,13 +172,13 @@ } @keyframes pulse { - 0% { - transform: translate(-50%, -50%) scale(1); - opacity: 0.5; + 0% { + transform: translate(-50%, -50%) scale(1); + opacity: 0.5; + } + 100% { + transform: translate(-50%, -50%) scale(var(--max-scale, 3)); + opacity: 0; + } } - 100% { - transform: translate(-50%, -50%) scale(3); - opacity: 0; - } -} \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 2ea70fb..a8e039e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ build-backend = "hatchling.build" [project] name = "gradio_webrtc" -version = "0.0.22rc1" +version = "0.0.23" description = "Stream images in realtime with webrtc" readme = "README.md" license = "apache-2.0"