Skip to content

Commit fd42427

Browse files
committed
style: rename isRotated() to isTransformed() and checkRotation() to checkTransform()
besides checking if the element is out of its original orientation it also verifies if the element is out of its original scale
1 parent 615afe9 commit fd42427

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

js-css-animations/js-css-animations.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,15 +204,15 @@ const eventBoundAnimations = (() => {
204204
})();
205205

206206
/**
207-
* Verifies if an element is out of its original orientation.
207+
* Verifies if an element is out of its original orientation or scale.
208208
*
209209
* Note that if the element has CSS property 'transform: rotate(0deg)',
210-
* checkRotation() will still return False, as the element is not
210+
* checkTransform() will still return False, as the element is not
211211
* out of its original orientation.
212212
* @param {HTMLElement|string} selector - An element or a valid CSS selector corresponding to the element
213213
* @returns True if the element was rotated from its original orientation. False if it maintains the original orientation.
214214
*/
215-
const checkRotation = selector => {
215+
const checkTransform = selector => {
216216
const el = selectElement(selector);
217217
const transform = getComputedStyle(el).transform;
218218
return transform !== 'none' && transform !== 'matrix(1, 0, 0, 1, 0, 0)';
@@ -256,7 +256,7 @@ const verifyAnimationName = {
256256
/**
257257
* An API encapsulating all the functions that can be used by the user,
258258
* like all the animations functions and auxiliary functions like
259-
* isRotated(), isVisible() and isHidden()
259+
* isTransformed(), isVisible() and isHidden()
260260
* @type {Object.<string, Function|Object>}
261261
*/
262262
const jsCssAnimations = (function () {
@@ -307,7 +307,7 @@ const jsCssAnimations = (function () {
307307
...opts,
308308
});
309309
},
310-
isRotated: checkRotation,
310+
isTransformed: checkTransform,
311311
/**
312312
* @param {Element|string} selector - Dom element or a valid CSS selector
313313
* @returns True if the element is visible, False otherwise

0 commit comments

Comments
 (0)