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 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
| * { padding: 0; margin: 0; }
body { -webkit-transform: translate3d(0, 0, 0) ; transform: translate3d(0, 0, 0); /* perspective:1200px; */ }
.box { position: relative; width: 200px; height: 200px; margin: 100px auto; transform-style: preserve-3d; transition: all 2s; }
.box:hover { transform: rotateY(-180deg); }
/* .box:hover .back { transform: rotateY(180deg); } */
.front,.back { border-radius: 50%; position: absolute; top: 0; left: 0; width: 100%; height: 100%; font-size: 40px; text-align: center; line-height: 200px; }
.front { background-color: #9b6ab5; z-index: 1; }
.back { background-color: #ce485c; transform: rotateY(180deg); }
.box2 { position: relative; height: 35px; width: 100px; margin: 100px auto; transform-style: preserve-3d; transition: all .6s; } .box2:hover{ transform: rotateX(90deg); }
.box2 ul li { list-style: none; height: 35px; width: 100px; }
.b1, .b2 { position: absolute; height: 100%; width: 100%; top: 0; left: 0; border-radius: 6px; text-align: center; line-height: 35px; }
.b1 { background-color: #5757ff; z-index: 1; transform: translateZ(17.5px); }
.b2 { background-color: #268354; transform:translateY(17.5px) rotateX(-90deg); }
section{ width: 156px; height: 502px; position: relative; margin: 50px auto; transform-style: preserve-3d; animation: rotate 5s linear infinite; } @keyframes rotate{ 0%{ transform: rotateY(0); } 100%{ transform: rotateY(360deg); } } section img{ position: absolute; display: block; margin: 0 auto; width: 100%; top: 0; left: 0; } section img:nth-child(1){ transform: translateZ(300px); } section img:nth-child(2){ transform: rotateY(60deg)translateZ(300px) ; } section img:nth-child(3){ transform:rotateY(120deg) translateZ(300px) ; } section img:nth-child(4){ transform:rotateY(180deg) translateZ(300px) ; } section img:nth-child(5){ transform: rotateY(240deg) translateZ(300px); } section img:nth-child(6){ transform:rotateY(300deg) translateZ(300px); }
|