OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <meta charset="UTF-8"> | 2 <meta charset="UTF-8"> |
3 <style> | 3 <style> |
| 4 .parent { |
| 5 perspective-origin: 30px 10px; |
| 6 } |
4 .target { | 7 .target { |
5 display: inline-block; | 8 display: inline-block; |
6 -webkit-perspective: 50; | 9 -webkit-perspective: 50; |
7 perspective: 50; | 10 perspective: 50; |
8 margin-top: 50px; | 11 margin-top: 50px; |
9 margin-bottom: 25px; | 12 margin-bottom: 25px; |
| 13 perspective-origin: 10px 30px; |
10 } | 14 } |
11 .transformed { | 15 .transformed { |
12 width: 50px; | 16 width: 50px; |
13 height: 50px; | 17 height: 50px; |
14 background: black; | 18 background: black; |
15 transform: rotateY(45deg); | 19 transform: rotateY(45deg); |
16 } | 20 } |
17 .expected .transformed { | 21 .expected .transformed { |
18 background: green; | 22 background: green; |
19 } | 23 } |
20 .expected { | 24 .expected { |
21 position: relative; | 25 position: relative; |
22 left: -50px; | 26 left: -50px; |
23 opacity: 0.75; | 27 opacity: 0.75; |
24 } | 28 } |
25 </style> | 29 </style> |
26 <body> | 30 <body> |
27 <template id="target-template"> | 31 <template id="target-template"> |
28 <div><div class="transformed"></div></div> | 32 <div><div class="transformed"></div></div> |
29 </template> | 33 </template> |
30 <script src="resources/interpolation-test.js"></script> | 34 <script src="resources/interpolation-test.js"></script> |
31 <script> | 35 <script> |
32 assertInterpolation({ | 36 assertInterpolation({ |
33 property: 'perspective-origin', | 37 property: 'perspective-origin', |
| 38 from: '', |
| 39 to: '20px 20px', |
| 40 }, [ |
| 41 {at: -0.3, is: '7px 33px'}, |
| 42 {at: 0, is: '10px 30px'}, |
| 43 {at: 0.3, is: '13px 27px'}, |
| 44 {at: 0.6, is: '16px 24px'}, |
| 45 {at: 1, is: '20px 20px'}, |
| 46 {at: 1.5, is: '25px 15px'}, |
| 47 ]); |
| 48 |
| 49 assertInterpolation({ |
| 50 property: 'perspective-origin', |
| 51 from: 'initial', |
| 52 to: '20px 20px', |
| 53 }, [ |
| 54 {at: -0.3, is: '26.5px 26.5px'}, |
| 55 {at: 0, is: '25px 25px'}, |
| 56 {at: 0.3, is: '23.5px 23.5px'}, |
| 57 {at: 0.6, is: '22px 22px'}, |
| 58 {at: 1, is: '20px 20px'}, |
| 59 {at: 1.5, is: '17.5px 17.5px'}, |
| 60 ]); |
| 61 |
| 62 assertInterpolation({ |
| 63 property: 'perspective-origin', |
| 64 from: 'inherit', |
| 65 to: '20px 20px', |
| 66 }, [ |
| 67 {at: -0.3, is: '33px 7px'}, |
| 68 {at: 0, is: '30px 10px'}, |
| 69 {at: 0.3, is: '27px 13px'}, |
| 70 {at: 0.6, is: '24px 16px'}, |
| 71 {at: 1, is: '20px 20px'}, |
| 72 {at: 1.5, is: '15px 25px'}, |
| 73 ]); |
| 74 |
| 75 assertInterpolation({ |
| 76 property: 'perspective-origin', |
| 77 from: 'unset', |
| 78 to: '20px 20px', |
| 79 }, [ |
| 80 {at: -0.3, is: '26.5px 26.5px'}, |
| 81 {at: 0, is: '25px 25px'}, |
| 82 {at: 0.3, is: '23.5px 23.5px'}, |
| 83 {at: 0.6, is: '22px 22px'}, |
| 84 {at: 1, is: '20px 20px'}, |
| 85 {at: 1.5, is: '17.5px 17.5px'}, |
| 86 ]); |
| 87 |
| 88 assertInterpolation({ |
| 89 property: 'perspective-origin', |
34 from: '0% 50%', | 90 from: '0% 50%', |
35 to: '100% 150%' | 91 to: '100% 150%' |
36 }, [ | 92 }, [ |
37 {at: -0.3, is: '-30% 20%'}, | 93 {at: -0.3, is: '-30% 20%'}, |
38 {at: 0, is: '0% 50%'}, | 94 {at: 0, is: '0% 50%'}, |
39 {at: 0.3, is: '30% 80%'}, | 95 {at: 0.3, is: '30% 80%'}, |
40 {at: 0.6, is: '60% 110%'}, | 96 {at: 0.6, is: '60% 110%'}, |
41 {at: 1, is: '100% 150%'}, | 97 {at: 1, is: '100% 150%'}, |
42 {at: 1.5, is: '150% 200%'} | 98 {at: 1.5, is: '150% 200%'} |
43 ]); | 99 ]); |
44 </script> | 100 </script> |
45 </body> | 101 </body> |
OLD | NEW |