@christianriedl/media 1.0.69 → 1.0.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/views/PhotoAlbumPage.vue +21 -5
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { inject, ref, reactive, computed, onMounted, onBeforeMount, onUnmounted, nextTick, watch } from 'vue';
|
|
3
3
|
import type { ComponentPublicInstance } from 'vue';
|
|
4
4
|
import { useRouter, useRoute } from 'vue-router';
|
|
5
|
-
import { IAppState, IAppConfig, EDevice,
|
|
5
|
+
import { IAppState, IAppConfig, EDevice, EDirection, Dictionary, Helper, appStateSymbol, appConfigSymbol } from '@christianriedl/utils';
|
|
6
6
|
import { EMediaType, IPictureFile, MediaService, IMediaAppConfig, EPictureQuality, getMediaSymbol } from '@christianriedl/media';
|
|
7
7
|
|
|
8
8
|
const router = useRouter();
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
|
|
43
43
|
async function start(): Promise<boolean> {
|
|
44
44
|
window.document.addEventListener('keydown', onKey);
|
|
45
|
+
appState.navigate.value = onNavigate;
|
|
45
46
|
if (carousel.value)
|
|
46
47
|
appState.fullScreenElement.value = carousel.value.$el as HTMLElement;
|
|
47
48
|
let folder = mediaService.folders[folderId];
|
|
@@ -79,7 +80,14 @@
|
|
|
79
80
|
onUnmounted(() => {
|
|
80
81
|
appState.fullScreenElement.value = null;
|
|
81
82
|
window.document.removeEventListener('keydown', onKey);
|
|
83
|
+
appState.navigate.value = onNavigate;
|
|
82
84
|
});
|
|
85
|
+
function onNavigate(direction: EDirection): void {
|
|
86
|
+
if (direction === EDirection.Left)
|
|
87
|
+
onKeyClick("ArrowLeft")
|
|
88
|
+
if (direction === EDirection.Right)
|
|
89
|
+
onKeyClick("ArrowRight")
|
|
90
|
+
}
|
|
83
91
|
|
|
84
92
|
function getQuality(pictureQuality: EPictureQuality) {
|
|
85
93
|
return pictureQuality % 1000;
|
|
@@ -95,10 +103,18 @@
|
|
|
95
103
|
const pictureQuality = mediaAppConfig.pictureQuality;
|
|
96
104
|
const quality = getQuality(pictureQuality);
|
|
97
105
|
const factor = getFactor(pictureQuality);
|
|
98
|
-
if (landscape.value)
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
106
|
+
if (landscape.value) {
|
|
107
|
+
let h = height.value * factor;
|
|
108
|
+
if (item.Height <= h)
|
|
109
|
+
h = 0;
|
|
110
|
+
return mediaService.getPhotoUrl(url.value, item.Url, `${0}x${h}x${item.Orientation}x${quality}`);
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
let w = width.value * factor;
|
|
114
|
+
if (item.Width <= w)
|
|
115
|
+
w = 0;
|
|
116
|
+
return mediaService.getPhotoUrl(url.value, item.Url, `${w}x${0}x${item.Orientation}x${quality}`);
|
|
117
|
+
}
|
|
102
118
|
}
|
|
103
119
|
function getHeight(item: IPictureFile) {
|
|
104
120
|
const pictureQuality = mediaAppConfig.pictureQuality;
|