create-anima 0.1.2 → 0.1.3
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/dist/index.js +4 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -115,7 +115,7 @@ export default function App() {
|
|
|
115
115
|
</div>
|
|
116
116
|
|
|
117
117
|
<div className="flex-1 overflow-hidden">
|
|
118
|
-
<AnimaPlayer animation={animation} controls
|
|
118
|
+
<AnimaPlayer animation={animation} controls style={{ height: '100%' }} />
|
|
119
119
|
</div>
|
|
120
120
|
|
|
121
121
|
<RenderDialog
|
|
@@ -127,7 +127,7 @@ export default function App() {
|
|
|
127
127
|
);
|
|
128
128
|
}
|
|
129
129
|
`,
|
|
130
|
-
'src/animation.ts': () => `import {
|
|
130
|
+
'src/animation.ts': () => `import {defineAnimation, easeInOut, easeOut, Screen} from '@it-compiles/anima';
|
|
131
131
|
|
|
132
132
|
export default defineAnimation((scene) => {
|
|
133
133
|
// Set background
|
|
@@ -154,10 +154,11 @@ export default defineAnimation((scene) => {
|
|
|
154
154
|
ctx.opacity(title).to(0, 1);
|
|
155
155
|
ctx.opacity(subtitle).to(0, 1);
|
|
156
156
|
ctx.scale(title).to(0.5, 1);
|
|
157
|
+
ctx.pin(subtitle, 'center').to([Screen.centerX(), 400], 1);
|
|
157
158
|
});
|
|
158
159
|
|
|
159
160
|
// Animate title - fade in and scale up
|
|
160
|
-
t.tween(800,
|
|
161
|
+
t.tween(800, easeInOut, (ctx, u) => {
|
|
161
162
|
ctx.pin(title, 'center').to([Screen.centerX(), 300], u);
|
|
162
163
|
ctx.scale(title).to(1, u);
|
|
163
164
|
ctx.opacity(title).to(1, u);
|
|
@@ -165,18 +166,11 @@ export default defineAnimation((scene) => {
|
|
|
165
166
|
|
|
166
167
|
// Animate subtitle - fade in below title
|
|
167
168
|
t.tween(600, easeOut, (ctx, u) => {
|
|
168
|
-
ctx.pin(subtitle, 'center').to([Screen.centerX(), 400], u);
|
|
169
169
|
ctx.opacity(subtitle).to(1, u);
|
|
170
170
|
});
|
|
171
171
|
|
|
172
172
|
// Hold for a moment
|
|
173
173
|
t.wait(1000);
|
|
174
|
-
|
|
175
|
-
// Fade out both
|
|
176
|
-
t.tween(500, easeOut, (ctx, u) => {
|
|
177
|
-
ctx.opacity(title).to(0, u);
|
|
178
|
-
ctx.opacity(subtitle).to(0, u);
|
|
179
|
-
});
|
|
180
174
|
});
|
|
181
175
|
};
|
|
182
176
|
});
|