12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Document</title>
- <style>
- body{
- margin: 0;
- height: 100vh;
- background-color: cornflowerblue;
- /* overflow: hidden; */
- perspective: 1000px;
- }
- .box{
- width: 200px;
- height: 200px;
- border:1px dashed black;
- position: fixed;
- top: 50%;
- left: 50%;
- margin-top: -100px;
- margin-left: -100px;
- transform-style: preserve-3d;
- /* transform: rotateY(30deg); */
- animation-name: foo;
- animation-duration: 2s;
- animation-iteration-count: infinite;
- animation-timing-function:linear;
- }
- @keyframes foo {
- 0%{
- transform: rotateY(0deg);
- }
- 100%{
- transform: rotateY(360deg);
- }
- }
- .box div{
- width: 200px;
- height: 200px;
- position: absolute;
- top:0;
- left: 0;
- background-size: 100% 100%;
- opacity: 0.5;
- border-radius: 15px;
- }
- .box .one{
- background-image: url("./img/a.jpg");
- transform: translateZ(100px);
- }
- .box .two{
- background-image: url("./img/b.jpg");
- transform: translateZ(-100px);
- }
- .box .three{
- background-image: url("./img/c.jpg");
- transform: rotateY(90deg) translateZ(100px);
- }
- .box .four{
- background-image: url("./img/d.jpg");
- transform: rotateY(90deg) translateZ(-100px);
- }
- .box .five{
- background-image: url("./img/e.jpg");
- transform: rotateX(90deg) translateZ(100px);
- }
- .box .six{
- background-image: url("./img/f.jpg");
- transform: rotateX(90deg) translateZ(-100px);
- }
- </style>
- </head>
- <body>
- <div class="box">
- <div class="one"></div>
- <div class="two"></div>
- <div class="three"></div>
- <div class="four"></div>
- <div class="five"></div>
- <div class="six"></div>
- </div>
- </body>
- </html>
|