mirror of
https://github.com/immich-app/immich
synced 2026-08-15 13:03:57 +00:00
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.
This commit is contained in:
parent
4bc9a20500
commit
c4628c9112
1 changed files with 12 additions and 7 deletions
|
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue