From dd296bf3d82b3bae76476248995cc1c39939b328 Mon Sep 17 00:00:00 2001 From: Brett Zamir Date: Thu, 6 Aug 2020 20:24:54 +0800 Subject: [PATCH 1/3] - Remove bower (deprecated) --- bower.json | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 bower.json diff --git a/bower.json b/bower.json deleted file mode 100644 index 754ffc4..0000000 --- a/bower.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "jquery.easing", - "main": "jquery.easing.js", - "version": "1.4.1", - "homepage": "https://github.com/gdsmith/jquery.easing", - "authors": [ - "George McGinley Smith " - ], - "description": "A jQuery plugin from GSGD to give advanced easing options", - "keywords": [ - "easing", - "ease", - "tween", - "keyframe", - "timeline", - "animation", - "jquery-plugin", - "ecosystem:jquery" - ], - "dependencies": { - "jquery": ">= 1.3.0" - }, - "license": "BSD-3-Clause", - "ignore": [ - "**/.*", - "example" - ] -} From ffed806776b63e2043ab8fa55c723ed39ccf1557 Mon Sep 17 00:00:00 2001 From: Brett Zamir Date: Thu, 6 Aug 2020 18:30:10 +0800 Subject: [PATCH 2/3] - Refactoring: Switch to ES6 Modules in source --- .eslintignore | 1 + .eslintrc.js | 11 ++- package-lock.json | 200 +++++++++++++++++++++++++++++++++++++++++++ package.json | 3 + src/jquery.easing.js | 156 +++++++++++++++++++++++++++++++++ 5 files changed, 370 insertions(+), 1 deletion(-) create mode 100644 src/jquery.easing.js diff --git a/.eslintignore b/.eslintignore index 61767c3..9ed8fc6 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1,2 @@ jquery.easing.min.js +jquery.easing.js diff --git a/.eslintrc.js b/.eslintrc.js index 93f3de4..5227b6f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -6,12 +6,18 @@ module.exports = { env: { es6: true }, + parserOptions: { + sourceType: 'module' + }, overrides: [ { files: '.eslintrc.js', env: { node: true }, + parserOptions: { + sourceType: 'script' + }, rules: { strict: ['error'] } @@ -20,7 +26,10 @@ module.exports = { files: 'example/**', env: { browser: true - } + }, + parserOptions: { + sourceType: 'script' + }, }, { files: '*.md', diff --git a/package-lock.json b/package-lock.json index 064b53d..c2f42b8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,15 @@ "@babel/highlight": "^7.10.4" } }, + "@babel/helper-module-imports": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz", + "integrity": "sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw==", + "dev": true, + "requires": { + "@babel/types": "^7.10.4" + } + }, "@babel/helper-validator-identifier": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", @@ -43,6 +52,38 @@ } } }, + "@babel/types": { + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.0.tgz", + "integrity": "sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.19", + "to-fast-properties": "^2.0.0" + } + }, + "@rollup/plugin-babel": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.1.0.tgz", + "integrity": "sha512-zXBEYmfiLAMvB+ZBa6m/q9hsQYAq1sUFdjuP1F6C2pf6uQcpHwAWQveZgzS63zXdKPUYHD3Dr7BhjCqcr0bbLw==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.7.4", + "@rollup/pluginutils": "^3.0.8" + } + }, + "@rollup/pluginutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", + "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", + "dev": true, + "requires": { + "@types/estree": "0.0.39", + "estree-walker": "^1.0.1", + "picomatch": "^2.2.2" + } + }, "@tokenizer/token": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.1.1.tgz", @@ -61,12 +102,24 @@ "integrity": "sha512-Q1y515GcOdTHgagaVFhHnIFQ38ygs/kmxdNpvpou+raI9UO3YZcHDngBSYKQklcKlvA7iuQlmIKbzvmxcOE9CQ==", "dev": true }, + "@types/estree": { + "version": "0.0.39", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", + "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", + "dev": true + }, "@types/minimist": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY=", "dev": true }, + "@types/node": { + "version": "14.0.27", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.27.tgz", + "integrity": "sha512-kVrqXhbclHNHGu9ztnAwSncIgJv/FaxmzXJvGXNdcCpV1b8u1/Mi6z6m0vwy0LzKeXFTPLH0NzwmoJ3fNCIq0g==", + "dev": true + }, "@types/normalize-package-data": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", @@ -295,6 +348,12 @@ "concat-map": "0.0.1" } }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, "bytes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", @@ -512,6 +571,12 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, "compressible": { "version": "2.0.18", "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", @@ -840,6 +905,12 @@ "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true }, + "estree-walker": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", + "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", + "dev": true + }, "esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -993,6 +1064,13 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, + "fsevents": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "dev": true, + "optional": true + }, "functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", @@ -1247,6 +1325,34 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, + "jest-worker": { + "version": "26.2.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.2.1.tgz", + "integrity": "sha512-+XcGMMJDTeEGncRb5M5Zq9P7K4sQ1sirhjdOxsN1462h6lFo9w59bl2LVQmdGEEeU3m+maZCkS2Tcc9SfCHO4A==", + "dev": true, + "requires": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^7.0.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "jquery": { "version": "3.5.1", "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz", @@ -1405,6 +1511,12 @@ } } }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, "mime-db": { "version": "1.44.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", @@ -1689,6 +1801,12 @@ "integrity": "sha512-KGuODSTV6hcgdZvDrIDBUkN0utcAVj1LL7FfGbM0viKTtCHmtZcuEJ+lGqsp0fTFkGqesdtemV2yUSMeyy3ddA==", "dev": true }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true + }, "prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -1719,6 +1837,15 @@ "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", "dev": true }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, "range-parser": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", @@ -1885,6 +2012,27 @@ "glob": "^7.1.3" } }, + "rollup": { + "version": "2.23.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.23.0.tgz", + "integrity": "sha512-vLNmZFUGVwrnqNAJ/BvuLk1MtWzu4IuoqsH9UWK5AIdO3rt8/CSiJNvPvCIvfzrbNsqKbNzPAG1V2O4eTe2XZg==", + "dev": true, + "requires": { + "fsevents": "~2.1.2" + } + }, + "rollup-plugin-terser": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-6.1.0.tgz", + "integrity": "sha512-4fB3M9nuoWxrwm39habpd4hvrbrde2W2GG4zEGPQg1YITNkM3Tqur5jSuXlWNzbv/2aMLJ+dZJaySc3GCD8oDw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.8.3", + "jest-worker": "^26.0.0", + "serialize-javascript": "^3.0.0", + "terser": "^4.7.0" + } + }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -1897,6 +2045,15 @@ "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", "dev": true }, + "serialize-javascript": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-3.1.0.tgz", + "integrity": "sha512-JIJT1DGiWmIKhzRsG91aS6Ze4sFUrYbltlkg2onR5OrnNM02Kl/hnY/T4FN2omvyeBbQmMJv+K4cPOpGzOTFBg==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, "serve": { "version": "11.3.2", "resolved": "https://registry.npmjs.org/serve/-/serve-11.3.2.tgz", @@ -2016,6 +2173,24 @@ "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true }, + "source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, "spdx-correct": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", @@ -2186,12 +2361,37 @@ "execa": "^0.7.0" } }, + "terser": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz", + "integrity": "sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==", + "dev": true, + "requires": { + "commander": "^2.20.0", + "source-map": "~0.6.1", + "source-map-support": "~0.5.12" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + }, "token-types": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/token-types/-/token-types-2.0.0.tgz", diff --git a/package.json b/package.json index 0486878..2714a13 100644 --- a/package.json +++ b/package.json @@ -32,11 +32,14 @@ "engines": {}, "dependencies": {}, "devDependencies": { + "@rollup/plugin-babel": "^5.1.0", "eslint": "^7.6.0", "eslint-plugin-html": "^6.0.2", "eslint-plugin-markdown": "^1.0.2", "jquery": ">=1.3.0", "open-cli": "^6.0.1", + "rollup": "^2.23.0", + "rollup-plugin-terser": "^6.1.0", "serve": "^11.3.2", "uglify-js": "^2.6.2" }, diff --git a/src/jquery.easing.js b/src/jquery.easing.js new file mode 100644 index 0000000..1859621 --- /dev/null +++ b/src/jquery.easing.js @@ -0,0 +1,156 @@ +/* + * jQuery Easing v1.4.1 - http://gsgd.co.uk/sandbox/jquery/easing/ + * Open source under the BSD License. + * Copyright © 2008 George McGinley Smith + * All rights reserved. + * https://raw.github.com/gdsmith/jquery.easing/master/LICENSE +*/ + +export default function ($) { + // Preserve the original jQuery "swing" easing as "jswing" + if (typeof $.easing !== 'undefined') { + $.easing['jswing'] = $.easing['swing']; + } + + var pow = Math.pow, + sqrt = Math.sqrt, + sin = Math.sin, + cos = Math.cos, + PI = Math.PI, + c1 = 1.70158, + c2 = c1 * 1.525, + c3 = c1 + 1, + c4 = ( 2 * PI ) / 3, + c5 = ( 2 * PI ) / 4.5; + + // x is the fraction of animation progress, in the range 0..1 + function bounceOut(x) { + var n1 = 7.5625, + d1 = 2.75; + if ( x < 1/d1 ) { + return n1*x*x; + } else if ( x < 2/d1 ) { + return n1*(x-=(1.5/d1))*x + .75; + } else if ( x < 2.5/d1 ) { + return n1*(x-=(2.25/d1))*x + .9375; + } else { + return n1*(x-=(2.625/d1))*x + .984375; + } + } + + $.extend( $.easing, { + def: 'easeOutQuad', + swing: function (x) { + return $.easing[$.easing.def](x); + }, + easeInQuad: function (x) { + return x * x; + }, + easeOutQuad: function (x) { + return 1 - ( 1 - x ) * ( 1 - x ); + }, + easeInOutQuad: function (x) { + return x < 0.5 ? + 2 * x * x : + 1 - pow( -2 * x + 2, 2 ) / 2; + }, + easeInCubic: function (x) { + return x * x * x; + }, + easeOutCubic: function (x) { + return 1 - pow( 1 - x, 3 ); + }, + easeInOutCubic: function (x) { + return x < 0.5 ? + 4 * x * x * x : + 1 - pow( -2 * x + 2, 3 ) / 2; + }, + easeInQuart: function (x) { + return x * x * x * x; + }, + easeOutQuart: function (x) { + return 1 - pow( 1 - x, 4 ); + }, + easeInOutQuart: function (x) { + return x < 0.5 ? + 8 * x * x * x * x : + 1 - pow( -2 * x + 2, 4 ) / 2; + }, + easeInQuint: function (x) { + return x * x * x * x * x; + }, + easeOutQuint: function (x) { + return 1 - pow( 1 - x, 5 ); + }, + easeInOutQuint: function (x) { + return x < 0.5 ? + 16 * x * x * x * x * x : + 1 - pow( -2 * x + 2, 5 ) / 2; + }, + easeInSine: function (x) { + return 1 - cos( x * PI/2 ); + }, + easeOutSine: function (x) { + return sin( x * PI/2 ); + }, + easeInOutSine: function (x) { + return -( cos( PI * x ) - 1 ) / 2; + }, + easeInExpo: function (x) { + return x === 0 ? 0 : pow( 2, 10 * x - 10 ); + }, + easeOutExpo: function (x) { + return x === 1 ? 1 : 1 - pow( 2, -10 * x ); + }, + easeInOutExpo: function (x) { + return x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ? + pow( 2, 20 * x - 10 ) / 2 : + ( 2 - pow( 2, -20 * x + 10 ) ) / 2; + }, + easeInCirc: function (x) { + return 1 - sqrt( 1 - pow( x, 2 ) ); + }, + easeOutCirc: function (x) { + return sqrt( 1 - pow( x - 1, 2 ) ); + }, + easeInOutCirc: function (x) { + return x < 0.5 ? + ( 1 - sqrt( 1 - pow( 2 * x, 2 ) ) ) / 2 : + ( sqrt( 1 - pow( -2 * x + 2, 2 ) ) + 1 ) / 2; + }, + easeInElastic: function (x) { + return x === 0 ? 0 : x === 1 ? 1 : + -pow( 2, 10 * x - 10 ) * sin( ( x * 10 - 10.75 ) * c4 ); + }, + easeOutElastic: function (x) { + return x === 0 ? 0 : x === 1 ? 1 : + pow( 2, -10 * x ) * sin( ( x * 10 - 0.75 ) * c4 ) + 1; + }, + easeInOutElastic: function (x) { + return x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ? + -( pow( 2, 20 * x - 10 ) * sin( ( 20 * x - 11.125 ) * c5 )) / 2 : + pow( 2, -20 * x + 10 ) * sin( ( 20 * x - 11.125 ) * c5 ) / 2 + 1; + }, + easeInBack: function (x) { + return c3 * x * x * x - c1 * x * x; + }, + easeOutBack: function (x) { + return 1 + c3 * pow( x - 1, 3 ) + c1 * pow( x - 1, 2 ); + }, + easeInOutBack: function (x) { + return x < 0.5 ? + ( pow( 2 * x, 2 ) * ( ( c2 + 1 ) * 2 * x - c2 ) ) / 2 : + ( pow( 2 * x - 2, 2 ) *( ( c2 + 1 ) * ( x * 2 - 2 ) + c2 ) + 2 ) / 2; + }, + easeInBounce: function (x) { + return 1 - bounceOut( 1 - x ); + }, + easeOutBounce: bounceOut, + easeInOutBounce: function (x) { + return x < 0.5 ? + ( 1 - bounceOut( 1 - 2 * x ) ) / 2 : + ( 1 + bounceOut( 2 * x - 1 ) ) / 2; + } + }); + return $; +} From 6535a9e6fc40a661441750d79480b25f8fd38492 Mon Sep 17 00:00:00 2001 From: Brett Zamir Date: Thu, 6 Aug 2020 18:35:57 +0800 Subject: [PATCH 3/3] - Enhancement: Derive main easing files (including minified) from ESM source, with main ones assuming global `jQuery` - Enhancement: Add `module`, `exports`, `browser`, and `type` for ESM usage by bundlers or Node - Enhancement: Have CommonJS API require passing in `jquery` instance (passing in alone not sufficient) - Docs/Demo: Add Node CJS demo; give more on usage - Linting: More consistent styling - Refactoring: More on ES6 Modules source - Refactoring: More ES6 in source - npm: Update jquery dep.; remove uglify-js (using Terser with Rollup) --- .babelrc.json | 5 + .editorconfig | 2 +- .eslintignore | 5 +- .eslintrc.js | 19 +- README.md | 42 +- addJQueryEasing.js | 144 ++ addJQueryEasing.js.map | 1 + example/demo.html | 30 +- example/example.html | 20 +- example/node.js | 15 + example/verify.html | 25 +- jquery.easing.compatibility.js | 30 +- jquery.easing.js | 310 ++- jquery.easing.js.map | 1 + jquery.easing.min.js | 3 +- jquery.easing.min.js.map | 1 + package-lock.json | 2084 ++++++++++++++++- package.json | 21 +- rollup.config.js | 48 + src/{jquery.easing.js => addJQueryEasing.mjs} | 77 +- src/jquery.easing.mjs | 6 + 21 files changed, 2493 insertions(+), 396 deletions(-) create mode 100644 .babelrc.json create mode 100644 addJQueryEasing.js create mode 100644 addJQueryEasing.js.map create mode 100644 example/node.js create mode 100644 jquery.easing.js.map create mode 100644 jquery.easing.min.js.map create mode 100644 rollup.config.js rename src/{jquery.easing.js => addJQueryEasing.mjs} (71%) create mode 100644 src/jquery.easing.mjs diff --git a/.babelrc.json b/.babelrc.json new file mode 100644 index 0000000..ece1d87 --- /dev/null +++ b/.babelrc.json @@ -0,0 +1,5 @@ +{ + "presets": [ + ["@babel/preset-env"] + ] +} diff --git a/.editorconfig b/.editorconfig index 267f5f0..e0e4669 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,6 +11,6 @@ indent_style = tab indent_size = 2 trim_trailing_whitespace = true -[*.{json}] +[*.json] ; indent_size = 2 indent_style = space diff --git a/.eslintignore b/.eslintignore index 9ed8fc6..a8c86ea 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1,3 @@ -jquery.easing.min.js -jquery.easing.js +/jquery.easing.min.js +/jquery.easing.js +/addJQueryEasing.js diff --git a/.eslintrc.js b/.eslintrc.js index 5227b6f..937ede6 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -11,7 +11,7 @@ module.exports = { }, overrides: [ { - files: '.eslintrc.js', + files: ['.eslintrc.js', 'example/node.js'], env: { node: true }, @@ -36,11 +36,26 @@ module.exports = { globals: { require: 'readonly', define: 'readonly' + }, + rules: { + 'no-unused-vars': ['error', { + varsIgnorePattern: '$' + }] } } ], rules: { indent: ['error', 'tab'], - semi: ['error'] + semi: ['error'], + + 'prefer-const': ['error'], + 'no-var': ['error'], + 'prefer-destructuring': ['error'], + 'object-shorthand': ['error'], + 'object-curly-spacing': ['error', 'always'], + quotes: ['error', 'single'], + 'quote-props': ['error', 'as-needed'], + 'brace-style': ['error', '1tbs'], + 'prefer-template': ['error'] } }; diff --git a/README.md b/README.md index 4221343..40c7d4e 100644 --- a/README.md +++ b/README.md @@ -4,20 +4,52 @@ What is it? A jQuery plugin from GSGD to give advanced easing options. More info For CDN please use CloudFlare [`https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.4.1/jquery.easing.min.js`](https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.4.1/jquery.easing.min.js) to help my host. Thank you. -# AMD or CommonJS usage +## ESM usage (bundlers) + +```js +import $ from 'jquery.easing'; +``` + +## ESM usage (browser) + +```js +import $ from './node_modules/jquery.easing/src/jquery.easing.mjs'; +``` + +OR, to pass your own non-global `jQuery` instance: + +```js +/* globals someJQueryInstance */ +import addJQueryEasing from './node_modules/jquery.easing/src/addJQueryEasing.mjs'; + +const $ = addJQueryEasing(someJQueryInstance); +``` + +## UMD usage + +```html + +``` + +## CommonJS or AMD usage ```js // CommonJS -const jQuery = require('jquery'); -require('jquery.easing')(jQuery); +const { JSDOM } = require('jsdom'); +const JQuery = require('jquery'); +const addJQueryEasing = require('jquery.easing'); + +const { window } = new JSDOM(''); +const jQuery = JQuery(window); +const $ = addJQueryEasing(jQuery); // AMD define(['jquery', 'jquery.easing'], function (jQuery, easing) { - easing(jQuery); + return easing(jQuery); }); ``` -# Building and testing +## Building and testing - Clone the repo - `npm install` diff --git a/addJQueryEasing.js b/addJQueryEasing.js new file mode 100644 index 0000000..002c682 --- /dev/null +++ b/addJQueryEasing.js @@ -0,0 +1,144 @@ +'use strict'; + +/* + * jQuery Easing v1.4.1 - http://gsgd.co.uk/sandbox/jquery/easing/ + * Open source under the BSD License. + * Copyright © 2008 George McGinley Smith + * All rights reserved. + * https://raw.github.com/gdsmith/jquery.easing/master/LICENSE +*/ +function addJQueryEasing ($) { + // Preserve the original jQuery "swing" easing as "jswing" + if (typeof $.easing !== 'undefined') { + $.easing['jswing'] = $.easing['swing']; + } + + var pow = Math.pow, + sqrt = Math.sqrt, + sin = Math.sin, + cos = Math.cos, + PI = Math.PI, + c1 = 1.70158, + c2 = c1 * 1.525, + c3 = c1 + 1, + c4 = 2 * PI / 3, + c5 = 2 * PI / 4.5; // x is the fraction of animation progress, in the range 0..1 + + function bounceOut(x) { + var n1 = 7.5625, + d1 = 2.75; + + if (x < 1 / d1) { + return n1 * x * x; + } + + if (x < 2 / d1) { + return n1 * (x -= 1.5 / d1) * x + .75; + } + + if (x < 2.5 / d1) { + return n1 * (x -= 2.25 / d1) * x + .9375; + } + + return n1 * (x -= 2.625 / d1) * x + .984375; + } + + $.extend($.easing, { + def: 'easeOutQuad', + swing: function swing(x) { + return $.easing[$.easing.def](x); + }, + easeInQuad: function easeInQuad(x) { + return x * x; + }, + easeOutQuad: function easeOutQuad(x) { + return 1 - (1 - x) * (1 - x); + }, + easeInOutQuad: function easeInOutQuad(x) { + return x < 0.5 ? 2 * x * x : 1 - pow(-2 * x + 2, 2) / 2; + }, + easeInCubic: function easeInCubic(x) { + return x * x * x; + }, + easeOutCubic: function easeOutCubic(x) { + return 1 - pow(1 - x, 3); + }, + easeInOutCubic: function easeInOutCubic(x) { + return x < 0.5 ? 4 * x * x * x : 1 - pow(-2 * x + 2, 3) / 2; + }, + easeInQuart: function easeInQuart(x) { + return x * x * x * x; + }, + easeOutQuart: function easeOutQuart(x) { + return 1 - pow(1 - x, 4); + }, + easeInOutQuart: function easeInOutQuart(x) { + return x < 0.5 ? 8 * x * x * x * x : 1 - pow(-2 * x + 2, 4) / 2; + }, + easeInQuint: function easeInQuint(x) { + return x * x * x * x * x; + }, + easeOutQuint: function easeOutQuint(x) { + return 1 - pow(1 - x, 5); + }, + easeInOutQuint: function easeInOutQuint(x) { + return x < 0.5 ? 16 * x * x * x * x * x : 1 - pow(-2 * x + 2, 5) / 2; + }, + easeInSine: function easeInSine(x) { + return 1 - cos(x * PI / 2); + }, + easeOutSine: function easeOutSine(x) { + return sin(x * PI / 2); + }, + easeInOutSine: function easeInOutSine(x) { + return -(cos(PI * x) - 1) / 2; + }, + easeInExpo: function easeInExpo(x) { + return x === 0 ? 0 : pow(2, 10 * x - 10); + }, + easeOutExpo: function easeOutExpo(x) { + return x === 1 ? 1 : 1 - pow(2, -10 * x); + }, + easeInOutExpo: function easeInOutExpo(x) { + return x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ? pow(2, 20 * x - 10) / 2 : (2 - pow(2, -20 * x + 10)) / 2; + }, + easeInCirc: function easeInCirc(x) { + return 1 - sqrt(1 - pow(x, 2)); + }, + easeOutCirc: function easeOutCirc(x) { + return sqrt(1 - pow(x - 1, 2)); + }, + easeInOutCirc: function easeInOutCirc(x) { + return x < 0.5 ? (1 - sqrt(1 - pow(2 * x, 2))) / 2 : (sqrt(1 - pow(-2 * x + 2, 2)) + 1) / 2; + }, + easeInElastic: function easeInElastic(x) { + return x === 0 ? 0 : x === 1 ? 1 : -pow(2, 10 * x - 10) * sin((x * 10 - 10.75) * c4); + }, + easeOutElastic: function easeOutElastic(x) { + return x === 0 ? 0 : x === 1 ? 1 : pow(2, -10 * x) * sin((x * 10 - 0.75) * c4) + 1; + }, + easeInOutElastic: function easeInOutElastic(x) { + return x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ? -(pow(2, 20 * x - 10) * sin((20 * x - 11.125) * c5)) / 2 : pow(2, -20 * x + 10) * sin((20 * x - 11.125) * c5) / 2 + 1; + }, + easeInBack: function easeInBack(x) { + return c3 * x * x * x - c1 * x * x; + }, + easeOutBack: function easeOutBack(x) { + return 1 + c3 * pow(x - 1, 3) + c1 * pow(x - 1, 2); + }, + easeInOutBack: function easeInOutBack(x) { + return x < 0.5 ? pow(2 * x, 2) * ((c2 + 1) * 2 * x - c2) / 2 : (pow(2 * x - 2, 2) * ((c2 + 1) * (x * 2 - 2) + c2) + 2) / 2; + }, + easeInBounce: function easeInBounce(x) { + return 1 - bounceOut(1 - x); + }, + easeOutBounce: bounceOut, + easeInOutBounce: function easeInOutBounce(x) { + return x < 0.5 ? (1 - bounceOut(1 - 2 * x)) / 2 : (1 + bounceOut(2 * x - 1)) / 2; + } + }); + return $; +} + +module.exports = addJQueryEasing; +//# sourceMappingURL=addJQueryEasing.js.map diff --git a/addJQueryEasing.js.map b/addJQueryEasing.js.map new file mode 100644 index 0000000..4b2f360 --- /dev/null +++ b/addJQueryEasing.js.map @@ -0,0 +1 @@ +{"version":3,"file":"addJQueryEasing.js","sources":["src/addJQueryEasing.mjs"],"sourcesContent":["/*\n * jQuery Easing v1.4.1 - http://gsgd.co.uk/sandbox/jquery/easing/\n * Open source under the BSD License.\n * Copyright © 2008 George McGinley Smith\n * All rights reserved.\n * https://raw.github.com/gdsmith/jquery.easing/master/LICENSE\n*/\n\nexport default function ($) {\n\t// Preserve the original jQuery \"swing\" easing as \"jswing\"\n\tif (typeof $.easing !== 'undefined') {\n\t\t$.easing['jswing'] = $.easing['swing'];\n\t}\n\n\tconst { pow, sqrt, sin, cos, PI } = Math,\n\t\tc1 = 1.70158,\n\t\tc2 = c1 * 1.525,\n\t\tc3 = c1 + 1,\n\t\tc4 = ( 2 * PI ) / 3,\n\t\tc5 = ( 2 * PI ) / 4.5;\n\n\t// x is the fraction of animation progress, in the range 0..1\n\tfunction bounceOut(x) {\n\t\tconst n1 = 7.5625,\n\t\t\td1 = 2.75;\n\t\tif ( x < 1/d1 ) {\n\t\t\treturn n1*x*x;\n\t\t}\n\t\tif ( x < 2/d1 ) {\n\t\t\treturn n1*(x-=(1.5/d1))*x + .75;\n\t\t}\n\t\tif ( x < 2.5/d1 ) {\n\t\t\treturn n1*(x-=(2.25/d1))*x + .9375;\n\t\t}\n\t\treturn n1*(x-=(2.625/d1))*x + .984375;\n\t}\n\n\t$.extend( $.easing, {\n\t\tdef: 'easeOutQuad',\n\t\tswing (x) {\n\t\t\treturn $.easing[$.easing.def](x);\n\t\t},\n\t\teaseInQuad (x) {\n\t\t\treturn x * x;\n\t\t},\n\t\teaseOutQuad (x) {\n\t\t\treturn 1 - ( 1 - x ) * ( 1 - x );\n\t\t},\n\t\teaseInOutQuad (x) {\n\t\t\treturn x < 0.5 ?\n\t\t\t\t2 * x * x :\n\t\t\t\t1 - pow( -2 * x + 2, 2 ) / 2;\n\t\t},\n\t\teaseInCubic (x) {\n\t\t\treturn x * x * x;\n\t\t},\n\t\teaseOutCubic (x) {\n\t\t\treturn 1 - pow( 1 - x, 3 );\n\t\t},\n\t\teaseInOutCubic (x) {\n\t\t\treturn x < 0.5 ?\n\t\t\t\t4 * x * x * x :\n\t\t\t\t1 - pow( -2 * x + 2, 3 ) / 2;\n\t\t},\n\t\teaseInQuart (x) {\n\t\t\treturn x * x * x * x;\n\t\t},\n\t\teaseOutQuart (x) {\n\t\t\treturn 1 - pow( 1 - x, 4 );\n\t\t},\n\t\teaseInOutQuart (x) {\n\t\t\treturn x < 0.5 ?\n\t\t\t\t8 * x * x * x * x :\n\t\t\t\t1 - pow( -2 * x + 2, 4 ) / 2;\n\t\t},\n\t\teaseInQuint (x) {\n\t\t\treturn x * x * x * x * x;\n\t\t},\n\t\teaseOutQuint (x) {\n\t\t\treturn 1 - pow( 1 - x, 5 );\n\t\t},\n\t\teaseInOutQuint (x) {\n\t\t\treturn x < 0.5 ?\n\t\t\t\t16 * x * x * x * x * x :\n\t\t\t\t1 - pow( -2 * x + 2, 5 ) / 2;\n\t\t},\n\t\teaseInSine (x) {\n\t\t\treturn 1 - cos( x * PI/2 );\n\t\t},\n\t\teaseOutSine (x) {\n\t\t\treturn sin( x * PI/2 );\n\t\t},\n\t\teaseInOutSine (x) {\n\t\t\treturn -( cos( PI * x ) - 1 ) / 2;\n\t\t},\n\t\teaseInExpo (x) {\n\t\t\treturn x === 0 ? 0 : pow( 2, 10 * x - 10 );\n\t\t},\n\t\teaseOutExpo (x) {\n\t\t\treturn x === 1 ? 1 : 1 - pow( 2, -10 * x );\n\t\t},\n\t\teaseInOutExpo (x) {\n\t\t\treturn x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ?\n\t\t\t\tpow( 2, 20 * x - 10 ) / 2 :\n\t\t\t\t( 2 - pow( 2, -20 * x + 10 ) ) / 2;\n\t\t},\n\t\teaseInCirc (x) {\n\t\t\treturn 1 - sqrt( 1 - pow( x, 2 ) );\n\t\t},\n\t\teaseOutCirc (x) {\n\t\t\treturn sqrt( 1 - pow( x - 1, 2 ) );\n\t\t},\n\t\teaseInOutCirc (x) {\n\t\t\treturn x < 0.5 ?\n\t\t\t\t( 1 - sqrt( 1 - pow( 2 * x, 2 ) ) ) / 2 :\n\t\t\t\t( sqrt( 1 - pow( -2 * x + 2, 2 ) ) + 1 ) / 2;\n\t\t},\n\t\teaseInElastic (x) {\n\t\t\treturn x === 0 ? 0 : x === 1 ? 1 :\n\t\t\t\t-pow( 2, 10 * x - 10 ) * sin( ( x * 10 - 10.75 ) * c4 );\n\t\t},\n\t\teaseOutElastic (x) {\n\t\t\treturn x === 0 ? 0 : x === 1 ? 1 :\n\t\t\t\tpow( 2, -10 * x ) * sin( ( x * 10 - 0.75 ) * c4 ) + 1;\n\t\t},\n\t\teaseInOutElastic (x) {\n\t\t\treturn x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ?\n\t\t\t\t-( pow( 2, 20 * x - 10 ) * sin( ( 20 * x - 11.125 ) * c5 )) / 2 :\n\t\t\t\tpow( 2, -20 * x + 10 ) * sin( ( 20 * x - 11.125 ) * c5 ) / 2 + 1;\n\t\t},\n\t\teaseInBack (x) {\n\t\t\treturn c3 * x * x * x - c1 * x * x;\n\t\t},\n\t\teaseOutBack (x) {\n\t\t\treturn 1 + c3 * pow( x - 1, 3 ) + c1 * pow( x - 1, 2 );\n\t\t},\n\t\teaseInOutBack (x) {\n\t\t\treturn x < 0.5 ?\n\t\t\t\t( pow( 2 * x, 2 ) * ( ( c2 + 1 ) * 2 * x - c2 ) ) / 2 :\n\t\t\t\t( pow( 2 * x - 2, 2 ) *( ( c2 + 1 ) * ( x * 2 - 2 ) + c2 ) + 2 ) / 2;\n\t\t},\n\t\teaseInBounce (x) {\n\t\t\treturn 1 - bounceOut( 1 - x );\n\t\t},\n\t\teaseOutBounce: bounceOut,\n\t\teaseInOutBounce (x) {\n\t\t\treturn x < 0.5 ?\n\t\t\t\t( 1 - bounceOut( 1 - 2 * x ) ) / 2 :\n\t\t\t\t( 1 + bounceOut( 2 * x - 1 ) ) / 2;\n\t\t}\n\t});\n\treturn $;\n}\n"],"names":["$","easing","pow","Math","sqrt","sin","cos","PI","c1","c2","c3","c4","c5","bounceOut","x","n1","d1","extend","def","swing","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","easeInSine","easeOutSine","easeInOutSine","easeInExpo","easeOutExpo","easeInOutExpo","easeInCirc","easeOutCirc","easeInOutCirc","easeInElastic","easeOutElastic","easeInOutElastic","easeInBack","easeOutBack","easeInOutBack","easeInBounce","easeOutBounce","easeInOutBounce"],"mappings":";;AAAA;;;;;;;AAQe,0BAAUA,CAAV,EAAa;AAC3B;AACA,MAAI,OAAOA,CAAC,CAACC,MAAT,KAAoB,WAAxB,EAAqC;AACpCD,IAAAA,CAAC,CAACC,MAAF,CAAS,QAAT,IAAqBD,CAAC,CAACC,MAAF,CAAS,OAAT,CAArB;AACA;;AAJ0B,MAMnBC,GANmB,GAMSC,IANT,CAMnBD,GANmB;AAAA,MAMdE,IANc,GAMSD,IANT,CAMdC,IANc;AAAA,MAMRC,GANQ,GAMSF,IANT,CAMRE,GANQ;AAAA,MAMHC,GANG,GAMSH,IANT,CAMHG,GANG;AAAA,MAMEC,EANF,GAMSJ,IANT,CAMEI,EANF;AAAA,MAO1BC,EAP0B,GAOrB,OAPqB;AAAA,MAQ1BC,EAR0B,GAQrBD,EAAE,GAAG,KARgB;AAAA,MAS1BE,EAT0B,GASrBF,EAAE,GAAG,CATgB;AAAA,MAU1BG,EAV0B,GAUnB,IAAIJ,EAAN,GAAa,CAVQ;AAAA,MAW1BK,EAX0B,GAWnB,IAAIL,EAAN,GAAa,GAXQ;;AAc3B,WAASM,SAAT,CAAmBC,CAAnB,EAAsB;AACrB,QAAMC,EAAE,GAAG,MAAX;AAAA,QACCC,EAAE,GAAG,IADN;;AAEA,QAAKF,CAAC,GAAG,IAAEE,EAAX,EAAgB;AACf,aAAOD,EAAE,GAACD,CAAH,GAAKA,CAAZ;AACA;;AACD,QAAKA,CAAC,GAAG,IAAEE,EAAX,EAAgB;AACf,aAAOD,EAAE,IAAED,CAAC,IAAG,MAAIE,EAAV,CAAF,GAAiBF,CAAjB,GAAqB,GAA5B;AACA;;AACD,QAAKA,CAAC,GAAG,MAAIE,EAAb,EAAkB;AAC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