替换var 为const/let

删除未使用import
替换 == 为 ===
This commit is contained in:
xingyu4j
2022-11-08 13:31:08 +08:00
parent c9e11e7636
commit 011dc23699
66 changed files with 305 additions and 319 deletions

View File

@ -8,8 +8,10 @@ Math.easeInOutQuad = function(t, b, c, d) {
}
// requestAnimationFrame for Smart Animating http://goo.gl/sx5sts
var requestAnimFrame = (function() {
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) { window.setTimeout(callback, 1000 / 60) }
const requestAnimFrame = (function() {
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) {
window.setTimeout(callback, 1000 / 60)
}
})()
/**
@ -37,11 +39,11 @@ export function scrollTo(to, duration, callback) {
const increment = 20
let currentTime = 0
duration = (typeof (duration) === 'undefined') ? 500 : duration
var animateScroll = function() {
const animateScroll = function() {
// increment the time
currentTime += increment
// find the value with the quadratic in-out easing function
var val = Math.easeInOutQuad(currentTime, start, change, duration)
const val = Math.easeInOutQuad(currentTime, start, change, duration)
// move the document.body
move(val)
// do the animation unless its over