aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/views
diff options
context:
space:
mode:
Diffstat (limited to 'viewer/src/views')
-rw-r--r--viewer/src/views/GalleryDirectory.vue8
-rw-r--r--viewer/src/views/GalleryPicture.vue74
-rw-r--r--viewer/src/views/GallerySearch.vue7
-rw-r--r--viewer/src/views/GalleryThumbnail.vue76
-rw-r--r--viewer/src/views/MainGallery.vue10
-rw-r--r--viewer/src/views/MainLayout.vue7
-rw-r--r--viewer/src/views/PanelTop.vue55
7 files changed, 19 insertions, 218 deletions
diff --git a/viewer/src/views/GalleryDirectory.vue b/viewer/src/views/GalleryDirectory.vue
index d01032d..baf627e 100644
--- a/viewer/src/views/GalleryDirectory.vue
+++ b/viewer/src/views/GalleryDirectory.vue
@@ -21,7 +21,7 @@
21 <div class="thumbnail-tiles"> 21 <div class="thumbnail-tiles">
22 <div v-for="(item) in orderedItems" :key="item.path"> 22 <div v-for="(item) in orderedItems" :key="item.path">
23 <router-link :to="item.path"> 23 <router-link :to="item.path">
24 <gallery-thumbnail :item="item" /> 24 <ld-thumbnail :item="item" />
25 </router-link> 25 </router-link>
26 </div> 26 </div>
27 <div> 27 <div>
@@ -33,12 +33,8 @@
33<script lang="ts"> 33<script lang="ts">
34import { Component, Vue, Prop } from "vue-property-decorator"; 34import { Component, Vue, Prop } from "vue-property-decorator";
35import Tools from "@/tools"; 35import Tools from "@/tools";
36import GalleryThumbnail from "./GalleryThumbnail.vue";
37import Gallery from "./Gallery.vue";
38 36
39@Component({ 37@Component
40 components: { GalleryThumbnail },
41})
42export default class GalleryDirectory extends Vue { 38export default class GalleryDirectory extends Vue {
43 @Prop({ required: true }) readonly directory!: Gallery.Directory; 39 @Prop({ required: true }) readonly directory!: Gallery.Directory;
44 40
diff --git a/viewer/src/views/GalleryPicture.vue b/viewer/src/views/GalleryPicture.vue
deleted file mode 100644
index 323333a..0000000
--- a/viewer/src/views/GalleryPicture.vue
+++ /dev/null
@@ -1,74 +0,0 @@
1<!-- ldgallery - A static generator which turns a collection of tagged
2-- pictures into a searchable web gallery.
3--
4-- Copyright (C) 2019-2020 Guillaume FOUET
5--
6-- This program is free software: you can redistribute it and/or modify
7-- it under the terms of the GNU Affero General Public License as
8-- published by the Free Software Foundation, either version 3 of the
9-- License, or (at your option) any later version.
10--
11-- This program is distributed in the hope that it will be useful,
12-- but WITHOUT ANY WARRANTY; without even the implied warranty of
13-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14-- GNU Affero General Public License for more details.
15--
16-- You should have received a copy of the GNU Affero General Public License
17-- along with this program. If not, see <https://www.gnu.org/licenses/>.
18-->
19
20<template>
21 <div
22 v-dragscroll
23 class="scrollbar"
24 :class="{fitToScreen: !$uiStore.fullscreen, originalSize: $uiStore.fullscreen}"
25 @click="onClick"
26 @dragscrollstart="dragging=true"
27 >
28 <v-lazy-image :src="pictureSrc" />
29 </div>
30</template>
31
32<script lang="ts">
33import { Component, Vue, Prop } from "vue-property-decorator";
34
35@Component
36export default class GalleryPicture extends Vue {
37 @Prop({ required: true }) readonly picture!: Gallery.Picture;
38
39 dragging: boolean = false;
40
41 get pictureSrc() {
42 return `${process.env.VUE_APP_DATA_URL}${this.picture.properties.resource}`;
43 }
44
45 onClick() {
46 if (!this.dragging) this.$uiStore.toggleFullscreen();
47 this.dragging = false;
48 }
49}
50</script>
51
52<style lang="scss">
53.fitToScreen {
54 display: flex;
55 justify-content: space-around;
56 height: 100%;
57 & > img {
58 object-fit: contain;
59 cursor: zoom-in;
60 }
61}
62.originalSize {
63 display: block;
64 text-align: center;
65 cursor: grab;
66 height: 100%;
67 & > img {
68 max-width: unset;
69 max-height: unset;
70 object-fit: none;
71 cursor: zoom-out;
72 }
73}
74</style>
diff --git a/viewer/src/views/GallerySearch.vue b/viewer/src/views/GallerySearch.vue
index 870d3e2..4e843b9 100644
--- a/viewer/src/views/GallerySearch.vue
+++ b/viewer/src/views/GallerySearch.vue
@@ -21,7 +21,7 @@
21 <div class="thumbnail-tiles"> 21 <div class="thumbnail-tiles">
22 <div v-for="(item) in items" :key="item.path"> 22 <div v-for="(item) in items" :key="item.path">
23 <router-link :to="item.path" @click.native="$uiStore.setModeNavigation()"> 23 <router-link :to="item.path" @click.native="$uiStore.setModeNavigation()">
24 <gallery-thumbnail :item="item" /> 24 <ld-thumbnail :item="item" />
25 </router-link> 25 </router-link>
26 </div> 26 </div>
27 <div v-if="items.length===0">{{$t('search.no-results')}}</div> 27 <div v-if="items.length===0">{{$t('search.no-results')}}</div>
@@ -33,11 +33,8 @@
33 33
34<script lang="ts"> 34<script lang="ts">
35import { Component, Vue, Prop } from "vue-property-decorator"; 35import { Component, Vue, Prop } from "vue-property-decorator";
36import GalleryThumbnail from "./GalleryThumbnail.vue";
37 36
38@Component({ 37@Component
39 components: { GalleryThumbnail },
40})
41export default class GalleryPicture extends Vue { 38export default class GalleryPicture extends Vue {
42 @Prop({ required: true }) readonly items!: Gallery.Item[]; 39 @Prop({ required: true }) readonly items!: Gallery.Item[];
43} 40}
diff --git a/viewer/src/views/GalleryThumbnail.vue b/viewer/src/views/GalleryThumbnail.vue
deleted file mode 100644
index 41a59e1..0000000
--- a/viewer/src/views/GalleryThumbnail.vue
+++ /dev/null
@@ -1,76 +0,0 @@
1<!-- ldgallery - A static generator which turns a collection of tagged
2-- pictures into a searchable web gallery.
3--
4-- Copyright (C) 2019-2020 Guillaume FOUET
5--
6-- This program is free software: you can redistribute it and/or modify
7-- it under the terms of the GNU Affero General Public License as
8-- published by the Free Software Foundation, either version 3 of the
9-- License, or (at your option) any later version.
10--
11-- This program is distributed in the hope that it will be useful,
12-- but WITHOUT ANY WARRANTY; without even the implied warranty of
13-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14-- GNU Affero General Public License for more details.
15--
16-- You should have received a copy of the GNU Affero General Public License
17-- along with this program. If not, see <https://www.gnu.org/licenses/>.
18-->
19
20<template>
21 <div class="forcedsize" :class="{preload: loading}">
22 <v-lazy-image
23 v-if="item.thumbnail"
24 class="thumbnail"
25 :src="pictureSrc"
26 :title="item.path"
27 @intersect="loading=true"
28 @load="loading=false"
29 />
30 <div v-else class="flex-column flex-center">
31 <fa-icon icon="folder" size="4x" />
32 {{item.title}}
33 </div>
34 </div>
35</template>
36
37<script lang="ts">
38import { Component, Vue, Prop } from "vue-property-decorator";
39
40@Component
41export default class GalleryThumbnail extends Vue {
42 @Prop({ required: true }) readonly item!: Gallery.Item;
43
44 loading: boolean = false;
45
46 get pictureSrc() {
47 return `${process.env.VUE_APP_DATA_URL}${this.item.thumbnail}`;
48 }
49}
50</script>
51
52<style lang="scss">
53@import "@/assets/scss/theme.scss";
54
55.thumbnail {
56 max-width: 250px;
57 max-height: 250px;
58}
59.preload {
60 animation: preloadAnimation 1s infinite ease-in-out alternate;
61}
62@keyframes preloadAnimation {
63 from {
64 background-color: $content-bgcolor;
65 }
66 to {
67 background-color: $loader-color;
68 }
69}
70// Temporary size until we get the true thumbnail size
71.forcedsize {
72 width: 250px;
73 height: 250px;
74 text-align: center;
75}
76</style>
diff --git a/viewer/src/views/MainGallery.vue b/viewer/src/views/MainGallery.vue
index 06cf512..5767cce 100644
--- a/viewer/src/views/MainGallery.vue
+++ b/viewer/src/views/MainGallery.vue
@@ -21,21 +21,23 @@
21 <div> 21 <div>
22 <gallery-search v-if="$uiStore.isModeSearch" :items="currentSearch" /> 22 <gallery-search v-if="$uiStore.isModeSearch" :items="currentSearch" />
23 <gallery-directory v-else-if="checkType('directory')" :directory="$galleryStore.currentItem" /> 23 <gallery-directory v-else-if="checkType('directory')" :directory="$galleryStore.currentItem" />
24 <gallery-picture v-else-if="checkType('picture')" :picture="$galleryStore.currentItem" /> 24 <ld-picture v-else-if="checkType('picture')" :picture="$galleryStore.currentItem" />
25 <div v-else>{{$t("gallery.unknowntype")}}</div> 25 <div v-else>{{$t("gallery.unknowntype")}}</div>
26 </div> 26 </div>
27</template> 27</template>
28 28