28
edits
(Update CSS Features.) |
(Fix typo.) |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
== Scroll-driven animations. == | == Scroll-driven animations. == | ||
For previous discussion, see [[Platform/Layout/Extended Timelines|Extended Timeline]]. | For previous discussion, see [[Platform/Layout/Extended Timelines|Extended Timeline]]. | ||
| Line 39: | Line 37: | ||
// example: we have three animations. | // example: we have three animations. | ||
target1.style.animation = "animation1 50s linear | target1.style.animation = "animation1 50s linear Infinite"; | ||
target2.style.animation = "animation2 100s linear | target2.style.animation = "animation2 100s linear Infinite"; | ||
target3.style.animation = "animation3 70s linear 10s";<br/> | target3.style.animation = "animation3 70s linear 10s";<br/> | ||
var anim1 = target1.getAnimations()[0]; | var anim1 = target1.getAnimations()[0]; | ||
| Line 53: | Line 51: | ||
// example: we have two animation which having infinite iterations. | // example: we have two animation which having infinite iterations. | ||
var scrollTimeline = new ScrollTimeline(scrollElem, "vertical"); | var scrollTimeline = new ScrollTimeline(scrollElem, "vertical"); | ||
var keyframe1 = new KeyframeEffect(target, {transform:['none','translate(100px)']}, {duration:1000, iterations: | var keyframe1 = new KeyframeEffect(target, {transform:['none','translate(100px)']}, {duration:1000, iterations:Infinite}); | ||
var keyframe2 = new KeyframeEffect(target, {transform:['none','translate(100px)']}, {duration:3000, iterations: | var keyframe2 = new KeyframeEffect(target, {transform:['none','translate(100px)']}, {duration:3000, iterations:Infinite});<br/> | ||
var anim1 = new Animation(keyframe1, scrollTimeline); | var anim1 = new Animation(keyframe1, scrollTimeline); | ||
var anim2 = new Animation(keyframe2, scrollTimeline);<br/> | var anim2 = new Animation(keyframe2, scrollTimeline);<br/> | ||
| Line 61: | Line 59: | ||
// example: we have two infinite animations and specified scroll range. | // example: we have two infinite animations and specified scroll range. | ||
var scrollTimeline = new ScrollTimeline(scrollElem, "vertical", 2000); | var scrollTimeline = new ScrollTimeline(scrollElem, "vertical", 2000); | ||
var keyframe1 = new KeyframeEffect(target, {transform:['none','translate(100px)']}, {duration:1000, iterations: | var keyframe1 = new KeyframeEffect(target, {transform:['none','translate(100px)']}, {duration:1000, iterations:Infinite}; | ||
var keyframe2 = new KeyframeEffect(target, {transform:['none','translate(100px)']}, {duration:3000, iterations: | var keyframe2 = new KeyframeEffect(target, {transform:['none','translate(100px)']}, {duration:3000, iterations:Infinite};<br/> | ||
var anim1 = new Animation(keyframe1, scrollTimeline); | var anim1 = new Animation(keyframe1, scrollTimeline); | ||
var anim2 = new Animation(keyframe2, scrollTimeline);<br/> | var anim2 = new Animation(keyframe2, scrollTimeline);<br/> | ||
| Line 86: | Line 84: | ||
== Implement overview == | == Implement overview == | ||
We need to implement several features as follow. | We need to implement several features as follow. | ||
- Notify the scroll value to ScrollTimeline from scroll containers. | - Notify the scroll value to related ScrollTimeline from scroll containers. | ||
- (ScrollTimeline requests to scroll container for receivable scroll notification?) | |||
- ScrollTimeline should implement AnimationTimeline interface and RefreshObserver interface. | - ScrollTimeline should implement AnimationTimeline interface and RefreshObserver interface. | ||
- ScrollTimeline | - ScrollTimeline needs to remain the scroll value which notified from scroll container in order to calculate several times when tick. | ||
- ScrollTimeline | - ScrollTimeline needs to override AnimationTimeline::GetCurrentTime in order to notify current progress of animation to own animations. | ||
[Consideration] | |||
- How notify the scroll value from parent to child process? Especially e10s environment. | |||
edits