change acceleration, preload one more timeline tile

This commit is contained in:
rlx 2018-01-12 14:52:42 +01:00
parent 7381bfb955
commit b25939875e

8
icf.js
View file

@ -9,13 +9,13 @@ let timelinesLeft
let timelineLink = document.getElementById('link') let timelineLink = document.getElementById('link')
let timelineLinkEntered = false let timelineLinkEntered = false
let fps = 25
let fpsAnimation = 60
let paused = true let paused = true
let speed = 0 let speed = 0
let acceleration = 0 let acceleration = 0
let maxSpeed = 2 let maxSpeed = 2
let maxAcceleration = maxSpeed / 100 let maxAcceleration = 1 / fpsAnimation
let fps = 25
let fpsAnimation = 60
function api(action, data, callback) { function api(action, data, callback) {
fetch('https://indiancine.ma/api/', { fetch('https://indiancine.ma/api/', {
@ -154,7 +154,7 @@ function renderTimeline() {
left: timelines[0].left - timelineWidth left: timelines[0].left - timelineWidth
}) })
} }
while (last(timelines).left + timelineWidth < windowWidth) { while (last(timelines).left < windowWidth) {
timelines.push({ timelines.push({
index: mod(last(timelines).index + 1, timelineTiles), index: mod(last(timelines).index + 1, timelineTiles),
left: last(timelines).left + timelineWidth left: last(timelines).left + timelineWidth