A tiny library to get 2/3D matricies from CSS3 transform functions. Fully covered by unit tests, with support for AMD, CommonJS, Node, and browser globals.
JavaScript CoffeeScript CSS
Switch branches/tags
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
Gruntfile.coffee
LICENSE.md
README.md
grunt-umd-template.hbs
package.json
transform-to-matrix.coffee
transform-to-matrix.js
transform-to-matrix.min.js

README.md

transform-to-matrix

A tiny library to get 2/3D matricies from CSS3 transform functions. Fully covered by unit tests, with support for AMD, CommonJS, Node, and browser globals.

example

var getMatrix = require('transform-to-matrix'),
	matrix = getMatrix.translate3d(10, 50, 100)
	// ->
	// [
	// 	  [1, 0, 0, 10],
	//    [0, 1, 0, 50],
	//    [0, 0, 1, 100],
	//    [0, 0, 0, 1]
	// ]

supported transforms

  • perspective
  • rotate
  • rotateX
  • rotateY
  • rotateZ
  • rotate3d
  • scale
  • scaleX
  • scaleY
  • scaleZ
  • scale3d
  • skew
  • skewX
  • skewY
  • translate
  • translateX
  • translateY
  • translateZ
  • translate3d

see