<style> #scene {perspective:400px; width:100px; height:100px; margin:100px auto; } #cube { position:absolute; transform-style:preserve-3d; width:100px; height:100px; animation:anim1 2s ease infinite; } #div1 {width:200px;height:200px;background:red;} .face {width:100%;height:100%;position:absolute;text-align:center;line-height:100px;} .front {background:hsla(1,100%,50%,.7);transform:rotateY(0deg) translateZ(50px);} .right {background:hsla(60,100%,50%,.7);transform:rotateY(90deg) translateZ(50px);} .back {background:hsla(120,100%,50%,.7);transform:rotateY(180deg) translateZ(50px);} .left {background:hsla(180,100%,50%,.7);transform:rotateY(270deg) translateZ(50px);} .top {background:hsla(240,100%,50%,.7);transform:rotateX(90deg) translateZ(50px);} .bottom {background:hsla(359,50%,100%,.7);transform:rotateY(-90deg) translateZ(50px);} @keyframes anim1 { 0% {transform:scale(2) rotate3d(1,-1,0,0deg);} 100% {transform:scale(2) rotate3d(1,-1,0,360deg);} } </style> <div id="scene"> <div id="cube"> <div class="face front">front</div> <div class="face right">right</div> <div class="face back">back</div> <div class="face left">left</div> <div class="face top">top</div> <div class="face bottom">bottom</div> </div></div> <div id="div1" style="transform: matrix3d(2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 100, 200, 100, 1)">transformMatrix</div>
front
right
back
left
top
bottom
transformMatrix
반응형
'html5' 카테고리의 다른 글
mathjax template; (1) | 2024.04.07 |
---|---|
event 3 phases ; 간단한 HTML DOM 구조를 보면서 세가지 국면(phase)을 거치는 이벤트 흐름을 용어와 함께 이해한다. (0) | 2023.11.01 |
roll-up caption example (0) | 2023.08.06 |
This is a hyperbola curve. 쌍곡선입니다. (0) | 2023.08.01 |
This is a sine curve.사인곡선입니다. (0) | 2023.08.01 |