Liu Song’s Projects


~/Projects/FFCreator

git clone https://code.lsong.org/FFCreator

Commit

Commit
9f933b940dc6458e366ba6f595e0a08e1e8fa219
Author
drawcall <[email protected]>
Date
2021-09-18 15:38:28 +0800 +0800
Diffstat
 examples/custom.js | 2 +-
 lib/animate/transition.js | 5 +++--
 package.json | 1 +

feat: remove DateUtil.toSeconds


diff --git a/examples/custom.js b/examples/custom.js
index b5759a44c3d80e9c77b332dd5338393f33469520..78373354c25027bc199c46c886570f40ca3c5c94 100755
--- a/examples/custom.js
+++ b/examples/custom.js
@@ -29,7 +29,7 @@   });
 
   // add custom effect
   creator.createEffect('customEffect1', {
-    from: { alpha: 0, y: 350, rotate: Math.PI / 2, scale: 0.3 },
+    from: { alpha: 0, y: 350, rotate: 2 * Math.PI, scale: 0.3 },
     to: { alpha: 1, y: 200, rotate: 0, scale: 1 },
     ease: 'Back.Out',
   });




diff --git a/lib/animate/transition.js b/lib/animate/transition.js
index ad0468d14b04254d1252bb77729e4677a23807b3..92e1bcc75495d6695c21ba8779c287642d3fb679 100755
--- a/lib/animate/transition.js
+++ b/lib/animate/transition.js
@@ -22,11 +22,12 @@ class FFTransition extends FFBase {
   constructor(conf) {
     super({ type: 'transition', ...conf });
 
-    const { name, duration = 600, params, resizeMode = 'stretch' } = this.conf;
+    const { name, duration = 1, params, resizeMode = 'stretch' } = this.conf;
     this.name = name;
     this.params = params;
     this.resizeMode = resizeMode;
-    this.duration = DateUtil.toSeconds(duration);
+    this.duration = duration;
+    // this.duration = DateUtil.toSeconds(duration);
   }
 
   /**




diff --git a/package.json b/package.json
index fadf22274ae7aaf75d804a8c0aba4abcaf028a23..6593147319c7fe6d7b32268906051777fded6bd1 100755
--- a/package.json
+++ b/package.json
@@ -1,5 +1,6 @@
 {
   "name": "ffcreator",
+  "types": "types/index.d.ts",
   "version": "5.3.3",
   "description": "FFCreator is a lightweight and flexible short video production library",
   "main": "lib/index.js",