css3-翻盖显示

"Hello World, Hello Blog"

Posted by wudimingwo on December 15, 2018
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
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewprot" content="width=device-width, initial-scale=1.0"/>
        <meta http-equiv="X-UA-Compatible" content="ie=edge"/>
        <title>dddd</title>
        <style type="text/css">
            
            .wrapper{
              position: relative;
              
              transform-style: preserve-3d;
              transform-origin: center;
              perspective: 700px;
              
              width: 200px;
              height: 200px;
              margin: 150px auto;
            }
            .wrapper div{
              position: absolute;
              
              width: 100%;
              height: 100%;
              border-radius: 15px;
              
              font: 30px/200px "微软雅黑";
              font-weight: bold;
              color: #545652;
              text-align: center;
            }
            
            .top{
              background-color: lightblue;
              transform-origin: bottom left;
              transition: all 0.5s ease;
              /*backface-visibility: hidden;*/
            }
            .bottom{
              background-color: rgba(240,128,128,0.8);
            }
            
            .wrapper:hover .top{
              transform: rotate3d(1,1,0,-180deg);
              opacity: 0.3;
            }
        </style>
    </head>
    <body>
         <div class="wrapper">
           <div class="bottom">bottom</div>
           <div class="top">top</div>
         </div>
        <script type="text/javascript">
                
        </script>
    </body>
</html>