Giter Club home page Giter Club logo

Comments (3)

gre avatar gre commented on September 16, 2024

things are a bit weird coupled I admit. Maybe all of these should just be one package because it's a bit confusing.

But basically, kenburns-dom / kenburns-core is not meant to be used directly. It's an hidden dep. only kenburns should be depend on.

kenburns expose DOM which is the dom implementation.

If I have time, I should try to regroup things in one directory. I also imagine we could require("kenburns/dom") later so only the dom impl get actively imported so it reduces bundle size. but it's an optim...

from kenburns.

gre avatar gre commented on September 16, 2024

I've released a major version of the library (2.0.0) that have a new documentation. https://github.com/gre/kenburns/blob/master/API.md

checkout also the example: https://github.com/gre/kenburns/blob/master/example/index.js

You now only need to use the library kenburns and no more kenburns-dom.

To use the dom implementation:

import KenBurnsDOM from "kenburns/lib/DOM";
var div = document.createElement("div");
div.style.width = "400px";
div.style.height = "400px";
const kenBurnsDOM = new KenBurnsDOM(div);
// kenBurnsDOM.animate(...).then(...);
// kenBurnsDOM.animateStep(...);

from kenburns.

gre avatar gre commented on September 16, 2024

animate(image, fromCrop, toCrop, duration/*, easing*/) runs the animation and returns a Promise.
if you want finer control, animateStep(image, fromCrop, toCrop, progress) allows to render one frame of the animation. It's lower level but you can do whatever speed / easing / interruption / ...

from kenburns.

Related Issues (8)

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.