Giter VIP home page Giter VIP logo

Comments (11)

pgaskin avatar pgaskin commented on August 26, 2024 1

@KevinBeckers I just figured it out! This will give you a slide animation on v0.2.

EPUBJS.Hooks.register('beforeChapterDisplay').pageAnimation = function (callback, renderer) {
    window.setTimeout(function () {
        var style = renderer.doc.createElement("style");
        style.innerHTML = "*{-webkit-transition: transform {t} ease;-moz-transition: tranform {t} ease;-o-transition: transform {t} ease;-ms-transition: transform {t} ease;transition: transform {t} ease;}";
        style.innerHTML = style.innerHTML.split("{t}").join("0.5s");
        renderer.doc.body.appendChild(style);
    }, 100)
    if (callback) {
        callback();
    }
};

from epub.js.

JakeHartnell avatar JakeHartnell commented on August 26, 2024

It would be nice if we could build this as a hook or plugin, that way people could decide whether they wanted this or not.

from epub.js.

lpccoder avatar lpccoder commented on August 26, 2024

Yes, I don't know how at this moment, but is the road to take. Anyway we first need to avoid the css column trick to get the two pages layout. I'm trying to get this at https://github.com/lpccoder/epub.js/blob/trying-two-pages/examples/two-pages.html but I have to include some updates to get it working properly. Anyway, any information about how and where the epub.js manages pagination will be sincerely apreciated.

from epub.js.

fchasen avatar fchasen commented on August 26, 2024

Having page flipping animations doesn't seem possible without two separate renditions that are synced and support for that still isn't good.

v0.3 switches to an continuous rendering strategy, which at least allows for animation of the pages sliding left and right.

from epub.js.

KevinBeckers avatar KevinBeckers commented on August 26, 2024

Is there any news on this subject?

from epub.js.

pgaskin avatar pgaskin commented on August 26, 2024

Also, at the moment, to support desktop and laptop devices, epub.js needs to be patched by adding the following code somewhere before you start using epub.js, but after you load the library. The only difference this makes is that epub.js will use css transforms on desktop devices as well as mobile devices to move the pages.

EPUBJS.Render.Iframe.prototype.setLeft = function(leftPos){
    this.docEl.style[this.transform] = 'translate('+ (-leftPos) + 'px, 0)';
}

from epub.js.

anoop4real avatar anoop4real commented on August 26, 2024

Hi,
Does v0.3 support page flip animation?

from epub.js.

lawrence-eka avatar lawrence-eka commented on August 26, 2024

Hi there. Nice transition effect, at least it allows the user a cue that the page has flipped. But how to also add the capability for bottom up (and top down) transitions? Oddly enough, some users prefer flicking their finger up/down to turn the pages.

from epub.js.

pgaskin avatar pgaskin commented on August 26, 2024

@lawrence-eka This is not possible in v0.2, as the pagination is achieved with columns the width of the screen. Naturally, columns are horizontal, so what you are asking is not possible. This may be possible in v0.3 though.

from epub.js.

pulkitnandan avatar pulkitnandan commented on August 26, 2024

I'm using v0.3 and it renders next page by shifting the visible region of parent div. Need separate divs for each page to achieve effect like https://codepen.io/tailofmoon/pen/JXmvea?page=1& . But will it be a big change in epubjs?

from epub.js.

LDHo avatar LDHo commented on August 26, 2024

@pulkitnandan did you get your answer? Because I am using v0.3 as well.

from epub.js.

Related Issues (20)

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.