From ed3c239b7e86dc1b67c0769efd1882384e16cd90 Mon Sep 17 00:00:00 2001 From: Sergey Kondrikov Date: Sun, 16 Jul 2023 04:25:59 +0300 Subject: [PATCH] fix(web): navigation buttons z-order (#3286) * Fix navigation styling * z-index * refactor transition and hover * Add NavigationButton and NavigationArea components * Use group-hover to simplify hover styling * fix check * fix check --------- Co-authored-by: Alex Tran --- .../asset-viewer/asset-viewer.svelte | 57 ++----------------- .../asset-viewer/navigation-area.svelte | 9 +++ 2 files changed, 14 insertions(+), 52 deletions(-) create mode 100644 web/src/lib/components/asset-viewer/navigation-area.svelte diff --git a/web/src/lib/components/asset-viewer/asset-viewer.svelte b/web/src/lib/components/asset-viewer/asset-viewer.svelte index cf74b4a79c..9622699342 100644 --- a/web/src/lib/components/asset-viewer/asset-viewer.svelte +++ b/web/src/lib/components/asset-viewer/asset-viewer.svelte @@ -17,6 +17,7 @@ import { assetStore } from '$lib/stores/assets.store'; import { isShowDetail } from '$lib/stores/preferences.store'; import { addAssetsToAlbum, downloadFile } from '$lib/utils/asset-utils'; + import NavigationArea from './navigation-area.svelte'; import { browser } from '$app/environment'; export let asset: AssetResponseDto; @@ -25,8 +26,6 @@ export let sharedLink: SharedLinkResponseDto | undefined = undefined; const dispatch = createEventDispatcher(); - let halfLeftHover = false; - let halfRightHover = false; let appearsInAlbums: AlbumResponseDto[] = []; let isShowAlbumPicker = false; let isShowDeleteConfirmation = false; @@ -251,28 +250,8 @@ {#if showNavigation} - -
{ - halfLeftHover = true; - halfRightHover = false; - }} - on:mouseleave={() => { - halfLeftHover = false; - }} - on:click={navigateAssetBackward} - on:keydown={navigateAssetBackward} - > - +
+
{/if} @@ -304,28 +283,8 @@
{#if showNavigation} - -
{ - halfLeftHover = false; - halfRightHover = true; - }} - on:mouseleave={() => { - halfRightHover = false; - }} - > - +
+
{/if} @@ -379,10 +338,4 @@ #immich-asset-viewer { contain: layout; } - - .navigation-button-hover { - background-color: rgb(107 114 128 / var(--tw-bg-opacity)); - color: rgb(255 255 255 / var(--tw-text-opacity)); - transition: all 150ms; - } diff --git a/web/src/lib/components/asset-viewer/navigation-area.svelte b/web/src/lib/components/asset-viewer/navigation-area.svelte new file mode 100644 index 0000000000..e0656992a8 --- /dev/null +++ b/web/src/lib/components/asset-viewer/navigation-area.svelte @@ -0,0 +1,9 @@ + + + +
+ +