From 473c89fee5a770608065e0e6c2dc1ce7f31636d8 Mon Sep 17 00:00:00 2001 From: profi248 Date: Sat, 2 Jan 2021 15:10:42 +0100 Subject: [PATCH] transitions via Vue transitions + CSS variable --- src/styles/components/task.scss | 4 +- src/styles/theme/variables.scss | 1 + src/views/tasks/TaskDetailView.vue | 256 +++++++++++++++-------------- 3 files changed, 134 insertions(+), 127 deletions(-) diff --git a/src/styles/components/task.scss b/src/styles/components/task.scss index 628bb036e..eb22e00ff 100644 --- a/src/styles/components/task.scss +++ b/src/styles/components/task.scss @@ -255,8 +255,8 @@ background-color: transparent; } -.flash-background { - animation: flash-background 0.75s ease 1; +.flash-background-enter, .flash-background-enter-active { + animation: flash-background $flash-background-duration ease 1; } @keyframes flash-background { diff --git a/src/styles/theme/variables.scss b/src/styles/theme/variables.scss index b9dcf591d..efdc4df15 100644 --- a/src/styles/theme/variables.scss +++ b/src/styles/theme/variables.scss @@ -17,6 +17,7 @@ $navbar-dropdown-boxed-shadow: $dropdown-content-shadow; $bulmaswatch-import-font: false !default; $light-background: #F1F5F8; $transition-duration: 100ms; +$flash-background-duration: 750ms; $transparent-background-light: rgba($light-background, 0.9); $vikunja-font: 'Quicksand', sans-serif; diff --git a/src/views/tasks/TaskDetailView.vue b/src/views/tasks/TaskDetailView.vue index 528dd7fae..70eb47b8a 100644 --- a/src/views/tasks/TaskDetailView.vue +++ b/src/views/tasks/TaskDetailView.vue @@ -28,129 +28,145 @@ v-model="task.assignees" /> -
- -
- - Priority + +
+ +
+ + Priority +
+
- -
-
- -
- - Due Date + + +
+ +
+ + Due Date +
+
+ + + + + + +
-
- + +
+ +
+ + Percent Done +
+ +
+
+ +
+ +
+ + Start Date +
+
-
-
- -
- - Percent Done + + +
+ +
+ + End Date +
+
+ + + + + + +
- -
-
- -
- - Start Date + + +
+ +
+ + Reminders +
+
-
- - - - - - + + +
+ +
+ + Repeat +
+
-
-
- -
- - End Date + + +
+ +
+ + Color +
+
-
- - - - - - -
-
-
- -
- - Reminders -
- -
-
- -
- - Repeat -
- -
-
- -
- - Color -
- -
+
@@ -548,16 +564,6 @@ export default { if (this.$refs[fieldName]) { this.$refs[fieldName].$el.focus(); - // animate background flash with CSS animations (if the field's parent has a ref) - if (typeof this.$refs[fieldName + "Parent"] !== 'undefined') - this.$refs[fieldName + "Parent"].classList.add('flash-background'); - - // remove animation class after animation finishes - setTimeout(() => { - if (typeof this.$refs[fieldName + "Parent"] !== 'undefined') - this.$refs[fieldName + "Parent"].classList.remove('flash-background'); - }, 750); - // scroll the field to the center of the screen if not in viewport already const boundingRect = this.$refs[fieldName].$el.getBoundingClientRect();