exarcheia-flipbook
Version:
3D page flip effect for Vue.js
36 lines (26 loc) • 670 B
text/coffeescript
import {
identity
multiply
perspective
translate
translate3d
rotateY
toString
} from 'rematrix'
export default class Matrix
constructor: (arg) ->
if arg
if arg.m
= [arg.m...]
else
= [arg...]
else
= identity()
clone: -> new Matrix @
multiply: (m) -> = multiply , m
perspective: (d) -> perspective d
transformX: (x) -> (x * [0] + [12]) / (x * [3] + [15])
translate: (x, y) -> translate x, y
translate3d: (x, y, z) -> translate3d x, y, z
rotateY: (deg) -> rotateY deg
toString: -> toString