function extractTransformData(data) {
let matrixRegex = /matrix\(\s*(-?\d*\.?\d*),\s*(-?\d*\.?\d*),\s*(-?\d*\.?\d*),\s*(-?\d*\.?\d*),\s*(-?\d*\.?\d*),\s*(-?\d*\.?\d*)\)/;
return data.match(matrixRegex);
}
Passing in the CSS transform property that looks like this:
matrix(0.577116, 0, 0, 0.577116, -873, -607)
Will return an array like this:
transform: Array(7)
0: "matrix(0.577116, 0, 0, 0.577116, -873, -607)"
1: "0.577116"
2: "0"
3: "0"
4: "0.577116"
5: "-873"
6: "-607"
Add new comment