feat: move transition in own component
This commit is contained in:
parent
fba402fcd0
commit
631a19fa92
37
src/components/misc/CustomTransition.vue
Normal file
37
src/components/misc/CustomTransition.vue
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
<template>
|
||||||
|
<transition name="flash-background">
|
||||||
|
<slot />
|
||||||
|
</transition>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
defineProps<{
|
||||||
|
name: 'flash-background'
|
||||||
|
}>()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
$flash-background-duration: 750ms;
|
||||||
|
|
||||||
|
.flash-background-enter-from,
|
||||||
|
.flash-background-enter-active {
|
||||||
|
animation: flash-background $flash-background-duration ease 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes flash-background {
|
||||||
|
0% {
|
||||||
|
background: var(--primary-light);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
@keyframes flash-background {
|
||||||
|
0% {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -2,16 +2,3 @@
|
|||||||
.link-share-container:not(.has-background) .task-view {
|
.link-share-container:not(.has-background) .task-view {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: should be a prop of TaskDetailView.vue
|
|
||||||
.modal-container .task-view {
|
|
||||||
border-radius: $radius;
|
|
||||||
padding: 1rem;
|
|
||||||
color: var(--text);
|
|
||||||
background-color: var(--site-background) !important;
|
|
||||||
|
|
||||||
@media screen and (max-width: 800px) {
|
|
||||||
border-radius: 0;
|
|
||||||
padding-top: 2rem;
|
|
||||||
}
|
|
||||||
}
|
|
@ -41,7 +41,7 @@
|
|||||||
v-model="task.assignees"
|
v-model="task.assignees"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<transition name="flash-background" appear>
|
<CustomTransition name="flash-background" appear>
|
||||||
<div class="column" v-if="activeFields.priority">
|
<div class="column" v-if="activeFields.priority">
|
||||||
<!-- Priority -->
|
<!-- Priority -->
|
||||||
<div class="detail-title">
|
<div class="detail-title">
|
||||||
@ -54,8 +54,8 @@
|
|||||||
:ref="e => setFieldRef('priority', e)"
|
:ref="e => setFieldRef('priority', e)"
|
||||||
v-model="task.priority"/>
|
v-model="task.priority"/>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</CustomTransition>
|
||||||
<transition name="flash-background" appear>
|
<CustomTransition name="flash-background" appear>
|
||||||
<div class="column" v-if="activeFields.dueDate">
|
<div class="column" v-if="activeFields.dueDate">
|
||||||
<!-- Due Date -->
|
<!-- Due Date -->
|
||||||
<div class="detail-title">
|
<div class="detail-title">
|
||||||
@ -80,8 +80,8 @@
|
|||||||
</BaseButton>
|
</BaseButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</CustomTransition>
|
||||||
<transition name="flash-background" appear>
|
<CustomTransition name="flash-background" appear>
|
||||||
<div class="column" v-if="activeFields.percentDone">
|
<div class="column" v-if="activeFields.percentDone">
|
||||||
<!-- Progress -->
|
<!-- Progress -->
|
||||||
<div class="detail-title">
|
<div class="detail-title">
|
||||||
@ -94,8 +94,8 @@
|
|||||||
:ref="e => setFieldRef('percentDone', e)"
|
:ref="e => setFieldRef('percentDone', e)"
|
||||||
v-model="task.percentDone"/>
|
v-model="task.percentDone"/>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</CustomTransition>
|
||||||
<transition name="flash-background" appear>
|
<CustomTransition name="flash-background" appear>
|
||||||
<div class="column" v-if="activeFields.startDate">
|
<div class="column" v-if="activeFields.startDate">
|
||||||
<!-- Start Date -->
|
<!-- Start Date -->
|
||||||
<div class="detail-title">
|
<div class="detail-title">
|
||||||
@ -121,8 +121,8 @@
|
|||||||
</BaseButton>
|
</BaseButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</CustomTransition>
|
||||||
<transition name="flash-background" appear>
|
<CustomTransition name="flash-background" appear>
|
||||||
<div class="column" v-if="activeFields.endDate">
|
<div class="column" v-if="activeFields.endDate">
|
||||||
<!-- End Date -->
|
<!-- End Date -->
|
||||||
<div class="detail-title">
|
<div class="detail-title">
|
||||||
@ -147,8 +147,8 @@
|
|||||||
</BaseButton>
|
</BaseButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</CustomTransition>
|
||||||
<transition name="flash-background" appear>
|
<CustomTransition name="flash-background" appear>
|
||||||
<div class="column" v-if="activeFields.reminders">
|
<div class="column" v-if="activeFields.reminders">
|
||||||
<!-- Reminders -->
|
<!-- Reminders -->
|
||||||
<div class="detail-title">
|
<div class="detail-title">
|
||||||
@ -162,8 +162,8 @@
|
|||||||
@update:model-value="saveTask"
|
@update:model-value="saveTask"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</CustomTransition>
|
||||||
<transition name="flash-background" appear>
|
<CustomTransition name="flash-background" appear>
|
||||||
<div class="column" v-if="activeFields.repeatAfter">
|
<div class="column" v-if="activeFields.repeatAfter">
|
||||||
<!-- Repeat after -->
|
<!-- Repeat after -->
|
||||||
<div class="is-flex is-justify-content-space-between">
|
<div class="is-flex is-justify-content-space-between">
|
||||||
@ -190,8 +190,8 @@
|
|||||||
}"
|
}"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</CustomTransition>
|
||||||
<transition name="flash-background" appear>
|
<CustomTransition name="flash-background" appear>
|
||||||
<div class="column" v-if="activeFields.color">
|
<div class="column" v-if="activeFields.color">
|
||||||
<!-- Color -->
|
<!-- Color -->
|
||||||
<div class="detail-title">
|
<div class="detail-title">
|
||||||
@ -205,7 +205,7 @@
|
|||||||
@update:model-value="saveTask"
|
@update:model-value="saveTask"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</CustomTransition>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Labels -->
|
<!-- Labels -->
|
||||||
@ -480,6 +480,7 @@ import RelatedTasks from '@/components/tasks/partials/relatedTasks.vue'
|
|||||||
import Reminders from '@/components/tasks/partials/reminders.vue'
|
import Reminders from '@/components/tasks/partials/reminders.vue'
|
||||||
import RepeatAfter from '@/components/tasks/partials/repeatAfter.vue'
|
import RepeatAfter from '@/components/tasks/partials/repeatAfter.vue'
|
||||||
import TaskSubscription from '@/components/misc/subscription.vue'
|
import TaskSubscription from '@/components/misc/subscription.vue'
|
||||||
|
import CustomTransition from '@/components/misc/CustomTransition.vue'
|
||||||
|
|
||||||
import {uploadFile} from '@/helpers/attachments'
|
import {uploadFile} from '@/helpers/attachments'
|
||||||
import {getNamespaceTitle} from '@/helpers/getNamespaceTitle'
|
import {getNamespaceTitle} from '@/helpers/getNamespaceTitle'
|
||||||
@ -798,8 +799,6 @@ async function setPercentDone(percentDone: number) {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
$flash-background-duration: 750ms;
|
|
||||||
|
|
||||||
.task-view-container {
|
.task-view-container {
|
||||||
// simulate sass lighten($primary, 30) by increasing lightness 30% to 73%
|
// simulate sass lighten($primary, 30) by increasing lightness 30% to 73%
|
||||||
--primary-light: hsla(var(--primary-h), var(--primary-s), 73%, var(--primary-a));
|
--primary-light: hsla(var(--primary-h), var(--primary-s), 73%, var(--primary-a));
|
||||||
@ -820,6 +819,18 @@ $flash-background-duration: 750ms;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.is-modal .task-view {
|
||||||
|
border-radius: $radius;
|
||||||
|
padding: 1rem;
|
||||||
|
color: var(--text);
|
||||||
|
background-color: var(--site-background) !important;
|
||||||
|
|
||||||
|
@media screen and (max-width: 800px) {
|
||||||
|
border-radius: 0;
|
||||||
|
padding-top: 2rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.task-view * {
|
.task-view * {
|
||||||
transition: opacity 50ms ease;
|
transition: opacity 50ms ease;
|
||||||
}
|
}
|
||||||
@ -996,28 +1007,6 @@ line-height: 1;
|
|||||||
padding-left: .25rem;
|
padding-left: .25rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.flash-background-enter-from,
|
|
||||||
.flash-background-enter-active {
|
|
||||||
animation: flash-background $flash-background-duration ease 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes flash-background {
|
|
||||||
0% {
|
|
||||||
background: var(--primary-light);
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
background: transparent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (prefers-reduced-motion: reduce) {
|
|
||||||
@keyframes flash-background {
|
|
||||||
0% {
|
|
||||||
background: transparent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include modal-transition();
|
@include modal-transition();
|
||||||
|
|
||||||
.detail-content {
|
.detail-content {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user