Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 🎸 webp support #133

Merged
merged 5 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fuzzy-dodos-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lottiefiles/dotlottie-web': minor
---

feat: 🎸 webp support
1 change: 1 addition & 0 deletions apps/dotlottie-web-example/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

app.innerHTML = `
<div class="grid">
<canvas data-src="https://lottie.host/b2d44b82-fd7e-401f-a4fa-77999147c0be/vqNwJryGBp.lottie"></canvas>
<canvas data-bg-color="green" data-src="https://lottie.host/1cf72a35-6d88-4d9a-9961-f1bb88087f2c/miJIHiyH4Q.lottie"></canvas>
<canvas data-src="https://lottie.host/647eb023-6040-4b60-a275-e2546994dd7f/zDCfp5lhLe.json"></canvas>
<canvas data-src="https://lottie.host/a7421582-4733-49e5-9f77-e8d4cd792239/WZQjpo4uZR.lottie"></canvas>
Expand Down Expand Up @@ -107,7 +108,7 @@
// useFrameInterpolation: false,
});

dotLottie.addEventListener('loadError', console.error);

Check warning on line 111 in apps/dotlottie-web-example/src/main.ts

View workflow job for this annotation

GitHub Actions / validate

Unexpected console statement

window.addEventListener('resize', () => {
dotLottie.resize();
Expand All @@ -133,7 +134,7 @@
// useFrameInterpolation: false,
});

dotLottie.addEventListener('loadError', console.error);

Check warning on line 137 in apps/dotlottie-web-example/src/main.ts

View workflow job for this annotation

GitHub Actions / validate

Unexpected console statement

const playPauseButton = document.getElementById('playPause') as HTMLButtonElement;
const stopButton = document.getElementById('stop') as HTMLButtonElement;
Expand Down Expand Up @@ -267,15 +268,15 @@
dotLottie.addEventListener('load', (event) => {
bgColorInput.value = dotLottie.backgroundColor || '#ffffff';

console.log(event);

Check warning on line 271 in apps/dotlottie-web-example/src/main.ts

View workflow job for this annotation

GitHub Actions / validate

Unexpected console statement
});

dotLottie.addEventListener('loadError', (event) => {
console.log(event);

Check warning on line 275 in apps/dotlottie-web-example/src/main.ts

View workflow job for this annotation

GitHub Actions / validate

Unexpected console statement
});

dotLottie.addEventListener('play', (event) => {
console.log(event);

Check warning on line 279 in apps/dotlottie-web-example/src/main.ts

View workflow job for this annotation

GitHub Actions / validate

Unexpected console statement
frameSlider.max = dotLottie.totalFrames.toString();
playPauseButton.innerText = 'Pause';

Expand All @@ -283,7 +284,7 @@
});

dotLottie.addEventListener('pause', (event) => {
console.log(event);

Check warning on line 287 in apps/dotlottie-web-example/src/main.ts

View workflow job for this annotation

GitHub Actions / validate

Unexpected console statement
playPauseButton.innerText = 'Play';

playbackStateSpan.textContent = `⏸ Paused`;
Expand All @@ -297,12 +298,12 @@
});

dotLottie.addEventListener('loop', (event) => {
console.log(event);

Check warning on line 301 in apps/dotlottie-web-example/src/main.ts

View workflow job for this annotation

GitHub Actions / validate

Unexpected console statement
});

// Handle complete events
dotLottie.addEventListener('complete', (event) => {
console.log(event);

Check warning on line 306 in apps/dotlottie-web-example/src/main.ts

View workflow job for this annotation

GitHub Actions / validate

Unexpected console statement

playPauseButton.innerText = 'Play';

Expand All @@ -310,7 +311,7 @@
});

dotLottie.addEventListener('stop', (event) => {
console.log(event);

Check warning on line 314 in apps/dotlottie-web-example/src/main.ts

View workflow job for this annotation

GitHub Actions / validate

Unexpected console statement

playPauseButton.innerText = 'Play';

Expand All @@ -318,7 +319,7 @@
});

dotLottie.addEventListener('destroy', (event) => {
console.log(event);

Check warning on line 322 in apps/dotlottie-web-example/src/main.ts

View workflow job for this annotation

GitHub Actions / validate

Unexpected console statement
});

dotLottie.addEventListener('freeze', (event) => {
Expand Down
8 changes: 4 additions & 4 deletions packages/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@
},
"devDependencies": {
"@types/node": "^20.10.5",
"@vitest/browser": "^1.1.0",
"@vitest/coverage-istanbul": "^1.1.0",
"@vitest/browser": "^1.2.2 ",
"@vitest/coverage-istanbul": "^1.2.2",
"cross-env": "7.0.3",
"tsup": "8.0.1",
"typescript": "5.0.4",
"vitest": "^1.1.0",
"webdriverio": "^8.27.0"
"vitest": "^1.2.2",
"webdriverio": "^8.32.0"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions packages/web/src/core/dotlottie-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -2848,7 +2848,7 @@ var createDotLottiePlayerModule = (() => {

var wasmImports = {
/** @export */ a: ___assert_fail,
/** @export */ i: ___cxa_throw,
/** @export */ h: ___cxa_throw,
/** @export */ r: ___syscall_fcntl64,
/** @export */ I: ___syscall_getcwd,
/** @export */ L: ___syscall_ioctl,
Expand Down Expand Up @@ -2891,7 +2891,7 @@ var createDotLottiePlayerModule = (() => {
/** @export */ T: _getentropy,
/** @export */ m: invoke_ii,
/** @export */ d: invoke_iii,
/** @export */ h: invoke_iiii,
/** @export */ i: invoke_iiii,
/** @export */ q: invoke_iiiiii,
/** @export */ j: invoke_vi,
/** @export */ b: invoke_vii,
Expand Down
Binary file modified packages/web/src/core/dotlottie-player.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/web/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default defineConfig({
test: {
browser: {
enabled: true,
name: 'chrome',
name: 'firefox',
},
// retry: 1,
coverage: {
Expand Down
Loading
Loading