aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'viewer/src/components')
-rw-r--r--viewer/src/components/LdBreadcrumb.vue127
-rw-r--r--viewer/src/components/LdCommand.vue96
-rw-r--r--viewer/src/components/LdCommandSearch.vue (renamed from viewer/src/components/LdModeRadio.vue)35
-rw-r--r--viewer/src/components/LdGallery.vue57
-rw-r--r--viewer/src/components/LdKeyPress.vue49
-rw-r--r--viewer/src/components/LdPicture.vue121
-rw-r--r--viewer/src/components/LdProposition.vue114
-rw-r--r--viewer/src/components/LdTagInput.vue94
-rw-r--r--viewer/src/components/LdThumbnail.vue90
-rw-r--r--viewer/src/components/LdTitle.vue (renamed from viewer/src/components/LdButtonFullscreen.vue)42
-rw-r--r--viewer/src/components/index.ts32
11 files changed, 718 insertions, 139 deletions
diff --git a/viewer/src/components/LdBreadcrumb.vue b/viewer/src/components/LdBreadcrumb.vue
new file mode 100644
index 0000000..a8d8dcb
--- /dev/null
+++ b/viewer/src/components/LdBreadcrumb.vue
@@ -0,0 +1,127 @@
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 ref="breadcrumb"
23 v-dragscroll
24 class="ld-breadcrumb flex scrollbar"
25 @click.capture="e => dragScrollClickFix.onClickCapture(e)"
26 @dragscrollstart="dragScrollClickFix.onDragScrollStart()"
27 @dragscrollend="dragScrollClickFix.onDragScrollEnd()"
28 @dragscrollmove="checkForOverflowMask"
29 >
30 <div v-show="overflowMask" class="ld-breadcrumb-overflow-mask"></div>
31 <ul class="ld-breadcrumb">
32 <li v-for="(item,idx) in currentItemPath" :key="item.path">
33 <fa-icon v-if="idx > 0" icon="angle-right" class="disabled" />
34 <router-link :to="item.path" class="link">
35 <fa-icon :icon="getIcon(item)" size="lg" />
36 {{item.title}}
37 </router-link>
38 </li>
39 <li v-if="searchMode">
40 <fa-icon icon="angle-right" class="disabled" />
41 <router-link :to="$route" class="link">
42 <fa-icon icon="search" size="lg" class="disabled" />
43 </router-link>
44 </li>
45 </ul>
46 </div>
47</template>
48
49<script lang="ts">
50import { Component, Vue, Ref, Watch, Prop } from "vue-property-decorator";
51import DragScrollClickFix from "@/services/dragscrollclickfix";
52import Navigation from "@/services/navigation";
53
54@Component
55export default class LdBreadcrumb extends Vue {
56 @Prop({ type: Array, required: true }) readonly currentItemPath!: Gallery.Item[];
57 @Prop(Boolean) readonly searchMode!: boolean;
58 @Ref() readonly breadcrumb!: HTMLUListElement;
59
60 readonly dragScrollClickFix = new DragScrollClickFix();
61
62 dragging: boolean = false;
63 overflowMask: boolean = false;
64
65 mounted() {
66 window.addEventListener("resize", this.checkForOverflowMask);
67 }
68
69 destroyed() {
70 window.removeEventListener("resize", this.checkForOverflowMask);
71 }
72
73 checkForOverflowMask() {
74 this.overflowMask = this.breadcrumb.scrollLeft > 1;
75 }
76
77 @Watch("currentItemPath")
78 changedCurrentItemPath() {
79 this.$nextTick(() => {
80 this.breadcrumb.scrollLeft = this.breadcrumb.scrollWidth;
81 this.checkForOverflowMask();
82 });
83 }
84
85 getIcon(item: Gallery.Item) {
86 return Navigation.getIcon(item);
87 }
88}
89</script>
90
91<style lang="scss">
92@import "~@/assets/scss/theme.scss";
93
94.ld-breadcrumb-overflow-mask {
95 position: absolute;
96 width: 100%;
97 height: 100%;
98 background: linear-gradient(
99 to right,
100 rgba($panel-top-bgcolor, 1) $breadcrumb-margins,
101 rgba($panel-top-bgcolor, 0) $breadcrumb-overflow-mask-size
102 );
103 pointer-events: none;
104}
105
106.ld-breadcrumb {
107 ul {
108 display: flex;
109 white-space: nowrap;
110 }
111 a {
112 padding: $breadcrumb-margins 0;
113 margin-left: $breadcrumb-margins;
114 }
115 li {
116 align-self: center;
117 margin-right: $breadcrumb-margins;
118 }
119 &.scrollbar {
120 overflow-y: hidden;
121 scrollbar-width: none;
122 &::-webkit-scrollbar {
123 height: 0;
124 }
125 }
126}
127</style>
diff --git a/viewer/src/components/LdCommand.vue b/viewer/src/components/LdCommand.vue
new file mode 100644
index 0000000..d961519
--- /dev/null
+++ b/viewer/src/components/LdCommand.vue
@@ -0,0 +1,96 @@
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-- 2020 Pacien TRAN-GIRARD
6--
7-- This program is free software: you can redistribute it and/or modify
8-- it under the terms of the GNU Affero General Public License as
9-- published by the Free Software Foundation, either version 3 of the
10-- License, or (at your option) any later version.
11--
12-- This program is distributed in the hope that it will be useful,
13-- but WITHOUT ANY WARRANTY; without even the implied warranty of
14-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15-- GNU Affero General Public License for more details.
16--
17-- You should have received a copy of the GNU Affero General Public License
18-- along with this program. If not, see <https://www.gnu.org/licenses/>.
19-->
20
21<template>
22 <div class="flex command-btns">
23 <a class="link" :title="$t('command.search')" @click="$uiStore.toggleFullWidth()">
24 <fa-icon :icon="commandToggleSearchPanelIcon()" size="lg" />
25 </a>
26 <a
27 :class="{'disabled': isEntryPoint()}"
28 class="link command-secondary"
29 :title="$t('command.back')"
30 @click="isEntryPoint() || $router.back()"
31 >
32 <fa-icon icon="arrow-left" size="lg" />
33 </a>
34 <router-link :class="{'disabled': isRoot()}" :title="$t('command.parent')" :to="parent()">
35 <fa-icon icon="folder" size="xs" />
36 <fa-icon icon="level-up-alt" size="lg" />
37 </router-link>
38 </div>
39</template>
40
41<script lang="ts">
42import { Component, Vue, Prop } from "vue-property-decorator";
43import { RawLocation } from "vue-router";
44
45@Component
46export default class LdCommand extends Vue {
47 @Prop({ type: Array, required: true }) readonly currentItemPath!: Gallery.Item[];
48
49 commandToggleSearchPanelIcon(): string {
50 return this.$uiStore.fullWidth ? "search" : "angle-double-left";
51 }
52
53 isRoot(): boolean {
54 return this.currentItemPath.length <= 1 && !this.$uiStore.searchMode;
55 }
56
57 isEntryPoint(): boolean {
58 return history.state?.ldgallery === "ENTRYPOINT"; // Set by MainLayout.vue
59 }
60
61 parent(): RawLocation {
62 if (this.$uiStore.searchMode) return this.$route.path;
63 if (this.currentItemPath.length > 1) return this.currentItemPath[this.currentItemPath.length - 2];
64 return "";
65 }
66}
67</script>
68
69<style lang="scss">
70@import "~@/assets/scss/_buefy_variables.scss";
71@import "~@/assets/scss/theme.scss";
72
73.command-btns {
74 background-color: $command-buttons-bgcolor;
75 justify-content: space-around;
76 vertical-align: middle;
77 align-items: center;
78 flex: 0 0 $layout-left;
79
80 > a {
81 // normalise icon active boxes
82 width: $layout-top;
83 line-height: $layout-top;
84 text-align: center;
85 vertical-align: middle;
86 }
87
88 @media only screen and (max-width: $tablet) {
89 flex: 0 1;
90