Re: Transitions of CSS images, including transitions of gradients.

On Apr 22, 2010, at 1:42 PM, Linss, Peter wrote:

> On Apr 19, 2010, at 10:56 AM, Simon Fraser wrote:
> 
>> These image generation functions could be used wherever an image is used
>> in CSS, and could be returned by getComputedStlye() for images that are
>> being animated. Note that CSS transitions would not allow you to
>> describe the effect used for image transitions (e.g. wipe vs. cross-fade)
>> without further extension, so you'd get back a cross-fade() for now.
> 
> The more I think about it, the more I really like this idea, but what I'd really like to see is this expanded to cover all animatable properties. So that a getComputedStyle() on any animatable property undergoing a transition (or in the middle of an animation) would return an appropriate functional notation specifying the start value, end value and completion percentage.
> 
> I also want that function to be a valid input value in the original style sheet. So a valid value for any color could be: fade(red, blue, 40%), etc. In addition to keeping the value symmetry, I can see interesting uses for specifying properties this way and driving an animation in script by simply manipulating the percentage value.

But this means that we'd have to change CSS to allow every animatable property to accept this functional notation, as well as the normal values.

The reason for this functional notation is that there's no other way to express a blend between two images. That's not true for the other properties; they can report intermediate values from getComputedStyle() just fine.

Also, there is only one way to blend numeric properties (via interpolation). Images are special, because you can blend two images in a large number of ways.

> Given the direction Anne is taking the CSSValue API, I can also envision an interface for each of these functions where in addition to accessors for the function's arguments, you could have a currentValue (read-only) accessor to get the actual current value.
> 
> 
> One question however, does the percentage returned refer to the input or output percentage of the transition-timing function?

That's a good question. I think you'd have to get back a percentage which is the output from the timing function.

Simon

Received on Thursday, 22 April 2010 21:07:31 UTC