From 54945fe4f86eea75f21961364b7cce045f538a7a Mon Sep 17 00:00:00 2001 From: Cam Date: Tue, 12 Dec 2023 17:38:24 +1300 Subject: [PATCH] added : constants and utils --- .eslintrc | 18 +- README.md | 48 +- examples/api.html | 2 +- examples/basic-uncomposed.html | 6 +- examples/basic.html | 2 +- examples/callbacks.html | 8 +- examples/get.html | 2 +- examples/set.html | 4 +- lib/lazy-line-painter-2.0.1.js | 1140 ++++++++++++++++++++++++ lib/lazy-line-painter-2.0.1.js.map | 1 + lib/lazy-line-painter-2.0.1.min.js | 2 + lib/lazy-line-painter-2.0.1.min.js.map | 1 + package.json | 2 +- src/consts.js | 35 + src/easing.js | 10 +- src/events.js | 2 +- src/index.js | 177 ++-- src/utils.js | 15 + 18 files changed, 1369 insertions(+), 106 deletions(-) create mode 100644 lib/lazy-line-painter-2.0.1.js create mode 100644 lib/lazy-line-painter-2.0.1.js.map create mode 100644 lib/lazy-line-painter-2.0.1.min.js create mode 100644 lib/lazy-line-painter-2.0.1.min.js.map create mode 100644 src/consts.js create mode 100644 src/utils.js diff --git a/.eslintrc b/.eslintrc index 906661c..62b8ad8 100755 --- a/.eslintrc +++ b/.eslintrc @@ -1,5 +1,4 @@ { - "env": { "browser": true, "es6": true, @@ -21,9 +20,7 @@ "parser": "babel-eslint", - "plugins": [ - - ], + "plugins": [], "rules": { "block-scoped-var": 2, @@ -45,13 +42,13 @@ "func-style": 0, "generator-star-spacing": [2, "both"], "guard-for-in": 0, - "handle-callback-err": [2, "^(err|error|anySpecificError)$" ], + "handle-callback-err": [2, "^(err|error|anySpecificError)$"], "indent": [2, 2, { "SwitchCase": 1 }], "key-spacing": [2, { "beforeColon": false, "afterColon": true }], - "keyword-spacing": [2, {"before": true, "after": true}], + "keyword-spacing": [2, { "before": true, "after": true }], "linebreak-style": 0, "max-depth": 0, - "max-len": [2, 120, 4], + "max-len": [2, 200, 4], "max-nested-callbacks": 0, "max-params": 0, "max-statements": 0, @@ -155,13 +152,16 @@ "operator-linebreak": [2, "after"], "padded-blocks": 0, "quote-props": 0, - "quotes": [2, "single", "avoid-escape"], + "quotes": [2, "double", "avoid-escape"], "radix": 2, "semi": [2, "always"], "semi-spacing": 0, "sort-vars": 0, "space-before-blocks": [2, "always"], - "space-before-function-paren": [2, {"anonymous": "always", "named": "never"}], + "space-before-function-paren": [ + 2, + { "anonymous": "always", "named": "never" } + ], "space-in-brackets": 0, "space-in-parens": [2, "never"], "space-infix-ops": 2, diff --git a/README.md b/README.md index cd83fc1..c29ec64 100644 --- a/README.md +++ b/README.md @@ -118,17 +118,21 @@ Data attributes will override both css styles & initialisation config style attr ```html ``` @@ -142,10 +146,10 @@ Data attributes will override both css styles & initialisation config style attr **Paint** - accepts optional playback arguments - reverse, ease, delay ```js -myAnimation.paint({ - reverse: true, - ease: "easeExpoOut", -}); +const reverse = true; +const ease = "easeExpoOut"; +const delay = 200; +myAnimation.paint({ reverse, ease, delay }); ``` **Erase** - paint can still be called on the element after it has been erased; @@ -166,17 +170,15 @@ myAnimation.pause(); myAnimation.resume(); ``` -**Set** - set options after initialisation +**Progress** ```js -// progress - sets path position, second param accepts a number between 0 - 1 -myAnimation.set("progress", value); -``` - -**Get** - returns all lazylinepainter data; +// set - [0 - 1] +myAnimation.progress(value); -```js -myAnimation.get(); +// get +const progress = myAnimation.progress(); +console.log(progress); ``` **Destroy** - destroys svg & lazyline instance diff --git a/examples/api.html b/examples/api.html index 555e8bf..3f2f1e2 100644 --- a/examples/api.html +++ b/examples/api.html @@ -22,7 +22,7 @@ - + + - + +