<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style type="text/css">
*{
margin: 0;padding: 0;list-style: none;}
div{
width: 200px;height: 200px;background: black;position: absolute;left: 50%;top: 50%;margin: -100px 0 0 -100px;
transition:.3s;
-transform-origin:right top;
transform-origin:left center;
}
</style>
</head>
<body>
<div id="div1"></div>
<script type="text/javascript">
var reg=0;
setInterval(function()
{
reg++;
div1.style.transform="perspective(50px) rotateY("+reg+"deg)";
},0);
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style type="text/css">
*{
margin: 0;padding: 0;list-style: none;}
div{
width: 100px;height: 100px;background: black;
}
</style>
</head>
<body>
<div id='div1'></div>
<script type="text/javascript">
</script>
</body>
</html>