I'm currently trying to learn how to use cubic-bezier(), but I'm a bit struggling.
As far as I understood, it helps create a Bezier curve, which consists of 4 points, let's say P0, p1, p2, p3.
P0 and p3 have the coordinates (0, 0) respectively (1, 1) and they represent the starting and ending point of the curve.
X represents time, Y represents progression.
So if my function looks like
transition-timing-function: cubic-bezier(0.7, 0.2, 1, 1);
shouldn't my animation be really slow until 7/10 of the transition-time (so at 7/10 of the transition-time I get 0.2 of the progression) and very fast for the rest of the time? (so the part from 7/10 -> 10/10 of the time should have 0.8 of the animation - so it should be pretty fast)
That's how I assume it is working and actually it doesn't. Here's my code
.transitionTest {
width: 200px;
height: 200px;
background-color: blue;
margin: 100px 0 0 100px;
transition-property: all;
transition-duration: 2s;
transition-timing-function: cubic-bezier(0.7, 0.2, 1, 1);
}
.transitionTest:hover {
transform: rotate(180deg);
background-color: red;
width: 100px;
height: 100px;
}
<div class="transitionTest"></div>
Also, what happens if I use negative values in this function?