From c4628c91124a5dc2cccc049676c9ed0d8dd507ab Mon Sep 17 00:00:00 2001 From: Hartley Raabis Date: Thu, 6 Aug 2026 14:20:10 -0600 Subject: [PATCH] Update animateSlideshow to animate 10% no motion, 20% zoom in from 1x, 70% random between 2 scales. Random duration between 50% - 100% of animation duration. --- .../asset-viewer/PhotoViewer.svelte | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/web/src/lib/components/asset-viewer/PhotoViewer.svelte b/web/src/lib/components/asset-viewer/PhotoViewer.svelte index 086b253da1..fcbd9e4d74 100644 --- a/web/src/lib/components/asset-viewer/PhotoViewer.svelte +++ b/web/src/lib/components/asset-viewer/PhotoViewer.svelte @@ -116,15 +116,20 @@ const onPlaySlideshow = () => ($slideshowState = SlideshowState.PlaySlideshow); const animateSlideshow = () => { - let randomDirection = getRandomInt(0, 2); - let randomScale = (getRandomInt(50, 200) / 100) * ($slideshowAnimateZoomStrength / 100) + 1; + let randomDirection = getRandomInt(0, 9); + if (randomDirection == 0) { + return; + } + let randomScale1 = (getRandomInt(0, 200) / 100) * ($slideshowAnimateZoomStrength / 100) + 1; let duration = $slideshowDelay * 1000 - 600; - if (randomDirection == 1) { - assetViewerManager.animatedZoom(randomScale, duration); - } else if (randomDirection == 2) { - assetViewerManager.animatedZoom(randomScale, 20); + let randomDuration = Math.round(duration * (getRandomInt(50, 100) / 100)); + let randomScale2 = (getRandomInt(0, 200) / 100) * ($slideshowAnimateZoomStrength / 100) + 1; + if (randomDirection <= 2) { + assetViewerManager.animatedZoom(randomScale1, randomDuration); + } else if (randomDirection > 2) { + assetViewerManager.animatedZoom(randomScale1, 20); setTimeout(() => { - assetViewerManager.animatedZoom(1, duration - 40); + assetViewerManager.animatedZoom(randomScale2, randomDuration - 40); }, 40); } };