feat: 新增过渡动画
This commit is contained in:
parent
f5980440b2
commit
5973f7bb54
4
src/components.d.ts
vendored
4
src/components.d.ts
vendored
@ -7,14 +7,14 @@ export {}
|
|||||||
|
|
||||||
declare module "vue" {
|
declare module "vue" {
|
||||||
export interface GlobalComponents {
|
export interface GlobalComponents {
|
||||||
|
BarcodeDraw: (typeof import("./components/barcode-draw/index.vue"))["default"];
|
||||||
CodeView: (typeof import("./components/code-view/index.vue"))["default"];
|
CodeView: (typeof import("./components/code-view/index.vue"))["default"];
|
||||||
DrawBarcode: (typeof import("./components/draw-barcode/index.vue"))["default"];
|
|
||||||
DrawQrcode: (typeof import("./components/draw-qrcode/index.vue"))["default"];
|
|
||||||
ExternalLinkPage: (typeof import("./components/external-link-page/index.vue"))["default"];
|
ExternalLinkPage: (typeof import("./components/external-link-page/index.vue"))["default"];
|
||||||
FillPage: (typeof import("./components/fill-page/index.vue"))["default"];
|
FillPage: (typeof import("./components/fill-page/index.vue"))["default"];
|
||||||
InternalLinkPage: (typeof import("./components/internal-link-page/index.vue"))["default"];
|
InternalLinkPage: (typeof import("./components/internal-link-page/index.vue"))["default"];
|
||||||
LangProvider: (typeof import("./components/lang-provider/index.vue"))["default"];
|
LangProvider: (typeof import("./components/lang-provider/index.vue"))["default"];
|
||||||
MainTransition: (typeof import("./components/main-transition/index.vue"))["default"];
|
MainTransition: (typeof import("./components/main-transition/index.vue"))["default"];
|
||||||
|
QrcodeDraw: (typeof import("./components/qrcode-draw/index.vue"))["default"];
|
||||||
RouterLink: (typeof import("vue-router"))["RouterLink"];
|
RouterLink: (typeof import("vue-router"))["RouterLink"];
|
||||||
RouterView: (typeof import("vue-router"))["RouterView"];
|
RouterView: (typeof import("vue-router"))["RouterView"];
|
||||||
SelectIcon: (typeof import("./components/select-icon/index.vue"))["default"];
|
SelectIcon: (typeof import("./components/select-icon/index.vue"))["default"];
|
||||||
|
|||||||
@ -41,7 +41,13 @@ const breadcrumb = computed(() => {
|
|||||||
|
|
||||||
// 页面过渡
|
// 页面过渡
|
||||||
const transition = computed(() => {
|
const transition = computed(() => {
|
||||||
return transitionPage.value === "fadeInOut" ? "fadeInOut-enter-active" : "cardInOut-enter-active";
|
if (transitionPage.value === "fadeInOut") {
|
||||||
|
return "fadeInOut-enter-active";
|
||||||
|
} else if (transitionPage.value === "cardInOut") {
|
||||||
|
return "cardInOut-enter-active";
|
||||||
|
} else {
|
||||||
|
return "fadeOut-enter-active";
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 面包屑跳转
|
// 面包屑跳转
|
||||||
|
|||||||
@ -42,7 +42,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex-row">
|
<div class="flex-row">
|
||||||
<div>页面过渡</div>
|
<div>页面过渡</div>
|
||||||
<a-select v-model="transitionPage" :style="{ width: '100px' }" placeholder="请选择">
|
<a-select v-model="transitionPage" :style="{ width: '120px' }" placeholder="请选择">
|
||||||
<a-option v-for="item in transitions" :key="item.value" :value="item.value" :label="item.label" />
|
<a-option v-for="item in transitions" :key="item.value" :value="item.value" :label="item.label" />
|
||||||
</a-select>
|
</a-select>
|
||||||
</div>
|
</div>
|
||||||
@ -82,7 +82,8 @@ const layoutList = reactive({
|
|||||||
|
|
||||||
const transitions = ref([
|
const transitions = ref([
|
||||||
{ value: "fadeInOut", label: "轻过渡" },
|
{ value: "fadeInOut", label: "轻过渡" },
|
||||||
{ value: "cardInOut", label: "卡片" }
|
{ value: "cardInOut", label: "卡片" },
|
||||||
|
{ value: "fadeOut", label: "消退" }
|
||||||
]);
|
]);
|
||||||
|
|
||||||
interface IThemeColor {
|
interface IThemeColor {
|
||||||
|
|||||||
@ -75,19 +75,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes swing-in-top-fwd {
|
|
||||||
0% {
|
|
||||||
opacity: 0;
|
|
||||||
transform: rotateX(-100deg);
|
|
||||||
transform-origin: top;
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
opacity: 1;
|
|
||||||
transform: rotateX(0deg);
|
|
||||||
transform-origin: top;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 离开
|
// 离开
|
||||||
.cardInOut-leave-active {
|
.cardInOut-leave-active {
|
||||||
animation: swing-out-top-bck 0.25s cubic-bezier(0.6, -0.28, 0.735, 0.045) both;
|
animation: swing-out-top-bck 0.25s cubic-bezier(0.6, -0.28, 0.735, 0.045) both;
|
||||||
@ -106,15 +93,31 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes swing-out-top-bck {
|
/* 淡入淡出 */
|
||||||
|
// 进入
|
||||||
|
.fadeOut-enter-active {
|
||||||
|
animation: fade-in 0.25s cubic-bezier(0.39, 0.575, 0.565, 1) both;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fade-in {
|
||||||
|
0% {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 离开
|
||||||
|
.fadeOut-leave-active {
|
||||||
|
animation: fade-out 0.25s ease-out both;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fade-out {
|
||||||
0% {
|
0% {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
transform: rotateX(0deg);
|
|
||||||
transform-origin: top;
|
|
||||||
}
|
}
|
||||||
100% {
|
100% {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transform: rotateX(-100deg);
|
|
||||||
transform-origin: top;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,14 +6,14 @@
|
|||||||
<div class="code-box">
|
<div class="code-box">
|
||||||
<a-card v-for="item in codeList" :key="item.id" :title="item.docs" :style="{ width: '400px' }" hoverable>
|
<a-card v-for="item in codeList" :key="item.id" :title="item.docs" :style="{ width: '400px' }" hoverable>
|
||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
<draw-barcode :tag="item.tag" :text="item.text" :options="item.options" />
|
<barcode-draw :tag="item.tag" :text="item.text" :options="item.options" />
|
||||||
</div>
|
</div>
|
||||||
</a-card>
|
</a-card>
|
||||||
</div>
|
</div>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="9">
|
<a-col :span="9">
|
||||||
<a-scrollbar style="height: 625px; overflow: auto">
|
<a-scrollbar style="height: 625px; overflow: auto">
|
||||||
<CodeView :code-json="codeJson" style="width: 100%" />
|
<code-view :code-json="codeJson" style="width: 100%" />
|
||||||
</a-scrollbar>
|
</a-scrollbar>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
<template #item="{ element }">
|
<template #item="{ element }">
|
||||||
<div class="draggable-list" :class="!animated && 'animated-fade-up-' + element.value">
|
<div class="draggable-list" :class="!animated && 'animated-fade-up-' + element.value">
|
||||||
<div class="draggable-inner">
|
<div class="draggable-inner">
|
||||||
<SvgIcon :name="element.svg" :size="30" class="svg-box" />
|
<svg-icon :name="element.svg" :size="30" class="svg-box" />
|
||||||
<div>{{ element.label }}</div>
|
<div>{{ element.label }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -28,7 +28,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</a-space>
|
</a-space>
|
||||||
<a-scrollbar style="height: 396px; overflow: auto" outer-class="scrollbar">
|
<a-scrollbar style="height: 396px; overflow: auto" outer-class="scrollbar">
|
||||||
<CodeView :code-json="codeJson" style="width: 500px" />
|
<code-view :code-json="codeJson" style="width: 500px" />
|
||||||
</a-scrollbar>
|
</a-scrollbar>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -6,14 +6,14 @@
|
|||||||
<div class="code-box">
|
<div class="code-box">
|
||||||
<a-card v-for="item in codeList" :key="item.id" :title="item.docs" :style="{ width: '300px' }" hoverable>
|
<a-card v-for="item in codeList" :key="item.id" :title="item.docs" :style="{ width: '300px' }" hoverable>
|
||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
<draw-qrcode :tag="item.tag" :text="item.text" :options="item.options" />
|
<qrcode-draw :tag="item.tag" :text="item.text" :options="item.options" />
|
||||||
</div>
|
</div>
|
||||||
</a-card>
|
</a-card>
|
||||||
</div>
|
</div>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-scrollbar style="height: 410px; overflow: auto">
|
<a-scrollbar style="height: 410px; overflow: auto">
|
||||||
<CodeView :code-json="codeJson" style="width: 100%" />
|
<code-view :code-json="codeJson" style="width: 100%" />
|
||||||
</a-scrollbar>
|
</a-scrollbar>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user