Coder Social home page Coder Social logo

lottiefiles / dotlottie-web Goto Github PK

View Code? Open in Web Editor NEW
54.0 6.0 2.0 8.71 MB

Home Page: https://dotlottie.io

License: MIT License

JavaScript 44.34% Shell 0.06% HTML 1.13% TypeScript 49.13% CSS 1.83% Vue 1.00% Svelte 2.52%
dotlottie lottie thorvg animation canvas easy immersive javascript painless web

dotlottie-web's People

Contributors

afsalz avatar dependabot[bot] avatar hermet avatar lottiefiles-bot avatar renovate[bot] avatar theashraf avatar tinyjin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

dotlottie-web's Issues

Use DotLottie Web with Nuxt 2

Overview

  • I want to use dotLottie web player on a Nuxt 2 project. But it seems there is an issue with the file loader. I haven't found a solution for this case yet (Currently only topic related to Nuxt 3 is opened)
    Module parse failed: Unexpected token. You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file.
    image

  • My reproduce repo:
    Codesandbox

  • I used node v20.11.1 and nuxt 2.15.7.

So I would like to know if dotLottie currently support Nuxt 2. Thank you!

adobe lottie json

hello

adobe after effect movin and lottie json file can work here ?

as some image and text level dynamic template possible and convert to video ?

int his script possible or anyone can help us how to possible make dynamic tempalte so based on user we can process to mp4

currently in adobe we getting png with base64 raw format and other text how to modify dont know

Different rendering result compared to lottie-web

Overview

When rendering a simple animation from the same JSON file, the result is different when using dotlottie-web compared to lottie-web. The dotlottie-web rendering produces unexpected opaque center within the rocket:

2024-03-15 at 12 19 38

In the above example, lottie-web uses canvas renderer for fair comparison. Both use the same JSON file as a source. I tried converting JSON to dotlottie format, but it didn't change the result.

Reproduction

I created minimal reproduction that can be observed here: https://stackblitz.com/edit/vitejs-vite-2pieau?file=src%2FApp.svelte

Canvas width and height getting smaller on zoom level change

Overview

I am using @lottiefiles/dotlottie-react 0.3.1

import myLottie from '@/assets/myLottie.lottie?url'

<DotLottieReact
width={'600'}
height={'400'}
src={myLottie}
autoplay
loop
/>

Canvas width and height getting smaller when I change zoom level. and hits zero eventually.

  • Add the Type: Bug label to this issue.

const dpr = this._renderConfig.devicePixelRatio || window.devicePixelRatio || 1;

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update dependency @size-limit/preset-small-lib to v10.0.3
  • chore(deps): update dependency size-limit to v10.0.3
  • fix(deps): update dependency @dotlottie/dotlottie-js to v0.6.1
  • chore(deps): update dependency @size-limit/preset-small-lib to v11
  • chore(deps): update dependency remark-cli to v12
  • chore(deps): update dependency size-limit to v11
  • chore(deps): update dependency syncpack to v11
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

dockerfile
packages/web/Dockerfile
github-actions
.github/workflows/main.yml
  • styfle/cancel-workflow-action 0.12.0
  • actions/checkout v4
  • pnpm/action-setup v2
  • actions/setup-node v4
  • andresz1/size-limit-action v1
  • actions/checkout v4
  • pnpm/action-setup v2
  • actions/setup-node v4
  • changesets/action v1
  • actions/setup-node v4
  • changesets/action v1
.github/workflows/stale.yml
  • actions/stale v8
npm
apps/dotlottie-web-example/package.json
  • typescript 5.0.4
  • vite ^4.4.5
package.json
  • @changesets/cli 2.26.2
  • @commitlint/cli 17.6.1
  • @lottiefiles/commitlint-config 2.0.0
  • @lottiefiles/eslint-plugin 3.0.0
  • @lottiefiles/prettier-config 3.0.0
  • @lottiefiles/remark-preset 1.0.0
  • @lottiefiles/tsconfig 2.0.0
  • @size-limit/esbuild ^11.0.0
  • @size-limit/esbuild-why ^11.0.0
  • @size-limit/preset-small-lib ^10.0.2
  • cross-env 7.0.3
  • eslint 7.32.0
  • husky 8.0.3
  • lint-staged 13.2.1
  • npm-check-updates 16.10.9
  • prettier 2.8.8
  • remark-cli 11.0.0
  • size-limit ^10.0.2
  • syncpack 9.8.6
  • turbo 1.10.16
  • typescript 5.0.4
  • pnpm 8.10.1
packages/web/package.json
  • @dotlottie/dotlottie-js ^0.6.0
  • cross-env 7.0.3
  • tsup 7.2.0
  • typescript 5.0.4
  • node >=18
scripts/package.json
  • zx 7.0.7

  • Check this box to trigger a request for Renovate to run again on this repository

Dotlottie sometimes skips frames and lags Type: Bug

Overview

Hey,
so I've added a preloader to my shopify website and used the dotlottie animation. It's only shown once in a session and only on the main page.
Via HTML I preload the .lottie file and the animation plays, after the DOM Content has completely loaded, to ensure, the timer syncs with the animation.

My html:

<div id="loader">
<dotlottie-player background="transparent" id="lottie-loader" speed="1" style="width: 50%; height: 50%" direction="1" mode="normal" loop autoplay></dotlottie-player>
</div>

<link rel="preload" fetchpriority="high" href="https://lottie.host/a276f20a-2888-4dc0-a098-2edf62682b4c/WtaeCDO9ti.lottie" type="application/json">

My javascript

preloader.js

  const loader = document.getElementById("loader");
  $('#loader').hide();
}

$(document).ready(function() {
  if (document.cookie.indexOf("preloaderShown=true") === -1) {
      document.cookie = "preloaderShown=true; path=/";
    window.onload = function() {
      const player = document.querySelector('dotlottie-player');
    player.load('https://lottie.host/a276f20a-2888-4dc0-a098-2edf62682b4c/WtaeCDO9ti.lottie');
      setTimeout(function() {
      hidePreloader();
    }, 3100);
    };
    
The animation hides, after the preloader has completely loaded.

} else {
    // If the preloader has already been shown in this session, hide it immediately
    $('#loader').hide();
  }
});

The Problem

Sometimes the animation skips some frames and lags, especially on mobile devices. It doesn't matter if your connection is slow or fast, since the animation only loads after the page is completely loaded.

How it looks when it bugs:

RPReplay_Final1704895547.MP4

How it should look like:

RPReplay_Final1704895617.MP4

This is also reproduceable on desktop. Sometimes it lags, sometimes not. Hope some1 can help me.

Consuming repo

What repo were you working in when this issue occurred?

<script src="https://unpkg.com/@dotlottie/player-component@latest/dist/dotlottie-player.mjs" type="module"></script>

...

Labels

  • Add the Type: Bug label to this issue.

svg renderer

overview

it seems like this repo is completely based on the canvas renderer, as it requires a canvas element to function properly. are you planning to integrate the svg renderer as well at some point?

type

  • new feature
  • changes to existing features

motivation

i prefer this repo over the player component, because it is not designed as a web component and does not encapsulate its functionality within a custom <dotlottie-player> element, which unfortunately creates multiple issues on my side with my bundler and code splitting.

so this new repo seems to be making all my dreams come true. however, some of my animations are being played back filling the whole viewport, which creates performance issues and low frame rates. the svg renderer would eliminate these issues.

labels

  • Add the type: feature request label to this issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.