<!DOCTYPE html> | |
<meta charset="UTF-8"> | |
<style> | |
.parent { | |
margin-left: 40px; | |
right: 30px; | |
} | |
.target { | |
position: relative; | |
width: 10px; | |
height: 10px; | |
background-color: black; | |
right: 10px; | |
} | |
.expected { | |
background-color: green; | |
} | |
</style> | |
<body> | |
<script src="resources/interpolation-test.js"></script> | |
<script> | |
assertInterpolation({ | |
property: 'right', | |
from: neutralKeyframe, | |
to: '20px', | |
}, [ | |
{at: -0.3, is: '7px'}, | |
{at: 0, is: '10px'}, | |
{at: 0.5, is: '15px'}, | |
{at: 1, is: '20px'}, | |
{at: 1.5, is: '25px'}, | |
]); | |
assertNoInterpolation({ | |
property: 'right', | |
from: 'initial', | |
to: '20px', | |
}); | |
assertInterpolation({ | |
property: 'right', | |
from: 'inherit', | |
to: '20px', | |
}, [ | |
{at: -0.3, is: '33px'}, | |
{at: 0, is: '30px'}, | |
{at: 0.5, is: '25px'}, | |
{at: 1, is: '20px'}, | |
{at: 1.5, is: '15px'}, | |
]); | |
assertNoInterpolation({ | |
property: 'right', | |
from: 'unset', | |
to: '20px', | |
}); | |
assertInterpolation({ | |
property: 'right', | |
from: '-10px', | |
to: '10px' | |
}, [ | |
{at: -0.3, is: '-16px'}, | |
{at: 0, is: '-10px'}, | |
{at: 0.5, is: '0px'}, | |
{at: 1, is: '10px'}, | |
{at: 1.5, is: '20px'} | |
]); | |
</script> | |
</body> |