W3C home > Mailing lists > Public > www-style@w3.org > February 2010

Re: [transitions/animations] stepped timing function proposal

From: Chris Marrin <cmarrin@apple.com>
Date: Tue, 23 Feb 2010 15:39:41 -0800
Message-id: <B8F3FF5F-EBDB-40A4-AEA7-CAA190C94615@apple.com>
To: "www-style@w3.org list" <www-style@w3.org>

On Feb 23, 2010, at 2:14 PM, Simon Fraser wrote:

> On Jan 19, 2010, at 2:50 PM, Dean Jackson wrote:
> 
>> I propose a new value for the "animation-timing-function" property, allowing a value to jump instantly from one keyframe to another, rather than be interpolated.
>> 
>> A good example of why this is useful is the progress spinner on OSX which could be implemented as an infinite rotation. Also, this feature is in SMIL/SVG [1] as calcMode="discrete". However, I think we should consider going one step beyond what SMIL suggested and allow the step to happen either at the beginning or end of the keyframe.
>> 
>> jump-start
>>  There is no interpolation. The property instantly changes to the end value as soon as the animation begins.
>> 
>> jump-end
>>  There is no interpolation. The property remains at its start value until the animation ends, at which point it instantly changes to the end value.
> 
> I prefer:
> 
> step-start, step-end;
> 
> I'd also like to extend this proposal to allow the author to specify that the change occurs in a number of discrete, equal steps, rather than just one. This would be achieve by allowing a two new functional values in the transition-timing-function property:
> 
> step-start(<number>), step-end(<number>)
> 
> step-start(1) is equivalent to step-start, and step-end(1) is equivalent to step-end. The functional version does not need to have the same name; suggestions are welcome.
> 
> To explain further, step-start(N) causes the value to change in a series of N steps of equal size. The first step occurs the instant that the transition starts (which is after the delay, if transition-delay is non-zero). The next N-1 steps occur at regular time intervals over the duration of the transition. The property reaches its final value D/N seconds before the end of the transition period, where D is the duration.
> 
> step-end(N) causes the value to change in a series of N steps of equal size. The first step occurs D/N seconds into the transition, where D is the duration, and the remaining steps occur at regular intervals over the remainder of the duration. Thus, the last step occurs at the end of the transition period.

I like the simplicity of this. I would assume that if we apply this to non-numeric properties (e.g., 'display') we would ignore N, always assuming it is 1? Likewise, while the default timing-function for numeric properties is 'ease', the default for non-numeric properties would be 'step-end(1)'?

-----
~Chris
cmarrin@apple.com
Received on Tuesday, 23 February 2010 23:40:14 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:24 GMT