1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
| <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>旋转木马</title> <style> *{ margin: 0; padding:0; } body{ display: flex; justify-content: center; align-items: center; height: 100vh; background-color: black; perspective: 900px; } section{ position: relative; width: 300px; height: 200px; cursor: pointer; transform-style: preserve-3d; animation:rotate 20s linear infinite; } img{ width: 300px; height: 200px; } section:hover{ animation-play-state: paused; } section div{ position: absolute; top: 0; left: 0; width: 100%; height: 100%; text-align: center; -webkit-box-reflect:below 15px -webkit-linear-gradient(transparent 10%,rgba(255,255,255,.3)); } section div:nth-child(1){ transform: translatez(300px); background-color: #c14c39; } section div:nth-child(2){ transform:rotateY(60deg) translatez(300px); background-color: #6e9c72; } section div:nth-child(3){ transform:rotateY(120deg) translatez(300px); background-color: #5e5f7a; } section div:nth-child(4){ transform:rotateY(180deg) translatez(300px); background-color: #f5eb98; } section div:nth-child(5){ transform:rotateY(240deg) translatez(300px); background-color: #50a3bc; } section div:nth-child(6){ transform:rotateY(300deg) translatez(300px); background-color: #f9a99a; } @keyframes rotate { to{ transform: rotateY(360deg); } } </style> </head> <body> <section> <div><img src="img2/1.jpg"></div> <div><img src="img2/2.jpg"></div> <div><img src="img2/3.jpg"></div> <div><img src="img2/4.jpg"></div> <div><img src="img2/5.jpg"></div> <div><img src="img2/6.jpg"></div> </section> </body> </html>
|
图片要自己加啊啊啊!
效果图视频我不会加。。。
有什么问题欢迎大家在评论区讨论!!