{"id":629,"date":"2017-04-28T15:37:15","date_gmt":"2017-04-28T07:37:15","guid":{"rendered":"http:\/\/loveuhouse.cn\/wordpress\/?p=629"},"modified":"2017-04-28T15:37:15","modified_gmt":"2017-04-28T07:37:15","slug":"%e7%bc%93%e5%8a%a8%e5%87%bd%e6%95%b0%e8%ae%a1%e7%ae%97%e5%85%ac%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/loveuhouse.cn\/wordpress\/?p=629","title":{"rendered":"\u7f13\u52a8\u51fd\u6570\u8ba1\u7b97\u516c\u5f0f"},"content":{"rendered":"<pre class=\"lang:js decode:true\">\n    \/**\n* \u7f13\u52a8\u8ba1\u7b97\u516c\u5f0f\n*\/\nvar Tween = {\n    Linear: function(t, b, c, d) {\n        return c * t \/ d + b;\n    },\n    Quad: {\n        easeIn: function(t, b, c, d) {\n            return c * (t \/= d) * t + b;\n        },\n        easeOut: function(t, b, c, d) {\n            return - c * (t \/= d) * (t - 2) + b;\n        },\n        easeInOut: function(t, b, c, d) {\n            if ((t \/= d \/ 2) < 1) return c \/ 2 * t * t + b;\n            return - c \/ 2 * ((--t) * (t - 2) - 1) + b;\n        }\n    },\n    Cubic: {\n        easeIn: function(t, b, c, d) {\n            return c * (t \/= d) * t * t + b;\n        },\n        easeOut: function(t, b, c, d) {\n            return c * ((t = t \/ d - 1) * t * t + 1) + b;\n        },\n        easeInOut: function(t, b, c, d) {\n            if ((t \/= d \/ 2) < 1) return c \/ 2 * t * t * t + b;\n            return c \/ 2 * ((t -= 2) * t * t + 2) + b;\n        }\n    },\n    Quart: {\n        easeIn: function(t, b, c, d) {\n            return c * (t \/= d) * t * t * t + b;\n        },\n        easeOut: function(t, b, c, d) {\n            return - c * ((t = t \/ d - 1) * t * t * t - 1) + b;\n        },\n        easeInOut: function(t, b, c, d) {\n            if ((t \/= d \/ 2) < 1) return c \/ 2 * t * t * t * t + b;\n            return - c \/ 2 * ((t -= 2) * t * t * t - 2) + b;\n        }\n    },\n    Quint: {\n        easeIn: function(t, b, c, d) {\n            return c * (t \/= d) * t * t * t * t + b;\n        },\n        easeOut: function(t, b, c, d) {\n            return c * ((t = t \/ d - 1) * t * t * t * t + 1) + b;\n        },\n        easeInOut: function(t, b, c, d) {\n            if ((t \/= d \/ 2) < 1) return c \/ 2 * t * t * t * t * t + b;\n            return c \/ 2 * ((t -= 2) * t * t * t * t + 2) + b;\n        }\n    },\n    Sine: {\n        easeIn: function(t, b, c, d) {\n            return - c * Math.cos(t \/ d * (Math.PI \/ 2)) + c + b;\n        },\n        easeOut: function(t, b, c, d) {\n            return c * Math.sin(t \/ d * (Math.PI \/ 2)) + b;\n        },\n        easeInOut: function(t, b, c, d) {\n            return - c \/ 2 * (Math.cos(Math.PI * t \/ d) - 1) + b;\n        }\n    },\n    Expo: {\n        easeIn: function(t, b, c, d) {\n            return (t == 0) ? b: c * Math.pow(2, 10 * (t \/ d - 1)) + b;\n        },\n        easeOut: function(t, b, c, d) {\n            return (t == d) ? b + c: c * ( - Math.pow(2, -10 * t \/ d) + 1) + b;\n        },\n        easeInOut: function(t, b, c, d) {\n            if (t == 0) return b;\n            if (t == d) return b + c;\n            if ((t \/= d \/ 2) < 1) return c \/ 2 * Math.pow(2, 10 * (t - 1)) + b;\n            return c \/ 2 * ( - Math.pow(2, -10 * --t) + 2) + b;\n        }\n    },\n    Circ: {\n        easeIn: function(t, b, c, d) {\n            return - c * (Math.sqrt(1 - (t \/= d) * t) - 1) + b;\n        },\n        easeOut: function(t, b, c, d) {\n            return c * Math.sqrt(1 - (t = t \/ d - 1) * t) + b;\n        },\n        easeInOut: function(t, b, c, d) {\n            if ((t \/= d \/ 2) < 1) return - c \/ 2 * (Math.sqrt(1 - t * t) - 1) + b;\n            return c \/ 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b;\n        }\n    },\n    Elastic: {\n        easeIn: function(t, b, c, d, a, p) {\n            if (t == 0) return b;\n            if ((t \/= d) == 1) return b + c;\n            if (!p) p = d * .3;\n            if (!a || a < Math.abs(c)) {\n                a = c;\n                var s = p \/ 4;\n            } else var s = p \/ (2 * Math.PI) * Math.asin(c \/ a);\n            return - (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) \/ p)) + b;\n        },\n        easeOut: function(t, b, c, d, a, p) {\n            if (t == 0) return b;\n            if ((t \/= d) == 1) return b + c;\n            if (!p) p = d * .3;\n            if (!a || a < Math.abs(c)) {\n                a = c;\n                var s = p \/ 4;\n            } else var s = p \/ (2 * Math.PI) * Math.asin(c \/ a);\n            return (a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) \/ p) + c + b);\n        },\n        easeInOut: function(t, b, c, d, a, p) {\n            if (t == 0) return b;\n            if ((t \/= d \/ 2) == 2) return b + c;\n            if (!p) p = d * (.3 * 1.5);\n            if (!a || a < Math.abs(c)) {\n                a = c;\n                var s = p \/ 4;\n            } else var s = p \/ (2 * Math.PI) * Math.asin(c \/ a);\n            if (t < 1) return - .5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) \/ p)) + b;\n            return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) \/ p) * .5 + c + b;\n        }\n    },\n    Back: {\n        easeIn: function(t, b, c, d, s) {\n            if (s == undefined) s = 1.70158;\n            return c * (t \/= d) * t * ((s + 1) * t - s) + b;\n        },\n        easeOut: function(t, b, c, d, s) {\n            if (s == undefined) s = 1.70158;\n            return c * ((t = t \/ d - 1) * t * ((s + 1) * t + s) + 1) + b;\n        },\n        easeInOut: function(t, b, c, d, s) {\n            if (s == undefined) s = 1.70158;\n            if ((t \/= d \/ 2) < 1) return c \/ 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;\n            return c \/ 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;\n        }\n    },\n    Bounce: {\n        easeIn: function(t, b, c, d) {\n            return c - Tween.Bounce.easeOut(d - t, 0, c, d) + b;\n        },\n        easeOut: function(t, b, c, d) {\n            if ((t \/= d) < (1 \/ 2.75)) {\n                return c * (7.5625 * t * t) + b;\n            } else if (t < (2 \/ 2.75)) {\n                return c * (7.5625 * (t -= (1.5 \/ 2.75)) * t + .75) + b;\n            } else if (t < (2.5 \/ 2.75)) {\n                return c * (7.5625 * (t -= (2.25 \/ 2.75)) * t + .9375) + b;\n            } else {\n                return c * (7.5625 * (t -= (2.625 \/ 2.75)) * t + .984375) + b;\n            }\n        },\n        easeInOut: function(t, b, c, d) {\n            if (t < d \/ 2) return Tween.Bounce.easeIn(t * 2, 0, c, d) * .5 + b;\n            else return Tween.Bounce.easeOut(t * 2 - d, 0, c, d) * .5 + c * .5 + b;\n        }\n    }\n}\n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\/** * \u7f13\u52a8\u8ba1\u7b97\u516c\u5f0f *\/ var Tween = { Linear: function(t, b, c, &hellip; <a href=\"https:\/\/loveuhouse.cn\/wordpress\/?p=629\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u7f13\u52a8\u51fd\u6570\u8ba1\u7b97\u516c\u5f0f<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/loveuhouse.cn\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/629"}],"collection":[{"href":"https:\/\/loveuhouse.cn\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/loveuhouse.cn\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/loveuhouse.cn\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/loveuhouse.cn\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=629"}],"version-history":[{"count":1,"href":"https:\/\/loveuhouse.cn\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/629\/revisions"}],"predecessor-version":[{"id":630,"href":"https:\/\/loveuhouse.cn\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/629\/revisions\/630"}],"wp:attachment":[{"href":"https:\/\/loveuhouse.cn\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=629"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/loveuhouse.cn\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=629"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/loveuhouse.cn\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=629"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}