Skip to content

Commit 1a46e39

Browse files
committed
Add option to hide photo action dock instead of transparency
1 parent fad833e commit 1a46e39

File tree

5 files changed

+69
-10
lines changed

5 files changed

+69
-10
lines changed

app/Http/Resources/GalleryConfigs/InitConfig.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ class InitConfig extends Data
4747
public bool $is_favourite_enabled;
4848
public SmallLargeType $photo_previous_next_size;
4949
public bool $is_details_links_enabled;
50+
public bool $is_desktop_dock_full_transparency_enabled;
51+
public bool $is_mobile_dock_full_transparency_enabled;
5052

5153
// Thumbs configuration
5254
public ThumbOverlayVisibilityType $display_thumb_album_overlay;
@@ -130,6 +132,8 @@ public function __construct()
130132
if (Configs::getValueAsBool('details_links_enabled')) {
131133
$this->is_details_links_enabled = !Auth::guest() || Configs::getValueAsBool('details_links_public');
132134
}
135+
$this->is_desktop_dock_full_transparency_enabled = Configs::getValueAsBool('desktop_dock_full_transparency_enabled');
136+
$this->is_mobile_dock_full_transparency_enabled = Configs::getValueAsBool('mobile_dock_full_transparency_enabled');
133137

134138
// Thumbs configuration
135139
$this->display_thumb_album_overlay = Configs::getValueAsEnum('display_thumb_album_overlay', ThumbOverlayVisibilityType::class);
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
3+
/**
4+
* SPDX-License-Identifier: MIT
5+
* Copyright (c) 2017-2018 Tobias Reich
6+
* Copyright (c) 2018-2025 LycheeOrg.
7+
*/
8+
9+
use App\Models\Extensions\BaseConfigMigration;
10+
11+
return new class() extends BaseConfigMigration {
12+
public const MOD_GALLERY = 'Gallery';
13+
14+
/**
15+
* @return array<int,array{key:string,value:string,is_secret:bool,cat:string,type_range:string,description:string,order?:int,not_on_docker?:bool,is_expert?:bool}>
16+
*/
17+
public function getConfigs(): array
18+
{
19+
return [
20+
[
21+
'key' => 'desktop_dock_full_transparency_enabled',
22+
'value' => '0',
23+
'cat' => self::MOD_GALLERY,
24+
'type_range' => self::BOOL,
25+
'description' => 'Enable dock full transparency for desktop.',
26+
'details' => 'On the photo view, actions on top of the page are slightly transparent. Enable this to have them fully transparent and only appear on hover.',
27+
'is_secret' => false,
28+
'is_expert' => true,
29+
'order' => 40,
30+
'not_on_docker' => false,
31+
'level' => 0,
32+
],
33+
[
34+
'key' => 'mobile_dock_full_transparency_enabled',
35+
'value' => '0',
36+
'cat' => self::MOD_GALLERY,
37+
'type_range' => self::BOOL,
38+
'description' => 'Enable dock transparency for mobile.',
39+
'details' => '<span class="pi pi-exclamation-triangle text-orange-500"></span> This will impact usability on mobile. On the photo view, actions on top of the page are slightly transparent. Enable this to have them fully transparent and only appear on tap.',
40+
'is_secret' => false,
41+
'is_expert' => true,
42+
'order' => 41,
43+
'not_on_docker' => false,
44+
'level' => 0,
45+
],
46+
];
47+
}
48+
};

resources/js/components/gallery/photoModule/Dock.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@
33
v-if="photoStore.photo"
44
:class="{
55
'absolute top-0 w-full sm:w-1/2 left-1/2 -translate-x-1/2': true,
6-
'opacity-50 lg:opacity-20 lg:hover:opacity-100 transition-opacity duration-500 ease-in-out': !isTouchDevice(),
7-
'opacity-75': isTouchDevice(),
6+
'lg:hover:opacity-100 transition-opacity duration-500 ease-in-out': !isTouchDevice(),
7+
'opacity-50 lg:opacity-20': !isTouchDevice() && !lycheeStore.is_desktop_dock_full_transparency_enabled,
8+
'opacity-75': isTouchDevice() && !lycheeStore.is_mobile_dock_full_transparency_enabled,
9+
'opacity-0':
10+
(!isTouchDevice() && lycheeStore.is_desktop_dock_full_transparency_enabled) ||
11+
(isTouchDevice() && lycheeStore.is_mobile_dock_full_transparency_enabled),
812
'z-20 mt-14 sm:mt-0': true,
913
'sm:h-1/4': !props.isNarrowMenu,
1014
'h-14': props.isNarrowMenu,

resources/js/lychee.d.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -256,14 +256,7 @@ declare namespace App.Http.Resources.Editable {
256256
}
257257
declare namespace App.Http.Resources.Embed {
258258
export type EmbedAlbumResource = {
259-
album: {
260-
id: string;
261-
title: string;
262-
description: string | null;
263-
photo_count: number;
264-
copyright: string | null;
265-
license: string | null;
266-
};
259+
album: { [key: string]: any };
267260
photos: App.Http.Resources.Embed.EmbedPhotoResource[];
268261
};
269262
export type EmbedPhotoResource = {
@@ -273,6 +266,10 @@ declare namespace App.Http.Resources.Embed {
273266
size_variants: App.Http.Resources.Models.SizeVariantsResouce;
274267
exif: { [key: string]: string | null };
275268
};
269+
export type EmbedStreamResource = {
270+
site_title: string;
271+
photos: App.Http.Resources.Embed.EmbedPhotoResource[];
272+
};
276273
}
277274
declare namespace App.Http.Resources.Flow {
278275
export type FlowItemResource = {
@@ -360,6 +357,8 @@ declare namespace App.Http.Resources.GalleryConfigs {
360357
is_favourite_enabled: boolean;
361358
photo_previous_next_size: App.Enum.SmallLargeType;
362359
is_details_links_enabled: boolean;
360+
is_desktop_dock_full_transparency_enabled: boolean;
361+
is_mobile_dock_full_transparency_enabled: boolean;
363362
display_thumb_album_overlay: App.Enum.ThumbOverlayVisibilityType;
364363
display_thumb_photo_overlay: App.Enum.ThumbOverlayVisibilityType;
365364
album_subtitle_type: App.Enum.ThumbAlbumSubtitleType;

resources/js/stores/LycheeState.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ export const useLycheeStateStore = defineStore("lychee-store", {
3030
is_favourite_enabled: false,
3131
photo_previous_next_size: "small" as App.Enum.SmallLargeType,
3232
is_details_links_enabled: false,
33+
is_desktop_dock_full_transparency_enabled: false,
34+
is_mobile_dock_full_transparency_enabled: false,
3335

3436
// keybinding help
3537
show_keybinding_help_popup: false,
@@ -156,6 +158,8 @@ export const useLycheeStateStore = defineStore("lychee-store", {
156158
this.is_medium2x_download_enabled = data.is_medium2x_download_enabled;
157159
this.photo_previous_next_size = data.photo_previous_next_size;
158160
this.is_details_links_enabled = data.is_details_links_enabled;
161+
this.is_desktop_dock_full_transparency_enabled = data.is_desktop_dock_full_transparency_enabled;
162+
this.is_mobile_dock_full_transparency_enabled = data.is_mobile_dock_full_transparency_enabled;
159163

160164
this.is_registration_enabled = data.is_registration_enabled;
161165

0 commit comments

Comments
 (0)