2022-05-27 14:02:06 -05:00
|
|
|
<script lang="ts">
|
2024-06-07 14:22:46 -04:00
|
|
|
import { shortcuts } from '$lib/actions/shortcut';
|
2024-08-22 23:24:49 -04:00
|
|
|
import { zoomImageAction, zoomed } from '$lib/actions/zoom-image';
|
|
|
|
|
import BrokenAsset from '$lib/components/assets/broken-asset.svelte';
|
2023-12-05 16:43:15 +01:00
|
|
|
import { boundingBoxesArray } from '$lib/stores/people.store';
|
2024-02-13 15:42:29 +01:00
|
|
|
import { alwaysLoadOriginalFile } from '$lib/stores/preferences.store';
|
2024-06-07 14:22:46 -04:00
|
|
|
import { SlideshowLook, SlideshowState, slideshowLookCssMapping, slideshowStore } from '$lib/stores/slideshow.store';
|
2024-02-14 08:09:49 -05:00
|
|
|
import { photoZoomState } from '$lib/stores/zoom-image.store';
|
2025-04-01 01:24:28 +08:00
|
|
|
import { getAssetThumbnailUrl, handlePromiseError } from '$lib/utils';
|
|
|
|
|
import { canCopyImageToClipboard, copyImageToClipboard } from '$lib/utils/asset-utils';
|
2024-02-14 08:09:49 -05:00
|
|
|
import { getBoundingBox } from '$lib/utils/people-utils';
|
2024-06-07 14:22:46 -04:00
|
|
|
import { getAltText } from '$lib/utils/thumbnail-util';
|
2024-08-22 23:24:49 -04:00
|
|
|
import { AssetMediaSize, AssetTypeEnum, type AssetResponseDto, type SharedLinkResponseDto } from '@immich/sdk';
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
import { onDestroy, onMount } from 'svelte';
|
2024-08-22 23:24:49 -04:00
|
|
|
import { t } from 'svelte-i18n';
|
2024-08-29 17:40:17 +02:00
|
|
|
import { type SwipeCustomEvent, swipe } from 'svelte-gestures';
|
2024-02-14 08:09:49 -05:00
|
|
|
import { fade } from 'svelte/transition';
|
|
|
|
|
import LoadingSpinner from '../shared-components/loading-spinner.svelte';
|
|
|
|
|
import { NotificationType, notificationController } from '../shared-components/notification/notification';
|
2024-09-06 15:16:59 +02:00
|
|
|
import { handleError } from '$lib/utils/handle-error';
|
2025-02-21 09:58:25 -06:00
|
|
|
import FaceEditor from '$lib/components/asset-viewer/face-editor/face-editor.svelte';
|
2025-03-04 21:34:53 -05:00
|
|
|
import { photoViewerImgElement } from '$lib/stores/assets-store.svelte';
|
2025-02-21 09:58:25 -06:00
|
|
|
import { isFaceEditMode } from '$lib/stores/face-edit.svelte';
|
2024-04-19 12:49:29 +02:00
|
|
|
|
2024-11-14 08:43:25 -06:00
|
|
|
interface Props {
|
|
|
|
|
asset: AssetResponseDto;
|
|
|
|
|
preloadAssets?: AssetResponseDto[] | undefined;
|
|
|
|
|
element?: HTMLDivElement | undefined;
|
|
|
|
|
haveFadeTransition?: boolean;
|
|
|
|
|
sharedLink?: SharedLinkResponseDto | undefined;
|
|
|
|
|
onPreviousAsset?: (() => void) | null;
|
|
|
|
|
onNextAsset?: (() => void) | null;
|
|
|
|
|
copyImage?: () => Promise<void>;
|
|
|
|
|
zoomToggle?: (() => void) | null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let {
|
|
|
|
|
asset,
|
|
|
|
|
preloadAssets = undefined,
|
|
|
|
|
element = $bindable(),
|
|
|
|
|
haveFadeTransition = true,
|
|
|
|
|
sharedLink = undefined,
|
|
|
|
|
onPreviousAsset = null,
|
|
|
|
|
onNextAsset = null,
|
|
|
|
|
copyImage = $bindable(),
|
|
|
|
|
zoomToggle = $bindable(),
|
|
|
|
|
}: Props = $props();
|
2023-07-01 00:50:47 -04:00
|
|
|
|
2024-06-07 14:22:46 -04:00
|
|
|
const { slideshowState, slideshowLook } = slideshowStore;
|
2023-07-01 00:50:47 -04:00
|
|
|
|
2024-11-14 08:43:25 -06:00
|
|
|
let assetFileUrl: string = $state('');
|
|
|
|
|
let imageLoaded: boolean = $state(false);
|
2025-04-01 01:24:28 +08:00
|
|
|
let originalImageLoaded: boolean = $state(false);
|
2024-11-14 08:43:25 -06:00
|
|
|
let imageError: boolean = $state(false);
|
2024-06-07 14:22:46 -04:00
|
|
|
|
2024-11-14 08:43:25 -06:00
|
|
|
let loader = $state<HTMLImageElement>();
|
2024-06-07 14:22:46 -04:00
|
|
|
|
|
|
|
|
photoZoomState.set({
|
|
|
|
|
currentRotation: 0,
|
|
|
|
|
currentZoom: 1,
|
|
|
|
|
enable: true,
|
|
|
|
|
currentPositionX: 0,
|
|
|
|
|
currentPositionY: 0,
|
|
|
|
|
});
|
|
|
|
|
$zoomed = false;
|
2024-05-28 13:15:50 +02:00
|
|
|
|
2023-09-20 05:16:53 +02:00
|
|
|
onDestroy(() => {
|
2023-12-05 16:43:15 +01:00
|
|
|
$boundingBoxesArray = [];
|
2023-09-20 05:16:53 +02:00
|
|
|
});
|
|
|
|
|
|
2025-04-01 01:24:28 +08:00
|
|
|
const preload = (targetSize: AssetMediaSize, preloadAssets?: AssetResponseDto[]) => {
|
2024-06-07 14:22:46 -04:00
|
|
|
for (const preloadAsset of preloadAssets || []) {
|
|
|
|
|
if (preloadAsset.type === AssetTypeEnum.Image) {
|
|
|
|
|
let img = new Image();
|
2025-04-01 01:24:28 +08:00
|
|
|
img.src = getAssetUrl(preloadAsset.id, targetSize, preloadAsset.thumbhash);
|
2024-05-28 13:15:50 +02:00
|
|
|
}
|
|
|
|
|
}
|
2024-05-23 20:26:22 -04:00
|
|
|
};
|
|
|
|
|
|
2025-04-01 01:24:28 +08:00
|
|
|
const getAssetUrl = (id: string, targetSize: AssetMediaSize, cacheKey: string | null) => {
|
|
|
|
|
let finalAssetMediaSize = targetSize;
|
2024-06-13 09:21:47 -05:00
|
|
|
if (sharedLink && (!sharedLink.allowDownload || !sharedLink.showMetadata)) {
|
2025-04-01 01:24:28 +08:00
|
|
|
finalAssetMediaSize = AssetMediaSize.Preview;
|
2024-06-13 09:21:47 -05:00
|
|
|
}
|
|
|
|
|
|
2025-04-01 01:24:28 +08:00
|
|
|
return getAssetThumbnailUrl({ id, size: finalAssetMediaSize, cacheKey });
|
2024-06-07 14:22:46 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
copyImage = async () => {
|
2024-09-06 15:16:59 +02:00
|
|
|
if (!canCopyImageToClipboard()) {
|
2023-07-01 00:50:47 -04:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
2025-02-21 09:58:25 -06:00
|
|
|
await copyImageToClipboard($photoViewerImgElement ?? assetFileUrl);
|
2023-07-01 00:50:47 -04:00
|
|
|
notificationController.show({
|
|
|
|
|
type: NotificationType.Info,
|
2024-06-04 21:53:00 +02:00
|
|
|
message: $t('copied_image_to_clipboard'),
|
2023-07-01 00:50:47 -04:00
|
|
|
timeout: 3000,
|
|
|
|
|
});
|
2024-02-02 04:18:00 +01:00
|
|
|
} catch (error) {
|
2024-09-06 15:16:59 +02:00
|
|
|
handleError(error, $t('copy_error'));
|
2023-07-01 00:50:47 -04:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2024-06-07 14:22:46 -04:00
|
|
|
zoomToggle = () => {
|
|
|
|
|
$zoomed = $zoomed ? false : true;
|
2023-07-01 00:50:47 -04:00
|
|
|
};
|
|
|
|
|
|
2025-02-21 09:58:25 -06:00
|
|
|
$effect(() => {
|
|
|
|
|
if (isFaceEditMode.value && $photoZoomState.currentZoom > 1) {
|
|
|
|
|
zoomToggle();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
2024-05-24 10:56:36 +02:00
|
|
|
const onCopyShortcut = (event: KeyboardEvent) => {
|
2024-12-18 15:19:48 +01:00
|
|
|
if (globalThis.getSelection()?.type === 'Range') {
|
2024-03-15 00:16:55 +01:00
|
|
|
return;
|
|
|
|
|
}
|
2024-05-24 10:56:36 +02:00
|
|
|
event.preventDefault();
|
2024-06-07 14:22:46 -04:00
|
|
|
handlePromiseError(copyImage());
|
2024-03-15 00:16:55 +01:00
|
|
|
};
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
|
2024-08-29 17:40:17 +02:00
|
|
|
const onSwipe = (event: SwipeCustomEvent) => {
|
|
|
|
|
if ($photoZoomState.currentZoom > 1) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (onNextAsset && event.detail.direction === 'left') {
|
|
|
|
|
onNextAsset();
|
|
|
|
|
}
|
|
|
|
|
if (onPreviousAsset && event.detail.direction === 'right') {
|
|
|
|
|
onPreviousAsset();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2025-04-01 01:24:28 +08:00
|
|
|
// when true, will force loading of the original image
|
|
|
|
|
let forceUseOriginal: boolean = $derived(asset.originalMimeType === 'image/gif' || $photoZoomState.currentZoom > 1);
|
|
|
|
|
|
|
|
|
|
const targetImageSize = $derived(
|
|
|
|
|
$alwaysLoadOriginalFile || forceUseOriginal || originalImageLoaded
|
|
|
|
|
? AssetMediaSize.Fullsize
|
|
|
|
|
: AssetMediaSize.Preview,
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
const onload = () => {
|
|
|
|
|
imageLoaded = true;
|
|
|
|
|
assetFileUrl = imageLoaderUrl;
|
|
|
|
|
originalImageLoaded = targetImageSize === AssetMediaSize.Fullsize;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const onerror = () => {
|
|
|
|
|
imageError = imageLoaded = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$effect(() => {
|
|
|
|
|
preload(targetImageSize, preloadAssets);
|
|
|
|
|
});
|
|
|
|
|
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
onMount(() => {
|
2024-11-14 08:43:25 -06:00
|
|
|
if (loader?.complete) {
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
onload();
|
|
|
|
|
}
|
2024-11-14 08:43:25 -06:00
|
|
|
loader?.addEventListener('load', onload);
|
|
|
|
|
loader?.addEventListener('error', onerror);
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
return () => {
|
|
|
|
|
loader?.removeEventListener('load', onload);
|
|
|
|
|
loader?.removeEventListener('error', onerror);
|
|
|
|
|
};
|
|
|
|
|
});
|
2024-11-14 08:43:25 -06:00
|
|
|
|
2025-04-01 01:24:28 +08:00
|
|
|
let imageLoaderUrl = $derived(getAssetUrl(asset.id, targetImageSize, asset.checksum));
|
2025-02-21 09:58:25 -06:00
|
|
|
|
|
|
|
|
let containerWidth = $state(0);
|
|
|
|
|
let containerHeight = $state(0);
|
2022-05-27 14:02:06 -05:00
|
|
|
</script>
|
|
|
|
|
|
2024-03-15 00:16:55 +01:00
|
|
|
<svelte:window
|
|
|
|
|
use:shortcuts={[
|
2024-05-24 10:56:36 +02:00
|
|
|
{ shortcut: { key: 'c', ctrl: true }, onShortcut: onCopyShortcut, preventDefault: false },
|
|
|
|
|
{ shortcut: { key: 'c', meta: true }, onShortcut: onCopyShortcut, preventDefault: false },
|
2024-03-15 00:16:55 +01:00
|
|
|
]}
|
|
|
|
|
/>
|
2024-06-07 14:22:46 -04:00
|
|
|
{#if imageError}
|
2024-09-06 15:16:18 +02:00
|
|
|
<BrokenAsset class="text-xl" />
|
2024-06-07 14:22:46 -04:00
|
|
|
{/if}
|
2024-11-14 08:43:25 -06:00
|
|
|
<!-- svelte-ignore a11y_missing_attribute -->
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
<img bind:this={loader} style="display:none" src={imageLoaderUrl} aria-hidden="true" />
|
2025-02-21 09:58:25 -06:00
|
|
|
<div
|
|
|
|
|
bind:this={element}
|
|
|
|
|
class="relative h-full select-none"
|
|
|
|
|
bind:clientWidth={containerWidth}
|
|
|
|
|
bind:clientHeight={containerHeight}
|
|
|
|
|
>
|
2025-04-01 01:24:28 +08:00
|
|
|
<img style="display:none" src={imageLoaderUrl} alt={$getAltText(asset)} {onload} {onerror} />
|
2024-03-14 17:12:32 -04:00
|
|
|
{#if !imageLoaded}
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
<div id="spinner" class="flex h-full items-center justify-center">
|
2024-04-21 06:06:49 +02:00
|
|
|
<LoadingSpinner />
|
|
|
|
|
</div>
|
2024-06-07 14:22:46 -04:00
|
|
|
{:else if !imageError}
|
2024-08-30 23:31:42 +02:00
|
|
|
<div
|
|
|
|
|
use:zoomImageAction
|
2025-01-22 22:15:38 +00:00
|
|
|
use:swipe={() => ({})}
|
2024-11-14 08:43:25 -06:00
|
|
|
onswipe={onSwipe}
|
2024-08-30 23:31:42 +02:00
|
|
|
class="h-full w-full"
|
|
|
|
|
transition:fade={{ duration: haveFadeTransition ? 150 : 0 }}
|
|
|
|
|
>
|
2024-05-28 13:15:50 +02:00
|
|
|
{#if $slideshowState !== SlideshowState.None && $slideshowLook === SlideshowLook.BlurredBackground}
|
2024-04-21 06:06:49 +02:00
|
|
|
<img
|
2024-06-07 14:22:46 -04:00
|
|
|
src={assetFileUrl}
|
2024-07-07 22:29:56 +00:00
|
|
|
alt={$getAltText(asset)}
|
2024-05-28 13:15:50 +02:00
|
|
|
class="absolute top-0 left-0 -z-10 object-cover h-full w-full blur-lg"
|
2024-04-21 06:06:49 +02:00
|
|
|
draggable="false"
|
|
|
|
|
/>
|
2024-05-28 13:15:50 +02:00
|
|
|
{/if}
|
|
|
|
|
<img
|
2025-02-21 09:58:25 -06:00
|
|
|
bind:this={$photoViewerImgElement}
|
2024-06-07 14:22:46 -04:00
|
|
|
src={assetFileUrl}
|
2024-07-07 22:29:56 +00:00
|
|
|
alt={$getAltText(asset)}
|
2024-05-28 13:15:50 +02:00
|
|
|
class="h-full w-full {$slideshowState === SlideshowState.None
|
|
|
|
|
? 'object-contain'
|
|
|
|
|
: slideshowLookCssMapping[$slideshowLook]}"
|
|
|
|
|
draggable="false"
|
|
|
|
|
/>
|
2025-03-03 14:24:26 +00:00
|
|
|
<!-- eslint-disable-next-line svelte/require-each-key -->
|
2025-02-21 09:58:25 -06:00
|
|
|
{#each getBoundingBox($boundingBoxesArray, $photoZoomState, $photoViewerImgElement) as boundingbox}
|
2024-05-28 13:15:50 +02:00
|
|
|
<div
|
|
|
|
|
class="absolute border-solid border-white border-[3px] rounded-lg"
|
|
|
|
|
style="top: {boundingbox.top}px; left: {boundingbox.left}px; height: {boundingbox.height}px; width: {boundingbox.width}px;"
|
2024-11-02 16:49:07 +01:00
|
|
|
></div>
|
2024-05-28 13:15:50 +02:00
|
|
|
{/each}
|
|
|
|
|
</div>
|
2025-02-21 09:58:25 -06:00
|
|
|
|
|
|
|
|
{#if isFaceEditMode.value}
|
2025-02-26 12:55:32 -06:00
|
|
|
<FaceEditor htmlElement={$photoViewerImgElement} {containerWidth} {containerHeight} assetId={asset.id} />
|
2025-02-21 09:58:25 -06:00
|
|
|
{/if}
|
2024-03-14 17:12:32 -04:00
|
|
|
{/if}
|
2022-05-27 14:02:06 -05:00
|
|
|
</div>
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
@keyframes delayedVisibility {
|
|
|
|
|
to {
|
|
|
|
|
visibility: visible;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#spinner {
|
|
|
|
|
visibility: hidden;
|
|
|
|
|
animation: 0s linear 0.4s forwards delayedVisibility;
|
|
|
|
|
}
|
|
|
|
|
</style>
|