
<style>
body {
/* 透视 */
perspective: 1000px;
}
section {
width: 200px;
height: 200px;
position: relative;
margin: 200px auto;
transform-style: preserve-3d;
/* 动画 */
animation: move 10s linear infinite;
}
@keyframes move {
0% {
transform: rotateY(0deg);
}
50% {
transform: rotateY(360deg);
}
100% {
transform: rotateY(360deg) rotateX(-360deg);
}
}
section div {
position: absolute;
width: 100%;
height: 100%;
}
section div:first-child {
transform: translateZ(100px);
background: url(jennie2.jpg) no-repeat;
}
section div:nth-child(2) {
/* 移动 */
transform: rotateY(90deg) translateZ(100px);
background: url(jisoo.jpg) no-repeat;
}
section div:nth-child(3) {
transform: rotateY(180deg) translateZ(100px);
background: url(lisa2.jpg) no-repeat;
}
section div:nth-child(4) {
transform: rotateY(270deg) translateZ(100px);
background: url(rosie2.jpg) no-repeat;
}
section div:nth-child(5) {
transform: rotateX(90deg) translateZ(100px);
background: url(bp1.jpg) no-repeat;
}
section div:nth-child(6) {
transform: rotateX(-90deg) translateZ(100px);
background: url(bp2.jpg) no-repeat;
}
/* hover 立方体展开 */
section:hover :nth-child(1) {
transform: translateZ(200px);
}
section:hover :nth-child(2) {
transform: rotateY(90deg) translateZ(200px);
}
section:hover :nth-child(3) {
transform: rotateY(180deg) translateZ(200px);
}
section:hover :nth-child(4) {
transform: rotateY(270deg) translateZ(200px);
}
section:hover :nth-child(5) {
transform: rotateX(90deg) translatez(200px);
}
section:hover :nth-child(6) {
transform: rotateX(-90deg) translateZ(200px);
}
</style>
</head>
<body>
<section>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</section>
</body>