From 252dd6fc6f53ecd8b28e05a0514429472d53d08e Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Fri, 31 Jan 2020 06:46:31 +0100 Subject: viewer: finalized the command buttons. added the 'up to parent' command --- viewer/src/locales/en.json | 6 +++- viewer/src/plugins/fontawesome.ts | 6 ++-- viewer/src/store/uiStore.ts | 5 +++ viewer/src/views/MainLayout.vue | 7 ++-- viewer/src/views/PanelTop.vue | 64 +++++++---------------------------- viewer/src/views/TopBreadcrumb.vue | 63 +++++++++++++++++++++++++++++++++++ viewer/src/views/TopCommand.vue | 68 ++++++++++++++++++++++++++++++++++++++ 7 files changed, 162 insertions(+), 57 deletions(-) create mode 100644 viewer/src/views/TopBreadcrumb.vue create mode 100644 viewer/src/views/TopCommand.vue (limited to 'viewer/src') diff --git a/viewer/src/locales/en.json b/viewer/src/locales/en.json index d44a116..987d4d1 100644 --- a/viewer/src/locales/en.json +++ b/viewer/src/locales/en.json @@ -7,5 +7,9 @@ "mode.search": "Search", "search.no-results": "No results", "panelLeft.propositions": "Proposed tags", - "gallery.unknowntype": "Unknown item type" + "gallery.unknowntype": "Unknown item type", + "title.tags": "Tags", + "title.home": "Home", + "title.back": "Back", + "title.parent": "Parent" } \ No newline at end of file diff --git a/viewer/src/plugins/fontawesome.ts b/viewer/src/plugins/fontawesome.ts index bf2ff5f..fdbfcdb 100644 --- a/viewer/src/plugins/fontawesome.ts +++ b/viewer/src/plugins/fontawesome.ts @@ -24,27 +24,29 @@ import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; import { faFolder, faSearch, - faTag, faPlus, faMinus, faImage, faHome, faArrowLeft, + faLevelUpAlt, faTags, faAngleRight, + faWindowClose, } from "@fortawesome/free-solid-svg-icons"; library.add( faFolder, faSearch, - faTag, faPlus, faMinus, faImage, faHome, faArrowLeft, + faLevelUpAlt, faTags, faAngleRight, + faWindowClose, ); Vue.component("fa-icon", FontAwesomeIcon); diff --git a/viewer/src/store/uiStore.ts b/viewer/src/store/uiStore.ts index 6bcc538..f7484de 100644 --- a/viewer/src/store/uiStore.ts +++ b/viewer/src/store/uiStore.ts @@ -27,6 +27,7 @@ const VuexModule = createModule({ export default class UIStore extends VuexModule { fullscreen: boolean = false; + fullWidth: boolean = true; mode: "navigation" | "search" = "navigation"; currentTags: Tag.Search[] = []; @@ -46,6 +47,10 @@ export default class UIStore extends VuexModule { this.fullscreen = !this.fullscreen; } + @mutation toggleFullWidth() { + this.fullWidth = !this.fullWidth; + } + @mutation setModeNavigation() { this.mode = "navigation"; } diff --git a/viewer/src/views/MainLayout.vue b/viewer/src/views/MainLayout.vue index f0809b6..c202def 100644 --- a/viewer/src/views/MainLayout.vue +++ b/viewer/src/views/MainLayout.vue @@ -18,7 +18,7 @@ --> diff --git a/viewer/src/views/TopBreadcrumb.vue b/viewer/src/views/TopBreadcrumb.vue deleted file mode 100644 index 9104b80..0000000 --- a/viewer/src/views/TopBreadcrumb.vue +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - diff --git a/viewer/src/views/TopCommand.vue b/viewer/src/views/TopCommand.vue deleted file mode 100644 index dc79fa7..0000000 --- a/viewer/src/views/TopCommand.vue +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - -- cgit v1.2.3 From b049f1abd6d00b76afae76d6dc212be213b26c68 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Fri, 31 Jan 2020 10:48:21 +0100 Subject: viewer: buefy optimization (importing only used components) --- viewer/src/plugins/buefy.ts | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'viewer/src') diff --git a/viewer/src/plugins/buefy.ts b/viewer/src/plugins/buefy.ts index 9fa73b6..fbffd55 100644 --- a/viewer/src/plugins/buefy.ts +++ b/viewer/src/plugins/buefy.ts @@ -19,10 +19,24 @@ import Vue from "vue"; -import Buefy from "buefy"; +// @ts-ignore +import Taginput from 'buefy/src/components/taginput'; +// @ts-ignore +import Loading from 'buefy/src/components/loading'; +// @ts-ignore +import Radio from 'buefy/src/components/radio'; +// @ts-ignore +import SnackBar from 'buefy/src/components/snackbar'; + import "@/assets/scss/buefy.scss"; -Vue.use(Buefy, { - defaultIconComponent: 'fa-icon', - defaultIconPack: 'fas', -}); +Vue.use(Taginput); +Vue.use(Loading); +Vue.use(Radio); +Vue.use(SnackBar); + +declare module 'vue/types/vue' { + interface Vue { + $buefy: any; + } +} \ No newline at end of file -- cgit v1.2.3 From 9ea63a39883c63bdc0200e66caed6fa82f83bf7e Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Fri, 31 Jan 2020 10:48:32 +0100 Subject: viewer: loader background color --- viewer/src/assets/scss/theme.scss | 3 +++ 1 file changed, 3 insertions(+) (limited to 'viewer/src') diff --git a/viewer/src/assets/scss/theme.scss b/viewer/src/assets/scss/theme.scss index d3aac99..1b474e8 100644 --- a/viewer/src/assets/scss/theme.scss +++ b/viewer/src/assets/scss/theme.scss @@ -29,8 +29,11 @@ $panel-left-txtcolor: $panel-top-txtcolor; $content-bgcolor: #1e1e1e; $toolbar-color: #d62929; $loader-color: #272727; + +// Overrides - Buefy $link: $panel-top-txtcolor; $link-hover: lightblue; $disabled-color: rgba($link, 0.3); $control-radius: 0; $input-radius: 0; +$loading-background: $panel-top-bgcolor; -- cgit v1.2.3 From 2d48a8f15970d7af8092e9450057a05b4d3f9333 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Fri, 31 Jan 2020 13:22:52 +0100 Subject: viewer: when loading a picture, displays a preview based on the thumbnail on slow connections This works on Chrome, but FireFox presents some issues: - the picture background is sometimes white instead of transparent, hidding the background - image-orientation doesn't work for background pictures or for negative values --- viewer/src/assets/scss/global.scss | 14 ++++++----- viewer/src/components/LdPicture.vue | 49 +++++++++++++++++++++++++++++++++++-- 2 files changed, 55 insertions(+), 8 deletions(-) (limited to 'viewer/src') diff --git a/viewer/src/assets/scss/global.scss b/viewer/src/assets/scss/global.scss index b418911..5de5946 100644 --- a/viewer/src/assets/scss/global.scss +++ b/viewer/src/assets/scss/global.scss @@ -96,10 +96,12 @@ img { // === Effect to apply on lazy-image loading -.v-lazy-image { - opacity: 0; - transition: opacity 0.4s; -} -.v-lazy-image-loaded { - opacity: 1; +img { + &.v-lazy-image { + opacity: 0; + transition: opacity 0.4s; + } + &.v-lazy-image-loaded { + opacity: 1; + } } diff --git a/viewer/src/components/LdPicture.vue b/viewer/src/components/LdPicture.vue index b6a719f..5425a00 100644 --- a/viewer/src/components/LdPicture.vue +++ b/viewer/src/components/LdPicture.vue @@ -25,7 +25,13 @@ @click="onClick" @dragscrollstart="dragging=true" > - + + @@ -36,12 +42,35 @@ import { Component, Vue, Prop } from "vue-property-decorator"; export default class LdPicture extends Vue { @Prop({ required: true }) readonly picture!: Gallery.Picture; + readonly SLOW_LOADING_TIMEOUT_MS: number = 1500; + dragging: boolean = false; + slowLoadingStyle: string | null = null; + timer: NodeJS.Timeout | null = null; + + mounted() { + if (this.picture.thumbnail) this.timer = setTimeout(this.generateSlowLoadingStyle, this.SLOW_LOADING_TIMEOUT_MS); + } + + destroyed() { + this.clearTimer(); + } + + clearTimer() { + if (this.timer) clearTimeout(this.timer); + this.timer = null; + this.slowLoadingStyle = null; + } - get pictureSrc() { + pictureSrc() { return `${process.env.VUE_APP_DATA_URL}${this.picture.properties.resource}`; } + generateSlowLoadingStyle() { + this.clearTimer(); + this.slowLoadingStyle = `background-image: url('${process.env.VUE_APP_DATA_URL}${this.picture.thumbnail}');`; + } + onClick() { if (!this.dragging) this.$uiStore.toggleFullscreen(); this.dragging = false; @@ -50,6 +79,22 @@ export default class LdPicture extends Vue { -- cgit v1.2.3 From be8ec3edaed843f08dac3d2bf2f10f7247ef3d3a Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Fri, 31 Jan 2020 15:06:44 +0100 Subject: viewer: fixed a CSP issue with inlined SVG CSS; FontAwesome CSS is now external --- viewer/src/plugins/fontawesome.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'viewer/src') diff --git a/viewer/src/plugins/fontawesome.ts b/viewer/src/plugins/fontawesome.ts index 460e407..a15f4ce 100644 --- a/viewer/src/plugins/fontawesome.ts +++ b/viewer/src/plugins/fontawesome.ts @@ -19,7 +19,7 @@ import Vue from "vue"; -import { library } from "@fortawesome/fontawesome-svg-core"; +import { library, config } from "@fortawesome/fontawesome-svg-core"; import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; import { faFolder, @@ -51,4 +51,7 @@ library.add( faQuestionCircle, ); +config.autoAddCss = false; +import "@fortawesome/fontawesome-svg-core/styles.css"; + Vue.component("fa-icon", FontAwesomeIcon); -- cgit v1.2.3