feat(web): add an option to fill the screen with the slideshow view (#8909)

* feat: add an option to fill the screen with the slideshow view

* fix: rename var
This commit is contained in:
martin 2024-04-19 12:49:29 +02:00 committed by GitHub
parent 4478e524f8
commit eaf9e5e477
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 46 additions and 12 deletions

View file

@ -13,6 +13,16 @@ export enum SlideshowNavigation {
DescendingOrder = 'descending-order',
}
export enum SlideshowLook {
Contain = 'contain',
Cover = 'cover',
}
export const slideshowLookCssMapping: Record<SlideshowLook, string> = {
[SlideshowLook.Contain]: 'object-contain',
[SlideshowLook.Cover]: 'object-cover',
};
function createSlideshowStore() {
const restartState = writable<boolean>(false);
const stopState = writable<boolean>(false);
@ -21,6 +31,7 @@ function createSlideshowStore() {
'slideshow-navigation',
SlideshowNavigation.DescendingOrder,
);
const slideshowLook = persisted<SlideshowLook>('slideshow-look', SlideshowLook.Contain);
const slideshowState = writable<SlideshowState>(SlideshowState.None);
const showProgressBar = persisted<boolean>('slideshow-show-progressbar', true);
@ -50,6 +61,7 @@ function createSlideshowStore() {
},
},
slideshowNavigation,
slideshowLook,
slideshowState,
slideshowDelay,
showProgressBar,