mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
fix(animation): animation timer fallback now accounts for iterations (#19527)
This commit is contained in:
@ -949,8 +949,9 @@ export const createAnimation = () => {
|
||||
*/
|
||||
const animationDelay = getDelay() || 0;
|
||||
const animationDuration = getDuration() || 0;
|
||||
const animationIterations = getIterations() || 1;
|
||||
|
||||
cssAnimationsTimerFallback = setTimeout(onAnimationEndFallback, animationDelay + animationDuration + ANIMATION_END_FALLBACK_PADDING_MS);
|
||||
cssAnimationsTimerFallback = setTimeout(onAnimationEndFallback, animationDelay + (animationDuration * animationIterations) + ANIMATION_END_FALLBACK_PADDING_MS);
|
||||
|
||||
animationEnd(elements[0], () => {
|
||||
clearCSSAnimationsTimeout();
|
||||
|
@ -17,7 +17,7 @@
|
||||
Element.prototype.animate = null;
|
||||
}
|
||||
|
||||
import { createAnimation } from '../../../../dist/index.mjs';
|
||||
import { createAnimation } from '../../../../dist/ionic/index.esm.js';
|
||||
|
||||
const squareA = document.querySelector('.square-a');
|
||||
|
||||
@ -25,7 +25,8 @@
|
||||
|
||||
rootAnimation
|
||||
.addElement(squareA)
|
||||
.duration(1000)
|
||||
.duration(500)
|
||||
.iterations(2)
|
||||
.easing('linear')
|
||||
.keyframes([
|
||||
{ background: 'rgba(255, 0, 0, 0.5)', offset: 0 },
|
||||
|
@ -12,7 +12,7 @@
|
||||
<script nomodule src="../../../../../dist/ionic/ionic.js"></script>
|
||||
<script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script>
|
||||
<script type="module">
|
||||
import { createAnimation } from '../../../../dist/index.mjs';
|
||||
import { createAnimation } from '../../../../dist/ionic/index.esm.js';
|
||||
|
||||
const squareA = document.querySelectorAll('.square-a');
|
||||
const squareB = document.querySelectorAll('.square-b');
|
||||
|
@ -17,7 +17,7 @@
|
||||
Element.prototype.animate = null;
|
||||
}
|
||||
|
||||
import { createAnimation } from '../../../../dist/index.mjs';
|
||||
import { createAnimation } from '../../../../dist/ionic/index.esm.js';
|
||||
|
||||
const squareA = document.querySelector('.square-a');
|
||||
const squareBText = document.querySelectorAll('.square-b .text');
|
||||
|
@ -12,7 +12,7 @@
|
||||
<script nomodule src="../../../../../dist/ionic/ionic.js"></script>
|
||||
<script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script>
|
||||
<script type="module">
|
||||
import { createAnimation, createGesture } from '../../../../dist/index.mjs';
|
||||
import { createAnimation, createGesture } from '../../../../dist/ionic/index.esm.js';
|
||||
|
||||
function clamp(val) {
|
||||
if (val > 1) {
|
||||
|
@ -17,7 +17,7 @@
|
||||
Element.prototype.animate = null;
|
||||
}
|
||||
|
||||
import { createAnimation } from '../../../../dist/index.mjs';
|
||||
import { createAnimation } from '../../../../dist/ionic/index.esm.js';
|
||||
|
||||
const squareA = document.querySelector('.square-a');
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
Element.prototype.animate = null;
|
||||
}
|
||||
|
||||
import { createAnimation } from '../../../../dist/index.mjs';
|
||||
import { createAnimation } from '../../../../dist/ionic/index.esm.js';
|
||||
|
||||
const squareA = document.querySelector('.square-a');
|
||||
const squareB = document.querySelector('.square-b');
|
||||
|
@ -17,7 +17,7 @@
|
||||
Element.prototype.animate = null;
|
||||
}
|
||||
|
||||
import { createAnimation } from '../../../../dist/index.mjs';
|
||||
import { createAnimation } from '../../../../dist/ionic/index.esm.js';
|
||||
|
||||
createAnimation()
|
||||
.addElement(document.querySelector('.square-a'))
|
||||
|
Reference in New Issue
Block a user