matrixtransform.html revision 60aa9bb9c10c290c922d51d05a4dfa7176cfd40e
<html>
<head>
<style>
#rect {
width: 200px;
height: 100px;
position: absolute;
top: 50px;
left: 100px;
background-color: #fc0;
-moz-transform: matrix(1, -0.2, 0, 1, 0, 0);
-webkit-transform: matrix(1, -0.2, 0, 1, 0, 0);
-o-transform: matrix(1, -0.2, 0, 1, 0, 0);
-ms-transform: matrix(1, -0.2, 0, 1, 0, 0);
transform: matrix(1, -0.2, 0, 1, 0, 0);
border: 1px solid #000;
}
#rect2 {
background-color: #9aa;
border: 1px solid #000;
width: 300px;
height: 200px;
position: absolute;
top: 200px;
left: 0px;
-moz-transform: matrix(1, 0, 0.6, 1, 15em, 0);
-webkit-transform: matrix(1, 0, 0.6, 1, 250, 0);
-o-transform: matrix(1, 0, 0.6, 1, 250, 0);
-ms-transform: matrix(1, 0, 0.6, 1, 250, 0);
transform: matrix(1, 0, 0.6, 1, 250, 0);
}
#graphiccontainer {
position: absolute;
top: 0px;
left: 600px;
}
</style>
<!-- BEGIN EXAMPLE CODE -->
</head>
<body class="yui3-skin-sam">
<div id="rect"></div>
<div id="rect2"></div>
<div id="graphiccontainer"></div>
<script type="text/javascript">
YUI({filter:"raw"}).use('graphics', function(Y) {
var mygraphic,
myrect,
myrect2;
mygraphic = new Y.Graphic({render: "#graphiccontainer"});
type:"rect",
fill: {
color: "#fc0"
},
stroke: {
weight: 1,
color: "#000"
},
width: 200,
height: 100,
x: 100,
y: 50,
transform: "matrix(1, -0.2, 0, 1, 0, 0)"
});
type: "rect",
fill: {
color: "#9aa"
},
stroke: {
weight: 1,
color: "#000"
},
width: 300,
height: 200,
x: 0,
y: 200,
transform: "matrix(1, 0, 0.6, 1, 250, 0)"
});
});
</script>
</body>
</html>