Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
scrubbing: fix paths, web animations api
Browse files Browse the repository at this point in the history
  • Loading branch information
Yvonne Yip committed Aug 24, 2013
1 parent ef9147d commit 8ac8223
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions yvonne/scrubbing/basic-web-anim-scrub.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<title>Simple Scrubbing</title>
<meta name="viewport" content="width=device-width, initial-scale=1,
minimum-scale = 1, maximum-scale = 1,user-scalable=no">
<script src="../../web-animations-js/web-animations.js"></script>
<script src="../../PointerEvents/pointerevents.js"></script>
<script src="../../pointergestures/pointergestures.js"></script>
<script src="../../../web-animations-js/web-animations.js"></script>
<script src="../../../PointerEvents/pointerevents.js"></script>
<script src="../../../PointerGestures/pointergestures.js"></script>
<script src="src/Scrub.js"></script>
<style>
body {
Expand Down Expand Up @@ -85,7 +85,7 @@ <h5>Drag left/right in the box</h5>
{transform: 'translate(800px, 0px) rotate(1440deg)', opacity: 1}
];
var anim2 = new Animation(document.querySelector('#c2'), props2, {
iterationDuration: 3,
duration: 3,
fillMode: 'both'
});

Expand Down
12 changes: 6 additions & 6 deletions yvonne/scrubbing/src/Scrub.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,20 +240,20 @@
playTo: function(inTime, inDuration) {
this.scrubAnimation();
var rate = inDuration ? Math.abs(inTime - t) / inDuration : 1;
var duration = this.animation.specified.iterationDuration;
var duration = this.animation.specified.duration;
var t = this.currentTime;
var reversing = (inTime < t);
if (reversing) {
this.segment = new SeqGroup([
new SeqGroup([this.animation], {direction: 'reverse'})
], {
iterationDuration: (duration - inTime),
duration: (duration - inTime),
playbackRate: rate,
startDelay: -(duration - t)
});
} else {
this.segment = new SeqGroup([this.animation], {
iterationDuration: inTime,
duration: inTime,
playbackRate: rate,
startDelay: -t
});
Expand All @@ -264,8 +264,8 @@
if (this.animation.parent) {
var reversing = this.animation.parent.specified.direction === 'reverse';
var segmentDuration = reversing ?
this.animation.specified.iterationDuration - this.segment.specified.iterationDuration :
this.segment.specified.iterationDuration;
this.animation.specified.duration - this.segment.specified.duration :
this.segment.specified.duration;
// remove animation from segment
this.animation.remove();
this.segment.parent && this.segment.remove();
Expand Down Expand Up @@ -313,7 +313,7 @@
clamp(this.animation.player.currentTime, 0, this.maxTime);
},
get duration() {
return this.animation.iterationDuration;
return this.animation.duration;
},
get maxTime() {
return this.duration - (this.wrap ? 0 : this.nudgeTime);
Expand Down

0 comments on commit 8ac8223

Please sign in to comment.