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
|
<!DOCTYPE html>
<meta charset="UTF-8">
<style>
.target {
display: inline-block;
-webkit-perspective: 50;
perspective: 50;
margin-top: 50px;
margin-bottom: 25px;
}
.transformed {
width: 50px;
height: 50px;
background: black;
transform: rotateY(45deg);
}
.expected .transformed {
background: green;
}
.expected {
position: relative;
left: -50px;
opacity: 0.75;
}
</style>
<body>
<template id="target-template">
<div><div class="transformed"></div></div>
</template>
<script src="resources/interpolation-test.js"></script>
<script>
assertInterpolation({
property: '-webkit-perspective-origin',
from: '0% 50%',
to: '100% 150%'
}, [
{at: -0.3, is: '-30% 20%'},
{at: 0, is: '0% 50%'},
{at: 0.3, is: '30% 80%'},
{at: 0.6, is: '60% 110%'},
{at: 1, is: '100% 150%'},
{at: 1.5, is: '150% 200%'}
]);
assertInterpolation({
property: '-webkit-perspective-origin-x',
from: '0%',
to: '100%'
}, [
{at: -0.3, is: '-30%'},
{at: 0, is: '0%'},
{at: 0.3, is: '30%'},
{at: 0.6, is: '60%'},
{at: 1, is: '100%'},
{at: 1.5, is: '150%'}
]);
assertInterpolation({
property: '-webkit-perspective-origin-y',
from: '0%',
to: '100%'
}, [
{at: -0.3, is: '-30%'},
{at: 0, is: '0%'},
{at: 0.3, is: '30%'},
{at: 0.6, is: '60%'},
{at: 1, is: '100%'},
{at: 1.5, is: '150%'}
]);
</script>
</body>
|