JavaScript Function To Extract Information From CSS Transform Matrix Property
15th February 2023
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:
Add new comment