monoteen

animation

Oct 5th, 2014
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 2.24 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.     <head>
  4.         <title>TODO supply a title</title>
  5.         <meta charset="UTF-8">
  6.         <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7.         <style>
  8.             div {
  9.                 width: 100px;
  10.                 height: 100px;
  11.                 background: red;
  12.                 position: relative;
  13.                 animation: 2s myanim;
  14.                 animation-iteration-count: 10;
  15.                 -webkit-animation: 2s myanim;
  16.                 -webkit-animation-iteration-count: 10;
  17.             }
  18.             @keyframes myanim {
  19.                 0% {
  20.                     left: 0px;
  21.                     top: 0px;
  22.                 }
  23.                 25% {
  24.                     left: 100px;
  25.                     top: 0px;
  26.                 }
  27.                 50% {
  28.                     left: 200px;
  29.                     top: 0px;
  30.                 }
  31.                 75% {
  32.                     left: 100px;
  33.                     top: 0px;
  34.                 }
  35.                 100% {
  36.                     left: 0px;
  37.                     top: 0px;
  38.                 }
  39.             }
  40.             @-webkit-keyframes myanim {
  41.                 0% {
  42.                     left: 0px;
  43.                     top: 0px;
  44.                 }
  45.                 25% {
  46.                     left: 100px;
  47.                     top: 0px;
  48.                 }
  49.                 50% {
  50.                     left: 200px;
  51.                     top: 0px;
  52.                 }
  53.                 75% {
  54.                     left: 100px;
  55.                     top: 0px;
  56.                 }
  57.                 100% {
  58.                     left: 0px;
  59.                     top: 0px;
  60.                 }
  61.             }
  62.         </style>
  63.     </head>
  64.     <body>
  65.         <div class="container">
  66.             <div class="transformed">
  67.                 3차원 변환되는 박스이다.<br/>
  68.                 backface-visibility는 후면을 보이게 하는 속성이다.<br/>
  69.                 transform-origin은 변환에서 거리를 설정한다.<br/>
  70.                 rotateY()는 Y축을 중심으로 하는 회전 변환이다.<br/>
  71.                 rotateX()는 X축을 중심으로 하는 화전 변환이다.
  72.             </div>
  73.         </div>
  74.     </body>
  75. </html>
Advertisement
Add Comment
Please, Sign In to add comment