diff --git a/src/main.ts b/src/main.ts index d4079b05..da4c8778 100644 --- a/src/main.ts +++ b/src/main.ts @@ -6,8 +6,6 @@ import { setupStore } from '@/store' import { setupNaive, setupDirectives, setupCustomComponents, setupPreviewPackages } from '@/plugins' import { AppProvider } from '@/components/AppProvider/index' import { setHtmlTheme } from '@/utils' - -// 引入动画 import 'animate.css/animate.min.css' async function appInit() { diff --git a/src/packages/index.d.ts b/src/packages/index.d.ts index 5a6b1822..16a17618 100644 --- a/src/packages/index.d.ts +++ b/src/packages/index.d.ts @@ -19,6 +19,7 @@ export interface PublicConfigType { id: string rename?: string attr: { x: number; y: number; w: number; h: number; zIndex: number } + styles: { opacity: number, animations: string[] } setPosition: Function } export interface CreateComponentType extends PublicConfigType { diff --git a/src/packages/public/publicConfig.ts b/src/packages/public/publicConfig.ts index 1fe3cb8b..d4f1aa11 100644 --- a/src/packages/public/publicConfig.ts +++ b/src/packages/public/publicConfig.ts @@ -7,6 +7,11 @@ export class publicConfig implements PublicConfigType { public rename = undefined // 基本信息 public attr = { x: 0, y: 0, w: 500, h: 300, zIndex: -1 } + // 基本样式(动画,透明) + public styles = { + opacity: 1, + animations: [] + } // 设置坐标 public setPosition(x: number, y: number): void { this.attr.x = x diff --git a/src/plugins/icon.ts b/src/plugins/icon.ts index b781d152..0afc534a 100644 --- a/src/plugins/icon.ts +++ b/src/plugins/icon.ts @@ -46,6 +46,7 @@ DesktopOutline as DesktopOutlineIcon, Cut as CutIcon, Square as SquareIcon, ColorPalette as ColorPaletteIcon, + Leaf as LeafIcon } from '@vicons/ionicons5' import { @@ -158,7 +159,9 @@ const ionicons5 = { SquareIcon, // 色彩选择 ColorPaletteIcon, - ZAxisIcon + ZAxisIcon, + // 气球 + LeafIcon } const carbon = { diff --git a/src/settings/animations/index.ts b/src/settings/animations/index.ts index 57b35dc2..5d588fc6 100644 --- a/src/settings/animations/index.ts +++ b/src/settings/animations/index.ts @@ -1,6 +1,21 @@ -const animations = [ +export const animations = [ { - label: '进入', + label: '强调动画', + children: [ + { label: '弹跳', value: 'bounce' }, + { label: '闪烁', value: 'flash' }, + { label: '放大缩小', value: 'pulse' }, + { label: '放大缩小弹簧', value: 'rubberBand' }, + { label: '左右晃动', value: 'headShake' }, + { label: '左右扇形摇摆', value: 'swing' }, + { label: '放大晃动缩小', value: 'tada' }, + { label: '扇形摇摆', value: 'wobble' }, + { label: '左右上下晃动', value: 'jello' }, + { label: 'Y轴旋转', value: 'flip' } + ] + }, + { + label: '移入动画', children: [ { label: '渐显', value: 'fadeIn' }, { label: '向右进入', value: 'fadeInLeft' }, @@ -39,58 +54,5 @@ const animations = [ { label: '向上滑动展开', value: 'slideInUp' }, { label: '向下滑动展开', value: 'slideInDown' } ] - }, - { - label: '强调', - children: [ - { label: '弹跳', value: 'bounce' }, - { label: '闪烁', value: 'flash' }, - { label: '放大缩小', value: 'pulse' }, - { label: '放大缩小弹簧', value: 'rubberBand' }, - { label: '左右晃动', value: 'headShake' }, - { label: '左右扇形摇摆', value: 'swing' }, - { label: '放大晃动缩小', value: 'tada' }, - { label: '扇形摇摆', value: 'wobble' }, - { label: '左右上下晃动', value: 'jello' }, - { label: 'Y轴旋转', value: 'flip' } - ] - }, - { - label: '退出', - children: [ - { label: '渐隐', value: 'fadeOut' }, - { label: '向左退出', value: 'fadeOutLeft' }, - { label: '向右退出', value: 'fadeOutRight' }, - { label: '向上退出', value: 'fadeOutUp' }, - { label: '向下退出', value: 'fadeOutDown' }, - { label: '向左长距退出', value: 'fadeOutLeftBig' }, - { label: '向右长距退出', value: 'fadeOutRightBig' }, - { label: '向上长距退出', value: 'fadeOutUpBig' }, - { label: '向下长距退出', value: 'fadeOutDownBig' }, - { label: '旋转退出', value: 'rotateOut' }, - { label: '左顺时针旋转', value: 'rotateOutDownLeft' }, - { label: '右逆时针旋转', value: 'rotateOutDownRight' }, - { label: '左逆时针旋转', value: 'rotateOutUpLeft' }, - { label: '右逆时针旋转', value: 'rotateOutUpRight' }, - { label: '弹出', value: 'bounceOut' }, - { label: '向左弹出', value: 'bounceOutLeft' }, - { label: '向右弹出', value: 'bounceOutRight' }, - { label: '向上弹出', value: 'bounceOutUp' }, - { label: '向下弹出', value: 'bounceOutDown' }, - { label: '中心X轴旋转', value: 'flipOutX' }, - { label: '中心Y轴旋转', value: 'flipOutY' }, - { label: '左长半径旋转', value: 'rollOut' }, - { label: '由小变大退出', value: 'zoomOut' }, - { label: '左变大退出', value: 'zoomOutLeft' }, - { label: '右变大退出', value: 'zoomOutRight' }, - { label: '向上变大退出', value: 'zoomOutUp' }, - { label: '向下变大退出', value: 'zoomOutDown' }, - { label: '向左滑动收起', value: 'slideOutLeft' }, - { label: '向右滑动收起', value: 'slideOutRight' }, - { label: '向上滑动收起', value: 'slideOutUp' }, - { label: '向下滑动收起', value: 'slideOutDown' } - ] } ] - -export { animations } diff --git a/src/views/chart/ContentConfigurations/components/ChartAnimation/index.vue b/src/views/chart/ContentConfigurations/components/ChartAnimation/index.vue new file mode 100644 index 00000000..4103981d --- /dev/null +++ b/src/views/chart/ContentConfigurations/components/ChartAnimation/index.vue @@ -0,0 +1,95 @@ + + + + + diff --git a/src/views/chart/ContentConfigurations/components/ChartSetting/index.vue b/src/views/chart/ContentConfigurations/components/ChartSetting/index.vue index b1f83104..e7173eac 100644 --- a/src/views/chart/ContentConfigurations/components/ChartSetting/index.vue +++ b/src/views/chart/ContentConfigurations/components/ChartSetting/index.vue @@ -1,5 +1,5 @@