Giter VIP home page Giter VIP logo

animate-images's People

Contributors

girtskokars avatar its2easy 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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

animate-images's Issues

[feature request] Responsiveness based on height

Right now you can only achieve responsiveness by leaving the height empty and setting the width. Would be great if the opposite would also be possible: leaving the width empty and setting the height.

playTo (and playFrames) being ignored when it switches from fastPreview to full

when you are in the middle of a playTo animation (e.g. playTo(100)), while using the fastPreview mode, and at some point during this animation it finished the full preload and switches from fast to full, it ignores the playTo and just switches to regular play(), causing it to also continue after frame 100.

if ( wasAnimating ) plugin.play();

const wasAnimating = plugin.isAnimating();
const matchFrame = this._settings?.fastPreview.matchFrame;
plugin.setFrame( matchFrame ? matchFrame(this._data.currentFrame) : 1 );
if ( wasAnimating ) plugin.play();

There you see that by first calling setFrame (causing a call to stop(), which resets _framesLeftToPlay) and then play() again. Can't we just simply change it to this, so that it only loses the playTo animation when you dont use the matchFrame option?

const matchFrame = this._settings?.fastPreview.matchFrame;
if (!matchFrame) {
    const wasAnimating = plugin.isAnimating();
    plugin.setFrame(1);
    if (wasAnimating) plugin.play();
}

If so, happy to make a PR for this :)

Minified build files on npm are not working

In production, where I am using the minified version of esm (https://cdn.jsdelivr.net/npm/@its2easy/animate-images/build/animate-images.esm.min.js) I get the following error:

Uncaught TypeError: Cannot read properties of undefined (reading 'pageX')

The minified version both defines a function i (function i(t,i)) and replaces the touches variable (https://github.com/its2easy/animate-images/blob/master/src/DragInput.js#L69) also with the letter i, causing it to conflict and causing the error above.

Inertia / Easing on DragEnd

Would be neat if we could add an inertia or easing function so the sequence caries on gradually slowing down as it comes to a stop after dragging. For the best "feel" this might need to keep track of the drag speed.

I've been trying to figure this out but just can't get it. Any help would be appreciated!

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.