泰剧

实现立方体旋转

霸气de小男生 提交于 2020-01-21 07:55:14
HTML部分: <body class="body"> <div class="rect-wrap"> <!-- // 舞台元素,设置 perspective ,让其子元素获得透视效果。 --> <div class="container"> <!-- // 容器,设置 transform-style: preserve-3d ,让其子元素在 3D 空间呈现 --> <div class="top slide">1</div> <!-- // 立方体的六个面 --> <div class="bottom slide">2</div> <div class="left slide">3</div> <div class="right slide">4</div> <div class="front slide">5</div> <div class="back slide">6</div> </div> </div> </body> CSS: <style> .rect-wrap { position: relative; perspective: 2000px; } .container { width: 400px; height: 400px; transform-style: preserve-3d; transform-origin: 50% 50% 100px; /* /

实现立方体旋转

浪尽此生 提交于 2020-01-21 07:35:46
HTML部分: <body class="body"> <div class="rect-wrap"> <!-- //舞台元素,设置perspective,让其子元素获得透视效果。 --> <div class="container"> <!-- //容器,设置transform-style: preserve-3d,让其子元素在3D空间呈现 --> <div class="top slide">1</div> <!-- //立方体的六个面 --> <div class="bottom slide">2</div> <div class="left slide">3</div> <div class="right slide">4</div> <div class="front slide">5</div> <div class="back slide">6</div> </div> </div> </body> CSS: <style> .rect-wrap { position: relative; perspective: 2000px; } .container { width: 400px; height: 400px; transform-style: preserve-3d; transform-origin: 50% 50% 100px; /* /