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 @@ - + + - + +