From 6737bfd38a0568d61c691a507303a65550ae23fc Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Thu, 10 Sep 2020 18:44:05 +0200 Subject: viewer: information panel scrollbar and collapse with animation github: resolves #78 --- viewer/src/assets/scss/theme.scss | 4 ++++ viewer/src/assets/scss/transition.scss | 13 +++++++++++++ viewer/src/main.ts | 1 + viewer/src/plugins/buefy.ts | 3 --- viewer/src/views/MainLayout.vue | 2 +- viewer/src/views/PanelLeft.vue | 26 +++++++++++++++----------- 6 files changed, 34 insertions(+), 15 deletions(-) create mode 100644 viewer/src/assets/scss/transition.scss (limited to 'viewer/src') diff --git a/viewer/src/assets/scss/theme.scss b/viewer/src/assets/scss/theme.scss index 0c351e5..c59eba9 100644 --- a/viewer/src/assets/scss/theme.scss +++ b/viewer/src/assets/scss/theme.scss @@ -76,3 +76,7 @@ $proposed-category-bgcolor: $palette-700; $layout-top: 45px; $layout-left: 250px; + +// Transitions + +$transition-flex-expand: 0.1s; diff --git a/viewer/src/assets/scss/transition.scss b/viewer/src/assets/scss/transition.scss new file mode 100644 index 0000000..160f625 --- /dev/null +++ b/viewer/src/assets/scss/transition.scss @@ -0,0 +1,13 @@ +@import "~@/assets/scss/theme.scss"; + +// === Transitions for Vue + +.flex-expand-enter-active, .flex-expand-leave-active { + transition: max-height $transition-flex-expand linear; +} +.flex-expand-enter, .flex-expand-leave-to { + max-height: 0%; +} +.flex-expand-enter-to, .flex-expand-leave { + max-height: 100%; +} diff --git a/viewer/src/main.ts b/viewer/src/main.ts index 1c48c55..4d07835 100644 --- a/viewer/src/main.ts +++ b/viewer/src/main.ts @@ -20,6 +20,7 @@ import Vue from "vue"; import "@/assets/scss/global.scss"; import "@/assets/scss/scrollbar.scss"; +import "@/assets/scss/transition.scss"; import store from "@/store"; import i18n from "@/plugins/i18n"; import router from "@/plugins/router"; diff --git a/viewer/src/plugins/buefy.ts b/viewer/src/plugins/buefy.ts index 6cca8e7..7a71019 100644 --- a/viewer/src/plugins/buefy.ts +++ b/viewer/src/plugins/buefy.ts @@ -28,8 +28,6 @@ import Button from "buefy/src/components/button"; // @ts-ignore import SnackBar from "buefy/src/components/snackbar"; // @ts-ignore -import Collapse from "buefy/src/components/collapse"; -// @ts-ignore import Tag from "buefy/src/components/tag"; import "@/assets/scss/buefy.scss"; @@ -38,7 +36,6 @@ Vue.use(Taginput); Vue.use(Loading); Vue.use(Button); Vue.use(SnackBar); -Vue.use(Collapse); Vue.use(Tag); declare module "vue/types/vue" { diff --git a/viewer/src/views/MainLayout.vue b/viewer/src/views/MainLayout.vue index 2dd7a57..80778f6 100644 --- a/viewer/src/views/MainLayout.vue +++ b/viewer/src/views/MainLayout.vue @@ -106,7 +106,7 @@ html { } .layout { position: fixed; - transition: all 0.1s linear; + transition: all $transition-flex-expand linear; top: 0; bottom: 0; left: 0; diff --git a/viewer/src/views/PanelLeft.vue b/viewer/src/views/PanelLeft.vue index f8d6faf..12c95d1 100644 --- a/viewer/src/views/PanelLeft.vue +++ b/viewer/src/views/PanelLeft.vue @@ -18,7 +18,7 @@ --> @@ -92,11 +92,11 @@ export default class PanelLeft extends Vue { } - -- cgit v1.2.3