From 51c4618d9c6283f43c90587628906968603f417b Mon Sep 17 00:00:00 2001 From: Guz <43732358+Guz013@users.noreply.github.com> Date: Sun, 30 Jan 2022 17:50:27 -0300 Subject: [PATCH] fix(animations): animations played before necessary / on page load, files location; Fixed animation being played right after pages load, created `.preventAnimLoad` (used on a parent element that's being loaded), and `.preventAnim` classes (used on the element with the animation to be prevented) to this; Moved `TaskList.vue` and `TaskComp.vue` to Task (`components/Task`) for better organization. --- src/assets/styles/_variables.scss | 3 + src/assets/styles/global.scss | 4 + src/components/Task/TaskComp.vue | 346 +++++++++++++++++++++++++ src/components/{ => Task}/TaskList.vue | 4 +- src/components/TaskComp.vue | 298 --------------------- src/pages/index.vue | 14 +- 6 files changed, 368 insertions(+), 301 deletions(-) create mode 100644 src/components/Task/TaskComp.vue rename src/components/{ => Task}/TaskList.vue (93%) delete mode 100644 src/components/TaskComp.vue diff --git a/src/assets/styles/_variables.scss b/src/assets/styles/_variables.scss index b538f21..761e3ad 100644 --- a/src/assets/styles/_variables.scss +++ b/src/assets/styles/_variables.scss @@ -11,3 +11,6 @@ $dark-secondary: $eerie-black3; $main-font: 'Red Display', arial, helvetica, sans-serif; $secondary-font: 'Fira Code', monospace, sans-serif; + +$checked-color: $green0; +$unchecked-color: $begonia-red0; diff --git a/src/assets/styles/global.scss b/src/assets/styles/global.scss index 2e87fd5..f4e472b 100644 --- a/src/assets/styles/global.scss +++ b/src/assets/styles/global.scss @@ -34,6 +34,10 @@ body { } } +.preventAnimLoad * .preventAnim { + animation-duration: 0s !important; +} + /* ? Workaround with changing elements depending on the page's theme, ? probably there is a better way, using `v-if` and `v-else`, but apparently, diff --git a/src/components/Task/TaskComp.vue b/src/components/Task/TaskComp.vue new file mode 100644 index 0000000..fd7c6ae --- /dev/null +++ b/src/components/Task/TaskComp.vue @@ -0,0 +1,346 @@ + + + + + + + + + + + + + + {{ title }} + {{ description }} + + + + + + + + + + + + + + + diff --git a/src/components/TaskList.vue b/src/components/Task/TaskList.vue similarity index 93% rename from src/components/TaskList.vue rename to src/components/Task/TaskList.vue index 92c385e..f40ef80 100644 --- a/src/components/TaskList.vue +++ b/src/components/Task/TaskList.vue @@ -24,6 +24,8 @@ const taskItem = { description: 'Task', checked: false, newTask: true, + autoCheck: true, + subTasks: [], }; export default Vue.extend({ @@ -37,7 +39,7 @@ export default Vue.extend({ const localTasks = sm.get('tasks'); - for(const task of localTasks) task.newTask = undefined; + for (const task of localTasks) task.newTask = undefined; sm.set('tasks', localTasks); }, diff --git a/src/components/TaskComp.vue b/src/components/TaskComp.vue deleted file mode 100644 index 56eec78..0000000 --- a/src/components/TaskComp.vue +++ /dev/null @@ -1,298 +0,0 @@ - - - - - - - - - - - - {{ title }} - {{ description }} - - - - - - - - - - - - - diff --git a/src/pages/index.vue b/src/pages/index.vue index 38d92e1..5b303a4 100644 --- a/src/pages/index.vue +++ b/src/pages/index.vue @@ -1,12 +1,12 @@ - + A single page web app to help yours day-to-day tasks - + @@ -16,5 +16,15 @@ import Vue from 'vue'; export default Vue.extend({ name: 'IndexPage', + data() { + return { + preventAnim: true, + }; + }, + mounted() { + setTimeout(() => { + this.preventAnim = false; + }, 1000); + }, });
{{ description }}
A single page web app to help yours day-to-day tasks