代码拉取完成,页面将自动刷新
* {
margin: 0;
padding: 0;
}
body {
background: #a9c6c9;
animation: myfirst 10s infinite;
}
@keyframes myfirst
{
0% {background: #f3ffd9; left:0px; top:0px;}
25% {background: #cadda0; left:200px; top:0px;}
50% {background: #5e6f4d; left:200px; top:200px;}
75% {background: #cadda0; left:0px; top:200px;}
100% {background: #f3ffd9; left:0px; top:0px;}
}
.box1 {
position: relative;
width: 500px;
height: 500px;
margin: 200px auto;
transform-style: preserve-3d;
animation: move1 10s infinite linear;
}
ul {
list-style: none;
}
/* 内盒子样式 */
.minbox1 {
width: 250px;
height: 250px;
position: absolute;
margin: 125px;
transform-style: preserve-3d;
}
.minbox1 li {
width: 250px;
height: 250px;
position: absolute;
}
.minbox1 li:nth-child(1) {
background: url("./img/01.jpg") no-repeat;
background-size: cover;
transform: translateZ(125px);
transition: transform 1.5s; /* 还原时所需的时间 */
}
.minbox1 li:nth-child(2) {
background: url("./img/02.jpg") no-repeat;
background-size: cover;
transform: rotateY(90deg) translateZ(125px);
transition: transform 1.5s;
}
.minbox1 li:nth-child(3) {
background: url("./img/03.jpg") no-repeat;
background-size: cover;
transform: rotateX(90deg) translateZ(125px);
transition: transform 1.5s;
}
.minbox1 li:nth-child(4) {
background: url("./img/04.jpg") no-repeat;
background-size: cover;
transform: rotateX(180deg) translateZ(125px);
transition: transform 1.5s;
}
.minbox1 li:nth-child(5) {
background: url("./img/05.jpg") no-repeat;
background-size: cover;
transform: rotateY(-90deg) translateZ(125px);
transition: transform 1.5s;
}
.minbox1 li:nth-child(6) {
background: url("./img/06.jpg") no-repeat;
background-size: cover;
transform: rotateX(-90deg) translateZ(125px);
transition: transform 1.5s;
}
/*外盒子样式*/
.minbox2 {
line-height: 500px;
width: 500px;
height: 500px;
position: absolute;
margin: auto;
transform-style: preserve-3d;
}
.minbox2 li {
width: 500px;
height: 500px;
position: absolute;
opacity: 0.5;
}
.minbox2 li:nth-child(1) {
background: url("./img/01.jpg") no-repeat;
background-size: cover;
transform: translateZ(220px);
transition: transform 1.5s;
}
.minbox2 li:nth-child(2) {
background: url("./img/02.jpg") no-repeat;
background-size: cover;
transform: rotateY(90deg) translateZ(220px);
transition: transform 1.5s;
}
.minbox2 li:nth-child(3) {
background: url("./img/03.jpg") no-repeat;
background-size: cover;
transform: rotateX(90deg) translateZ(220px);
transition: transform 1.5s;
}
.minbox2 li:nth-child(4) {
background: url("./img/04.jpg") no-repeat;
background-size: cover;
transform: rotateX(180deg) translateZ(220px);
transition: transform 1.5s;
}
.minbox2 li:nth-child(5) {
background: url("./img/05.jpg") no-repeat;
background-size: cover;
transform: rotateY(-90deg) translateZ(220px);
transition: transform 1.5s;
}
.minbox2 li:nth-child(6) {
background: url("./img/06.jpg") no-repeat;
background-size: cover;
transform: rotateX(-90deg) translateZ(220px);
transition: transform 1.5s;
}
/*鼠标悬停*/
.box1:hover {
animation: move2 8s infinite linear;
}
.box1:hover .minbox1 li:nth-child(1) {
transform: translateZ(200px);
transition: transform 1s;
}
.box1:hover .minbox1 li:nth-child(2) {
transform: rotateY(90deg) translateZ(150px);
transition: transform 1s; /* 打开时所需的时间 */
}
.box1:hover .minbox1 li:nth-child(3) {
transform: rotateX(90deg) translateZ(150px);
transition: transform 1s;
}
.box1:hover .minbox1 li:nth-child(4) {
transform: rotateX(180deg) translateZ(150px);
transition: transform 1s;
}
.box1:hover .minbox1 li:nth-child(5) {
transform: rotateY(-90deg) translateZ(150px);
transition: transform 1s;
}
.box1:hover .minbox1 li:nth-child(6) {
transform: rotateX(-90deg) translateZ(150px);
transition: transform 1s;
}
.box1:hover .minbox2 li:nth-child(1) {
transform: translateZ(600px);
transition: transform 2s;
}
.box1:hover .minbox2 li:nth-child(2) {
transform: rotateY(60deg) translateZ(600px);
transition: transform 2s;
}
.box1:hover .minbox2 li:nth-child(3) {
transform: rotateY(120deg) translateZ(600px);
transition: transform 2s;
}
.box1:hover .minbox2 li:nth-child(4) {
transform: rotateY(180deg) translateZ(600px);
transition: transform 2s;
}
.box1:hover .minbox2 li:nth-child(5) {
transform: rotateY(-120deg) translateZ(600px);
transition: transform 2s;
}
.box1:hover .minbox2 li:nth-child(6) {
transform: rotateY(-60deg) translateZ(600px);
transition: transform 2s;
}
@keyframes move1 {
0% {
transform: rotateX(10deg) rotateY(0deg);
}
100% {
transform: rotateX(370deg) rotateY(360deg);
}
}
@keyframes move2 {
0% {
transform: rotateX(20deg) rotateY(0deg);
}
100% {
transform: rotateX(20deg) rotateY(360deg);
}
}
.box2 {
position: relative;
width: 200px;
height: 200px;
margin: 400px auto;
transform-style: preserve-3d;
animation: move2 10s infinite linear;
}
.minbox3 {
width: 200px;
height: 200px;
position: absolute;
margin: auto;
transform-style: preserve-3d;
}
.minbox3 li {
width: 200px;
height: 200px;
position: absolute;
opacity: 0.8;
}
.minbox3 li:nth-child(1) {
background: url("./img/01.jpg") no-repeat;
background-size: cover;
transform: translateZ(100px);
}
.minbox3 li:nth-child(2) {
background: url("./img/02.jpg") no-repeat;
background-size: cover;
transform: rotateX(180deg) translateZ(120px) rotateX(-180deg);
}
.minbox3 li:nth-child(3) {
background: url("./img/03.jpg") no-repeat;
background-size: cover;
transform: rotateX(90deg) translateZ(120px);
}
.minbox3 li:nth-child(4) {
background: url("./img/04.jpg") no-repeat;
background-size: cover;
transform: rotateX(-90deg) translateZ(120px);
}
.minbox3 li:nth-child(5) {
background: url("./img/05.jpg") no-repeat;
background-size: cover;
transform: rotateY(90deg) translateZ(120px);
}
.minbox3 li:nth-child(6) {
background: url("./img/06.jpg") no-repeat;
background-size: cover;
transform: rotateY(-90deg) translateZ(120px);
}
.title {
line-height: 200px;
text-align: center;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。