aboutsummaryrefslogtreecommitdiffstats
path: root/tests/html/test_3d_transform_2.html
blob: b585831a52ccfb4f2b79435b2ffaf6173244c3ea (plain) (blame)
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
<!DOCTYPE html>
<html>
    <head>
        <style type="text/css">
            .pers200 {
              perspective: 200px;
            }

            .pers500 {
                perspective: 500px;
            }

            .container {
              //background-color: red;
               width: 200px;
               height: 200px;
               margin: 75px 0 0 75px;
               //border: 1px solid red;
            }
            .cube {
              //background-color: green;
               width: 100%;
               height: 100%;
               backface-visibility: visible;
               perspective-origin: 150% 150%;
               transform-style: preserve-3d;
            }
            .face {
               display: block;
               position: absolute;
               width: 100px;
               height: 100px;
               border: none;
               line-height: 100px;
               font-family: sans-serif;
               font-size: 60px;
               color: white;
               text-align: center;
            }

            /* Define each face based on direction */
             .front {
               background: rgba(1, 1, 1, 0.5);
               transform: translateZ(50px);
            }
            .back {
               background: rgba(0, 255, 0, 0.5);
               color: black;
               transform: rotateY(180deg) translateZ(50px);
            }
            .right {
               background: rgba(196, 0, 0, 0.7);
               transform: rotateY(90deg) translateZ(50px);
            }
            .left {
               background: rgba(0, 0, 196, 0.7);
               transform: rotateY(-90deg) translateZ(50px);
            }
            .top {
               background: rgba(196, 196, 0, 0.7);
               transform: rotateX(90deg) translateZ(50px);
            }
            .bottom {
               background: rgba(196, 0, 196, 0.7);
               transform: rotateX(-90deg) translateZ(50px);
            }
        </style>
    </head>
    <body>
        <div class="container">
           <div class="cube pers500">
              <div class="face front"></div>
              <div class="face back"></div>
              <div class="face right"></div>
              <div class="face left"></div>
              <div class="face top"></div>
              <div class="face bottom"></div>
           </div>
        </div>
    </body>
</html>