@noction/vue-bezier 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +109 -0
- package/dist/Collapse/CollapseTransition.vue.d.ts +14 -0
- package/dist/Fade/FadeTransition.vue.d.ts +13 -0
- package/dist/Scale/ScaleTransition.vue.d.ts +26 -0
- package/dist/Slide/SlideXLeftTransition.vue.d.ts +22 -0
- package/dist/Slide/SlideXRightTransition.vue.d.ts +22 -0
- package/dist/Slide/SlideYDownTransition.vue.d.ts +22 -0
- package/dist/Slide/SlideYUpTransition.vue.d.ts +22 -0
- package/dist/Zoom/ZoomCenterTransition.vue.d.ts +13 -0
- package/dist/Zoom/ZoomUpTransition.vue.d.ts +22 -0
- package/dist/Zoom/ZoomXTransition.vue.d.ts +22 -0
- package/dist/Zoom/ZoomYTransition.vue.d.ts +22 -0
- package/dist/composable/buildComponentType.d.ts +3 -0
- package/dist/composable/buildEmits.d.ts +2 -0
- package/dist/composable/buildHooks.d.ts +7 -0
- package/dist/composable/buildProps.d.ts +48 -0
- package/dist/composable/buildTag.d.ts +2 -0
- package/dist/composable/index.d.ts +6 -0
- package/dist/index.d.ts +17 -0
- package/dist/style.css +1 -0
- package/dist/vue-bezier.mjs +456 -0
- package/dist/vue-bezier.umd.js +1 -0
- package/dist/web-types.json +156 -0
- package/package.json +63 -0
- package/src/components/Collapse/CollapseTransition.vue +122 -0
- package/src/components/Fade/FadeTransition.vue +52 -0
- package/src/components/Scale/ScaleTransition.vue +76 -0
- package/src/components/Slide/SlideXLeftTransition.vue +73 -0
- package/src/components/Slide/SlideXRightTransition.vue +73 -0
- package/src/components/Slide/SlideYDownTransition.vue +72 -0
- package/src/components/Slide/SlideYUpTransition.vue +74 -0
- package/src/components/Slide/move.scss +1 -0
- package/src/components/Zoom/ZoomCenterTransition.vue +63 -0
- package/src/components/Zoom/ZoomUpTransition.vue +75 -0
- package/src/components/Zoom/ZoomXTransition.vue +75 -0
- package/src/components/Zoom/ZoomYTransition.vue +78 -0
- package/src/components/Zoom/move.scss +1 -0
- package/src/composable/buildComponentType.ts +4 -0
- package/src/composable/buildEmits.ts +7 -0
- package/src/composable/buildHooks.ts +92 -0
- package/src/composable/buildProps.ts +52 -0
- package/src/composable/buildTag.ts +1 -0
- package/src/composable/index.ts +7 -0
- package/src/global-shim.d.ts +1 -0
- package/src/index.ts +62 -0
- package/src/vue-shim.d.ts +5 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="componentType"
|
|
4
|
+
:tag="tag"
|
|
5
|
+
v-bind="{ ...$attrs, ...hooks }"
|
|
6
|
+
move-class="collapse-move"
|
|
7
|
+
>
|
|
8
|
+
<slot />
|
|
9
|
+
</component>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup lang="ts">
|
|
13
|
+
import { BaseTransitionProps } from 'vue'
|
|
14
|
+
import {
|
|
15
|
+
buildComponentType,
|
|
16
|
+
buildEmits,
|
|
17
|
+
buildProps,
|
|
18
|
+
buildTag
|
|
19
|
+
} from '../../composable'
|
|
20
|
+
import { leave, setAbsolutePosition, setStyles } from '../../composable/buildHooks'
|
|
21
|
+
|
|
22
|
+
const props = defineProps(buildProps())
|
|
23
|
+
const emit = defineEmits(buildEmits())
|
|
24
|
+
|
|
25
|
+
const componentType = buildComponentType(props)
|
|
26
|
+
const tag = buildTag(props)
|
|
27
|
+
|
|
28
|
+
const hooks: BaseTransitionProps = {
|
|
29
|
+
onAfterEnter (el) {
|
|
30
|
+
// for safari: remove class then reset height is necessary
|
|
31
|
+
el.style.transition = ''
|
|
32
|
+
el.style.height = ''
|
|
33
|
+
el.style.overflow = el.dataset.oldOverflow
|
|
34
|
+
|
|
35
|
+
emit('after-enter', el)
|
|
36
|
+
},
|
|
37
|
+
onAfterLeave (el) {
|
|
38
|
+
el.style.transition = ''
|
|
39
|
+
el.style.height = ''
|
|
40
|
+
el.style.overflow = el.dataset.oldOverflow
|
|
41
|
+
el.style.paddingTop = el.dataset.oldPaddingTop
|
|
42
|
+
el.style.paddingBottom = el.dataset.oldPaddingBottom
|
|
43
|
+
|
|
44
|
+
emit('after-leave', el)
|
|
45
|
+
},
|
|
46
|
+
onBeforeEnter (el) {
|
|
47
|
+
const enterDuration = props.duration?.enter ?? props.duration ?? 0
|
|
48
|
+
|
|
49
|
+
el.style.transition = transitionStyle(enterDuration)
|
|
50
|
+
|
|
51
|
+
if (!el.dataset) el.dataset = {}
|
|
52
|
+
|
|
53
|
+
el.dataset.oldPaddingTop = el.style.paddingTop
|
|
54
|
+
el.dataset.oldPaddingBottom = el.style.paddingBottom
|
|
55
|
+
|
|
56
|
+
el.style.height = '0'
|
|
57
|
+
el.style.paddingTop = 0
|
|
58
|
+
el.style.paddingBottom = 0
|
|
59
|
+
|
|
60
|
+
setStyles(props, el)
|
|
61
|
+
|
|
62
|
+
emit('before-enter', el)
|
|
63
|
+
},
|
|
64
|
+
onBeforeLeave (el) {
|
|
65
|
+
if (!el.dataset) el.dataset = {}
|
|
66
|
+
|
|
67
|
+
el.dataset.oldPaddingTop = el.style.paddingTop
|
|
68
|
+
el.dataset.oldPaddingBottom = el.style.paddingBottom
|
|
69
|
+
el.dataset.oldOverflow = el.style.overflow
|
|
70
|
+
|
|
71
|
+
el.style.height = `${el.scrollHeight}px`
|
|
72
|
+
el.style.overflow = 'hidden'
|
|
73
|
+
|
|
74
|
+
setStyles(props, el)
|
|
75
|
+
|
|
76
|
+
emit('before-leave', el)
|
|
77
|
+
},
|
|
78
|
+
onEnter (el) {
|
|
79
|
+
el.dataset.oldOverflow = el.style.overflow
|
|
80
|
+
|
|
81
|
+
if (el.scrollHeight !== 0) {
|
|
82
|
+
el.style.height = `${el.scrollHeight}px`
|
|
83
|
+
el.style.paddingTop = el.dataset.oldPaddingTop
|
|
84
|
+
el.style.paddingBottom = el.dataset.oldPaddingBottom
|
|
85
|
+
} else {
|
|
86
|
+
el.style.height = ''
|
|
87
|
+
el.style.paddingTop = el.dataset.oldPaddingTop
|
|
88
|
+
el.style.paddingBottom = el.dataset.oldPaddingBottom
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
el.style.overflow = 'hidden'
|
|
92
|
+
},
|
|
93
|
+
onLeave (el, done: () => void) {
|
|
94
|
+
const leaveDuration = props.duration.leave ?? props.duration ?? 0
|
|
95
|
+
|
|
96
|
+
if (el.scrollHeight !== 0) {
|
|
97
|
+
// for safari: add class after set height, or it will jump to zero height suddenly, weired
|
|
98
|
+
el.style.transition = transitionStyle(leaveDuration)
|
|
99
|
+
el.style.height = 0
|
|
100
|
+
el.style.paddingTop = 0
|
|
101
|
+
el.style.paddingBottom = 0
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// necessary for transition-group
|
|
105
|
+
setAbsolutePosition(props, el)
|
|
106
|
+
|
|
107
|
+
leave(props, el, done)
|
|
108
|
+
emit('leave', el, done)
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const transitionStyle = (duration: number) => {
|
|
113
|
+
const durationInSeconds = duration / 1000
|
|
114
|
+
|
|
115
|
+
return `${durationInSeconds}s height ease-in-out, ${durationInSeconds}s padding-top ease-in-out, ${durationInSeconds}s padding-bottom ease-in-out`
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
</script>
|
|
119
|
+
|
|
120
|
+
<style>
|
|
121
|
+
.collapse-move { transition: transform .3s ease-in-out; }
|
|
122
|
+
</style>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="componentType"
|
|
4
|
+
:tag="tag"
|
|
5
|
+
enter-active-class="fade-in"
|
|
6
|
+
move-class="fade-move"
|
|
7
|
+
leave-active-class="fade-out"
|
|
8
|
+
v-bind="{ ...$attrs, ...hooks }"
|
|
9
|
+
>
|
|
10
|
+
<slot />
|
|
11
|
+
</component>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script lang="ts">
|
|
15
|
+
export default {
|
|
16
|
+
inheritAttrs: false
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<script setup lang="ts">
|
|
21
|
+
import {
|
|
22
|
+
buildComponentType,
|
|
23
|
+
buildEmits,
|
|
24
|
+
buildHooks,
|
|
25
|
+
buildProps,
|
|
26
|
+
buildTag
|
|
27
|
+
} from '../../composable'
|
|
28
|
+
|
|
29
|
+
const props = defineProps(buildProps())
|
|
30
|
+
const emit = defineEmits(buildEmits())
|
|
31
|
+
|
|
32
|
+
const componentType = buildComponentType(props)
|
|
33
|
+
const tag = buildTag(props)
|
|
34
|
+
const hooks = buildHooks(props, emit)
|
|
35
|
+
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<style>
|
|
39
|
+
@keyframes fade-in {
|
|
40
|
+
from { opacity: 0; }
|
|
41
|
+
to { opacity: 1; }
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@keyframes fade-out {
|
|
45
|
+
from { opacity: 1; }
|
|
46
|
+
to { opacity: 0; }
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.fade-in { animation-name: fade-in; }
|
|
50
|
+
.fade-out { animation-name: fade-out; }
|
|
51
|
+
.fade-move { transition: transform .3s ease-out; }
|
|
52
|
+
</style>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="componentType"
|
|
4
|
+
:tag="tag"
|
|
5
|
+
v-bind="{ ...$attrs, ...hooks }"
|
|
6
|
+
enter-active-class="scale-in"
|
|
7
|
+
move-class="scale-move"
|
|
8
|
+
leave-active-class="scale-out"
|
|
9
|
+
>
|
|
10
|
+
<slot />
|
|
11
|
+
</component>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script lang="ts">
|
|
15
|
+
export const customProps = {
|
|
16
|
+
origin: {
|
|
17
|
+
default: 'top left',
|
|
18
|
+
type: String
|
|
19
|
+
},
|
|
20
|
+
styles: {
|
|
21
|
+
default: () => {
|
|
22
|
+
return {
|
|
23
|
+
animationFillMode: 'both',
|
|
24
|
+
animationTimingFunction: 'cubic-bezier(.25,.8,.50,1)'
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
type: Object
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default {
|
|
32
|
+
inheritAttrs: false
|
|
33
|
+
}
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<script setup lang="ts">
|
|
37
|
+
import {
|
|
38
|
+
buildComponentType,
|
|
39
|
+
buildEmits,
|
|
40
|
+
buildHooks,
|
|
41
|
+
buildProps,
|
|
42
|
+
buildTag
|
|
43
|
+
} from '../../composable'
|
|
44
|
+
|
|
45
|
+
const props = defineProps(buildProps(customProps))
|
|
46
|
+
const emit = defineEmits(buildEmits())
|
|
47
|
+
|
|
48
|
+
const componentType = buildComponentType(props)
|
|
49
|
+
const tag = buildTag(props)
|
|
50
|
+
const hooks = buildHooks(props, emit)
|
|
51
|
+
|
|
52
|
+
</script>
|
|
53
|
+
|
|
54
|
+
<style>
|
|
55
|
+
@keyframes scale-in {
|
|
56
|
+
from {
|
|
57
|
+
opacity: 0;
|
|
58
|
+
transform: scale(0);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
to { opacity: 1; }
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@keyframes scale-out {
|
|
65
|
+
from { opacity: 1; }
|
|
66
|
+
|
|
67
|
+
to {
|
|
68
|
+
opacity: 0;
|
|
69
|
+
transform: scale(0);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.scale-in { animation-name: scale-in; }
|
|
74
|
+
.scale-out { animation-name: scale-out; }
|
|
75
|
+
.scale-move { transition: transform .3s cubic-bezier(.25, .8, .5, 1); }
|
|
76
|
+
</style>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="componentType"
|
|
4
|
+
:tag="tag"
|
|
5
|
+
v-bind="{ ...$attrs, ...hooks }"
|
|
6
|
+
enter-active-class="slide-x-left-in"
|
|
7
|
+
move-class="slide-move"
|
|
8
|
+
leave-active-class="slide-x-left-out"
|
|
9
|
+
>
|
|
10
|
+
<slot />
|
|
11
|
+
</component>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script lang="ts">
|
|
15
|
+
export const customProps = {
|
|
16
|
+
styles: {
|
|
17
|
+
default: () => {
|
|
18
|
+
return {
|
|
19
|
+
animationFillMode: 'both',
|
|
20
|
+
animationTimingFunction: 'cubic-bezier(.25,.8,.50,1)'
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
type: Object
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default {
|
|
28
|
+
inheritAttrs: false
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<script setup lang="ts">
|
|
33
|
+
import {
|
|
34
|
+
buildComponentType,
|
|
35
|
+
buildEmits,
|
|
36
|
+
buildHooks,
|
|
37
|
+
buildProps,
|
|
38
|
+
buildTag
|
|
39
|
+
} from '../../composable'
|
|
40
|
+
|
|
41
|
+
const props = defineProps(buildProps(customProps))
|
|
42
|
+
const emit = defineEmits(buildEmits())
|
|
43
|
+
|
|
44
|
+
const componentType = buildComponentType(props)
|
|
45
|
+
const tag = buildTag(props)
|
|
46
|
+
const hooks = buildHooks(props, emit)
|
|
47
|
+
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<style lang="scss">
|
|
51
|
+
@import 'move';
|
|
52
|
+
|
|
53
|
+
@keyframes slide-x-left-in {
|
|
54
|
+
from {
|
|
55
|
+
opacity: 0;
|
|
56
|
+
transform: translateX(-15px);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
to { opacity: 1; }
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@keyframes slide-x-left-out {
|
|
63
|
+
from { opacity: 1; }
|
|
64
|
+
|
|
65
|
+
to {
|
|
66
|
+
opacity: 0;
|
|
67
|
+
transform: translateX(-15px);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.slide-x-left-in { animation-name: slide-x-left-in; }
|
|
72
|
+
.slide-x-left-out { animation-name: slide-x-left-out; }
|
|
73
|
+
</style>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="componentType"
|
|
4
|
+
:tag="tag"
|
|
5
|
+
v-bind="{ ...$attrs, ...hooks }"
|
|
6
|
+
enter-active-class="slide-x-right-in"
|
|
7
|
+
move-class="slide-move"
|
|
8
|
+
leave-active-class="slide-x-right-out"
|
|
9
|
+
>
|
|
10
|
+
<slot />
|
|
11
|
+
</component>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script lang="ts">
|
|
15
|
+
export const customProps = {
|
|
16
|
+
styles: {
|
|
17
|
+
default: () => {
|
|
18
|
+
return {
|
|
19
|
+
animationFillMode: 'both',
|
|
20
|
+
animationTimingFunction: 'cubic-bezier(.25,.8,.50,1)'
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
type: Object
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default {
|
|
28
|
+
inheritAttrs: false
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<script setup lang="ts">
|
|
33
|
+
import {
|
|
34
|
+
buildComponentType,
|
|
35
|
+
buildEmits,
|
|
36
|
+
buildHooks,
|
|
37
|
+
buildProps,
|
|
38
|
+
buildTag
|
|
39
|
+
} from '../../composable'
|
|
40
|
+
|
|
41
|
+
const props = defineProps(buildProps(customProps))
|
|
42
|
+
const emit = defineEmits(buildEmits())
|
|
43
|
+
|
|
44
|
+
const componentType = buildComponentType(props)
|
|
45
|
+
const tag = buildTag(props)
|
|
46
|
+
const hooks = buildHooks(props, emit)
|
|
47
|
+
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<style lang="scss">
|
|
51
|
+
@import 'move';
|
|
52
|
+
|
|
53
|
+
@keyframes slide-x-right-in {
|
|
54
|
+
from {
|
|
55
|
+
opacity: 0;
|
|
56
|
+
transform: translateX(15px);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
to { opacity: 1; }
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@keyframes slide-x-right-out {
|
|
63
|
+
from { opacity: 1; }
|
|
64
|
+
|
|
65
|
+
to {
|
|
66
|
+
opacity: 0;
|
|
67
|
+
transform: translateX(15px);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.slide-x-right-in { animation-name: slide-x-right-in; }
|
|
72
|
+
.slide-x-right-out { animation-name: slide-x-right-out; }
|
|
73
|
+
</style>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="componentType"
|
|
4
|
+
:tag="tag"
|
|
5
|
+
v-bind="{ ...$attrs, ...hooks }"
|
|
6
|
+
enter-active-class="slide-y-down-in"
|
|
7
|
+
leave-active-class="slide-y-down-out"
|
|
8
|
+
>
|
|
9
|
+
<slot />
|
|
10
|
+
</component>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script lang="ts">
|
|
14
|
+
export const customProps = {
|
|
15
|
+
styles: {
|
|
16
|
+
default: () => {
|
|
17
|
+
return {
|
|
18
|
+
animationFillMode: 'both',
|
|
19
|
+
animationTimingFunction: 'cubic-bezier(.25,.8,.50,1)'
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
type: Object
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default {
|
|
27
|
+
inheritAttrs: false
|
|
28
|
+
}
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<script setup lang="ts">
|
|
32
|
+
import {
|
|
33
|
+
buildComponentType,
|
|
34
|
+
buildEmits,
|
|
35
|
+
buildHooks,
|
|
36
|
+
buildProps,
|
|
37
|
+
buildTag
|
|
38
|
+
} from '../../composable'
|
|
39
|
+
|
|
40
|
+
const props = defineProps(buildProps(customProps))
|
|
41
|
+
const emit = defineEmits(buildEmits())
|
|
42
|
+
|
|
43
|
+
const componentType = buildComponentType(props)
|
|
44
|
+
const tag = buildTag(props)
|
|
45
|
+
const hooks = buildHooks(props, emit)
|
|
46
|
+
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<style lang="scss">
|
|
50
|
+
@import 'move';
|
|
51
|
+
|
|
52
|
+
@keyframes slide-y-down-in {
|
|
53
|
+
from {
|
|
54
|
+
opacity: 0;
|
|
55
|
+
transform: translateY(15px);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
to { opacity: 1; }
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@keyframes slide-y-down-out {
|
|
62
|
+
from { opacity: 1; }
|
|
63
|
+
|
|
64
|
+
to {
|
|
65
|
+
opacity: 0;
|
|
66
|
+
transform: translateY(15px);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.slide-y-down-in { animation-name: slide-y-down-in; }
|
|
71
|
+
.slide-y-down-out { animation-name: slide-y-down-out; }
|
|
72
|
+
</style>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="componentType"
|
|
4
|
+
:tag="tag"
|
|
5
|
+
type="animation"
|
|
6
|
+
v-bind="{ ...$attrs, ...hooks }"
|
|
7
|
+
enter-active-class="slide-y-in"
|
|
8
|
+
move-class="slide-move"
|
|
9
|
+
leave-active-class="slide-y-out"
|
|
10
|
+
>
|
|
11
|
+
<slot />
|
|
12
|
+
</component>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script lang="ts">
|
|
16
|
+
export const customProps = {
|
|
17
|
+
styles: {
|
|
18
|
+
default: () => {
|
|
19
|
+
return {
|
|
20
|
+
animationFillMode: 'both',
|
|
21
|
+
animationTimingFunction: 'cubic-bezier(.25,.8,.50,1)'
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
type: Object
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default {
|
|
29
|
+
inheritAttrs: false
|
|
30
|
+
}
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<script setup lang="ts">
|
|
34
|
+
import {
|
|
35
|
+
buildComponentType,
|
|
36
|
+
buildEmits,
|
|
37
|
+
buildHooks,
|
|
38
|
+
buildProps,
|
|
39
|
+
buildTag
|
|
40
|
+
} from '../../composable'
|
|
41
|
+
|
|
42
|
+
const props = defineProps(buildProps(customProps))
|
|
43
|
+
const emit = defineEmits(buildEmits())
|
|
44
|
+
|
|
45
|
+
const componentType = buildComponentType(props)
|
|
46
|
+
const tag = buildTag(props)
|
|
47
|
+
const hooks = buildHooks(props, emit)
|
|
48
|
+
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<style lang="scss">
|
|
52
|
+
@import 'move';
|
|
53
|
+
|
|
54
|
+
@keyframes slide-y-in {
|
|
55
|
+
from {
|
|
56
|
+
opacity: 0;
|
|
57
|
+
transform: translateY(-15px);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
to { opacity: 1; }
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@keyframes slide-y-out {
|
|
64
|
+
from { opacity: 1; }
|
|
65
|
+
|
|
66
|
+
to {
|
|
67
|
+
opacity: 0;
|
|
68
|
+
transform: translateY(-15px);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.slide-y-in { animation-name: slide-y-in; }
|
|
73
|
+
.slide-y-out { animation-name: slide-y-out; }
|
|
74
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.slide-move { transition: transform .3s; }
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="componentType"
|
|
4
|
+
:tag="tag"
|
|
5
|
+
v-bind="{ ...$attrs, ...hooks }"
|
|
6
|
+
enter-active-class="zoom-in"
|
|
7
|
+
move-class="zoom-move"
|
|
8
|
+
leave-active-class="zoom-out"
|
|
9
|
+
>
|
|
10
|
+
<slot />
|
|
11
|
+
</component>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script lang="ts">
|
|
15
|
+
export default {
|
|
16
|
+
inheritAttrs: false
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<script setup lang="ts">
|
|
21
|
+
import {
|
|
22
|
+
buildComponentType,
|
|
23
|
+
buildEmits,
|
|
24
|
+
buildHooks,
|
|
25
|
+
buildProps,
|
|
26
|
+
buildTag
|
|
27
|
+
} from '../../composable'
|
|
28
|
+
|
|
29
|
+
const props = defineProps(buildProps())
|
|
30
|
+
const emit = defineEmits(buildEmits())
|
|
31
|
+
|
|
32
|
+
const componentType = buildComponentType(props)
|
|
33
|
+
const tag = buildTag(props)
|
|
34
|
+
const hooks = buildHooks(props, emit)
|
|
35
|
+
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<style lang="scss">
|
|
39
|
+
@import 'move';
|
|
40
|
+
|
|
41
|
+
@keyframes zoom-in {
|
|
42
|
+
0% {
|
|
43
|
+
opacity: 0;
|
|
44
|
+
transform: scale3d(.3, .3, .3);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
50% { opacity: 1; }
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@keyframes zoom-out {
|
|
51
|
+
0% { opacity: 1; }
|
|
52
|
+
|
|
53
|
+
50% {
|
|
54
|
+
opacity: 0;
|
|
55
|
+
transform: scale3d(.3, .3, .3);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
100% { opacity: 0; }
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.zoom-in { animation-name: zoom-in; }
|
|
62
|
+
.zoom-out { animation-name: zoom-out; }
|
|
63
|
+
</style>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="componentType"
|
|
4
|
+
:tag="tag"
|
|
5
|
+
v-bind="{ ...$attrs, ...hooks }"
|
|
6
|
+
enter-active-class="zoom-in-up"
|
|
7
|
+
move-class="zoom-move"
|
|
8
|
+
leave-active-class="zoom-out-up"
|
|
9
|
+
>
|
|
10
|
+
<slot />
|
|
11
|
+
</component>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script lang="ts">
|
|
15
|
+
export const customProps = {
|
|
16
|
+
styles: {
|
|
17
|
+
default: () => {
|
|
18
|
+
return {
|
|
19
|
+
animationFillMode: 'both',
|
|
20
|
+
animationTimingFunction: 'ease-out'
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
type: Object
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default {
|
|
28
|
+
inheritAttrs: false
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<script setup lang="ts">
|
|
33
|
+
import {
|
|
34
|
+
buildComponentType,
|
|
35
|
+
buildEmits,
|
|
36
|
+
buildHooks,
|
|
37
|
+
buildProps,
|
|
38
|
+
buildTag
|
|
39
|
+
} from '../../composable'
|
|
40
|
+
|
|
41
|
+
const props = defineProps(buildProps(customProps))
|
|
42
|
+
const emit = defineEmits(buildEmits())
|
|
43
|
+
|
|
44
|
+
const componentType = buildComponentType(props)
|
|
45
|
+
const tag = buildTag(props)
|
|
46
|
+
const hooks = buildHooks(props, emit)
|
|
47
|
+
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<style lang="scss">
|
|
51
|
+
@import 'move';
|
|
52
|
+
|
|
53
|
+
@keyframes zoom-in-up {
|
|
54
|
+
0% {
|
|
55
|
+
opacity: 0;
|
|
56
|
+
transform: scaleY(0);
|
|
57
|
+
transform-origin: top center;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
50% { opacity: 1; }
|
|
61
|
+
|
|
62
|
+
100% { transform: scaleY(1); }
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@keyframes zoom-out-up {
|
|
66
|
+
0% { opacity: 1; }
|
|
67
|
+
|
|
68
|
+
50% { transform: scaleY(0); }
|
|
69
|
+
|
|
70
|
+
100% { opacity: 0; }
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.zoom-in-up { animation-name: zoom-in-up; }
|
|
74
|
+
.zoom-out-up { animation-name: zoom-out-up; }
|
|
75
|
+
</style>
|