summaryrefslogtreecommitdiffstats
path: root/src/animation
diff options
context:
space:
mode:
Diffstat (limited to 'src/animation')
-rw-r--r--src/animation/Controller.js2
-rw-r--r--src/animation/Morphable.js4
-rw-r--r--src/animation/Runner.js20
-rw-r--r--src/animation/Timeline.js20
4 files changed, 23 insertions, 23 deletions
diff --git a/src/animation/Controller.js b/src/animation/Controller.js
index 6cf58cd..35fa1ae 100644
--- a/src/animation/Controller.js
+++ b/src/animation/Controller.js
@@ -16,7 +16,7 @@ function makeSetterGetter (k, f) {
}
}
-export let easing = {
+export const easing = {
'-': function (pos) {
return pos
},
diff --git a/src/animation/Morphable.js b/src/animation/Morphable.js
index 0f191c9..93debe7 100644
--- a/src/animation/Morphable.js
+++ b/src/animation/Morphable.js
@@ -211,8 +211,8 @@ export class ObjectBag {
objOrArr = objOrArr || {}
var entries = []
- for (let i in objOrArr) {
- entries.push([i, objOrArr[i]])
+ for (const i in objOrArr) {
+ entries.push([ i, objOrArr[i] ])
}
entries.sort((a, b) => {
diff --git a/src/animation/Runner.js b/src/animation/Runner.js
index fb64005..9568b70 100644
--- a/src/animation/Runner.js
+++ b/src/animation/Runner.js
@@ -185,7 +185,7 @@ export default class Runner extends EventTarget {
if (time == null) {
return this._time
}
- let dt = time - this._time
+ const dt = time - this._time
this.step(dt)
return this
}
@@ -373,7 +373,7 @@ export default class Runner extends EventTarget {
if (this._history[method]) {
// if the last method wasnt even initialised, throw it away
if (!this._history[method].caller.initialised) {
- let index = this._queue.indexOf(this._history[method].caller)
+ const index = this._queue.indexOf(this._history[method].caller)
this._queue.splice(index, 1)
return false
}
@@ -513,8 +513,8 @@ const getRunnerTransform = (runner) => runner.transforms
function mergeTransforms () {
// Find the matrix to apply to the element and apply it
- let runners = this._transformationRunners.runners
- let netTransform = runners
+ const runners = this._transformationRunners.runners
+ const netTransform = runners
.map(getRunnerTransform)
.reduce(lmultiply, new Matrix())
@@ -535,7 +535,7 @@ class RunnerArray {
add (runner) {
if (this.runners.includes(runner)) return
- let id = runner.id + 1
+ const id = runner.id + 1
this.runners.push(runner)
this.ids.push(id)
@@ -548,7 +548,7 @@ class RunnerArray {
}
remove (id) {
- let index = this.ids.indexOf(id + 1)
+ const index = this.ids.indexOf(id + 1)
this.ids.splice(index, 1)
this.runners.splice(index, 1)
return this
@@ -577,7 +577,7 @@ class RunnerArray {
}
edit (id, newRunner) {
- let index = this.ids.indexOf(id + 1)
+ const index = this.ids.indexOf(id + 1)
this.ids.splice(index, 1, id + 1)
this.runners.splice(index, 1, newRunner)
return this
@@ -588,7 +588,7 @@ class RunnerArray {
}
clearBefore (id) {
- let deleteCnt = this.ids.indexOf(id + 1) || 1
+ const deleteCnt = this.ids.indexOf(id + 1) || 1
this.ids.splice(0, deleteCnt, 0)
this.runners.splice(0, deleteCnt, new FakeRunner())
.forEach((r) => r.clearTransformsFromQueue())
@@ -760,7 +760,7 @@ extend(Runner, {
// on this runner. We are absolute. We dont need these!
if (!relative) this.clearTransform()
- let { x, y } = new Point(origin).transform(element._currentTransform(this))
+ const { x, y } = new Point(origin).transform(element._currentTransform(this))
let target = new Matrix({ ...transforms, origin: [ x, y ] })
let start = this._isDeclarative && current
@@ -797,7 +797,7 @@ extend(Runner, {
morpher.from(start)
morpher.to(target)
- let affineParameters = morpher.at(pos)
+ const affineParameters = morpher.at(pos)
currentAngle = affineParameters.rotate
current = new Matrix(affineParameters)
diff --git a/src/animation/Timeline.js b/src/animation/Timeline.js
index d09deef..2137727 100644
--- a/src/animation/Timeline.js
+++ b/src/animation/Timeline.js
@@ -11,7 +11,7 @@ var makeSchedule = function (runnerInfo) {
}
const defaultSource = function () {
- let w = globals.window
+ const w = globals.window
return (w.performance || w.Date).now()
}
@@ -68,7 +68,7 @@ export default class Timeline extends EventTarget {
} else if (when === 'now') {
absoluteStartTime = this._time
} else if (when === 'relative') {
- let runnerInfo = this._runners[runner.id]
+ const runnerInfo = this._runners[runner.id]
if (runnerInfo) {
absoluteStartTime = runnerInfo.start + delay
delay = 0
@@ -121,10 +121,10 @@ export default class Timeline extends EventTarget {
getEndTimeOfTimeline () {
let lastEndTime = 0
for (var i = 0; i < this._runners.length; i++) {
- let runnerInfo = this._runners[i]
+ const runnerInfo = this._runners[i]
var duration = runnerInfo ? runnerInfo.runner.duration() : 0
var startTime = runnerInfo ? runnerInfo.start : 0
- let endTime = startTime + duration
+ const endTime = startTime + duration
if (endTime > lastEndTime) {
lastEndTime = endTime
}
@@ -232,12 +232,12 @@ export default class Timeline extends EventTarget {
// this can be solved by reseting them backwards
for (var k = this._runners.length; k--;) {
// Get and run the current runner and ignore it if its inactive
- let runnerInfo = this._runners[k]
- let runner = runnerInfo.runner
+ const runnerInfo = this._runners[k]
+ const runner = runnerInfo.runner
// Make sure that we give the actual difference
// between runner start time and now
- let dtToStart = this._time - runnerInfo.start
+ const dtToStart = this._time - runnerInfo.start
// Dont run runner if not started yet
// and try to reset it
@@ -250,13 +250,13 @@ export default class Timeline extends EventTarget {
var runnersLeft = false
for (var i = 0, len = this._runners.length; i < len; i++) {
// Get and run the current runner and ignore it if its inactive
- let runnerInfo = this._runners[i]
- let runner = runnerInfo.runner
+ const runnerInfo = this._runners[i]
+ const runner = runnerInfo.runner
let dt = dtTime
// Make sure that we give the actual difference
// between runner start time and now
- let dtToStart = this._time - runnerInfo.start
+ const dtToStart = this._time - runnerInfo.start
// Dont run runner if not started yet
if (dtToStart <= 0) {