Skip to content

Commit

Permalink
+ Fixed examples not working due to "type:module" in package.json
Browse files Browse the repository at this point in the history
+ Updated README upcoming features
+ Added explicit warning if animation path is null
+ Bumped version
  • Loading branch information
samuelOsborne committed Jan 29, 2021
1 parent f6071b1 commit 0435ae9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,10 @@ We recommend using this library with a module bundler such as **webpack**.

### Upcoming features

- Changeable stroke width attribute
- Changeable stroke color attribute
- Color on hover
- Animation zooming
- Playback speed as attribute
- Morph lock attribute
- More interactions!

### Youtube guides
Expand Down
2 changes: 1 addition & 1 deletion dist/lottie-interactive.js

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"name": "lottie-interactive",
"version": "1.1.1",
"version": "1.1.2",
"description": "A custom element that adds interactions and quality of life changes to Lottie animations.",
"main": "dist/lottie-interactive.js",
"types": "./types/lottie.d.ts",
"type": "module",
"module": "dist/lottie-interactive.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
Expand Down
6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,15 @@ export class LottieInteractive extends HTMLElement {
}

private async loadIconData() {
if (this.path === null) {
console.error("[Lottie-interactive] Path to JSON animation data is null!");
return;
}
try {
const response = await fetch(this.path);
this.data = await response.json();
} catch (e) {
console.error("Lottie-interactive: Your JSON data could not be loaded.");
console.error("[Lottie-interactive] Your JSON data could not be loaded.");
return ;
}
Stroke.changeStrokeWidthColor(this.data, this.strokeWidth, this.strokeColor);
Expand Down

0 comments on commit 0435ae9

Please sign in to comment.