From 7ee22886cb168b88ea7a26658eef598a659b038f Mon Sep 17 00:00:00 2001 From: yutent Date: Tue, 4 Apr 2023 14:46:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8A=A8=E7=94=BB,=20?= =?UTF-8?q?=E5=A2=9E=E5=8A=A02=E7=A7=8D=E5=86=85=E7=BD=AE=E5=8A=A8?= =?UTF-8?q?=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/anim.js | 11 ++++++++++- src/html.js | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index b35220e..9305954 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@bd/core", - "version": "1.8.3", + "version": "1.8.4", "type": "module", "description": "百搭UI组件库的核心", "main": "dist/index.js", diff --git a/src/anim.js b/src/anim.js index bf05e40..9aa746c 100644 --- a/src/anim.js +++ b/src/anim.js @@ -29,9 +29,18 @@ export function animate(duration = 200, fromto = [], out = false) { export const MODES = { fade: [{ opacity: 0 }, { opacity: 1 }], scale: [{ transform: 'scale(0)' }, { transform: 'scale(1)' }], + 'micro-bounce': [ + { opacity: 0, transform: 'scale(0.8)' }, + { transform: 'scale(1.05)', opacity: 1 }, + { transform: 'scale(1)' } + ], + slide: [ + { opacity: 0, transform: 'translateY(-50px)' }, + { opacity: 1, transform: 'translateY(0)' } + ], bounce: [ { transform: 'scale(0)' }, - { transform: 'scale(1.25)' }, + { transform: 'scale(1.2)' }, { transform: 'scale(1)' } ], rotate: [{ transform: 'rotate(0)' }, { transform: 'rotate(360deg)' }] diff --git a/src/html.js b/src/html.js index 7ea81a2..3557309 100644 --- a/src/html.js +++ b/src/html.js @@ -625,7 +625,7 @@ class AnimPart extends AttributePart { } commitValue({ type = 'fade', duration, custom } = {}) { - let fromto = MODES[type] + let fromto = MODES[type] || MODES.fade if (custom) { fromto = custom