diff options
author | Zéro~Informatique | 2022-07-26 08:44:34 +0200 |
---|---|---|
committer | pacien | 2022-09-03 01:30:42 +0200 |
commit | 00510820a2794efcadbc83f7f8b54318fe198ecb (patch) | |
tree | a894d99c22a601197869c7a6928d40bb4ae2c392 /viewer/src/components/LdThumbnail.vue | |
parent | 88aa098c07e067f9f737fbeba1f52a9bd5042e53 (diff) | |
download | ldgallery-00510820a2794efcadbc83f7f8b54318fe198ecb.tar.gz |
viewer: migrate to vue 3, general refactoring and cleanup
Non-exhaustive list of fixes and improvements done at the same time:
- html default background to grey (avoids white flash during init)
- unified links behavior
- added more theme variables
- removed the flex-expand transition (it wasn't working) and replaced it
with a slide
- fixed LdLoading not centered on the content
- title on removable tags
- fixed an issue with encoded URI from vue-router
- unified Item resource URLs
- removed the iframe for PlainTextViewer (it wasn't working properly)
and replaced it with a pre
- fixed clear and search buttons tabindex
- fixed the information panel bumping up during the fade animation of
tag's dropdown
- fixed some focus outlines not appearing correctly
- moved CSS variables to the :root context
- Code cleaning
GitHub: closes #217
GitHub: closes #300
GitHub: closes #297
GitHub: closes #105
GitHub: closes #267
GitHub: closes #275
GitHub: closes #228
GitHub: closes #215
GitHub: closes #112
Diffstat (limited to 'viewer/src/components/LdThumbnail.vue')
-rw-r--r-- | viewer/src/components/LdThumbnail.vue | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/viewer/src/components/LdThumbnail.vue b/viewer/src/components/LdThumbnail.vue deleted file mode 100644 index 4623b44..0000000 --- a/viewer/src/components/LdThumbnail.vue +++ /dev/null | |||
@@ -1,91 +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="{ [$style.preload]: loading }"> | ||
22 | <v-lazy-image | ||
23 | v-if="item.thumbnail" | ||
24 | :src="pictureSrc(item.thumbnail.resource)" | ||
25 | :style="pictureStyle" | ||
26 | :title="item.title" | ||
27 | @intersect="loading = true" | ||
28 | @load="loading = false" | ||
29 | /> | ||
30 | <div v-else class="flex-column flex-center" :class="$style.thumbnailOther"> | ||
31 | <div> | ||
32 | <fa-icon :icon="icon" size="4x" /> | ||
33 | </div> | ||
34 | {{ item.title }} | ||
35 | </div> | ||
36 | </div> | ||
37 | </template> | ||
38 | |||
39 | <script lang="ts"> | ||
40 | import { Item } from "@/@types/gallery"; | ||
41 | import Navigation from "@/services/navigation"; | ||
42 | import { Component, Prop, Vue } from "vue-property-decorator"; | ||
43 | |||
44 | @Component | ||
45 | export default class LdThumbnail extends Vue { | ||
46 | @Prop({ required: true }) readonly item!: Item; | ||
47 | |||
48 | loading: boolean = false; | ||
49 | |||
50 | pictureSrc(resource: string) { | ||
51 | return this.$galleryStore.resourceRoot + resource; | ||
52 | } | ||
53 | |||
54 | get pictureStyle() { | ||
55 | const resolution = this.item.thumbnail!.resolution; | ||
56 | return { width: `${resolution.width}px`, height: `${resolution.height}px` }; | ||
57 | } | ||
58 | |||
59 | get icon() { | ||
60 | return Navigation.getIcon(this.item); | ||
61 | } | ||
62 | } | ||
63 | </script> | ||
64 | |||
65 | <style lang="scss" module> | ||
66 | @import "~@/assets/scss/theme.scss"; | ||
67 | |||
68 | .thumbnailOther { | ||
69 | width: $thumbnail-other-size; | ||
70 | height: $thumbnail-other-size; | ||
71 | padding-top: $body-line-height * 1em; | ||
72 | text-align: center; | ||
73 | word-break: break-word; | ||
74 | overflow: hidden; | ||
75 | > div { | ||
76 | min-height: $body-line-height * 3em; | ||
77 | } | ||
78 | } | ||
79 | |||
80 | .preload { | ||
81 | animation: preloadAnimation 1s infinite ease-in-out alternate; | ||
82 | } | ||
83 | @keyframes preloadAnimation { | ||
84 | from { | ||
85 | background-color: $content-bgcolor; | ||
86 | } | ||
87 | to { | ||
88 | background-color: $loader-color; | ||
89 | } | ||
90 | } | ||
91 | </style> | ||