Code Monkey home page Code Monkey logo

Comments (15)

Selbahc avatar Selbahc commented on August 28, 2024 1

Hi @darenju !
First of all, thanks for your job it's well documented and test-covered. As a newbie I like it ;-)

I'm trying to make nested flipboards to make, for example, a "main" navigation vertical, but with some nested flipboards with horizontal navigation.
When I try doing it, it splits the board in 4 windows, which is not the desired effect.
Any idea in wich part of the codebase I can look to try solving that ?

Here is a simple exemple of what I'm trying to achieve :

<FlipPage orientation="vertical">
    <FlipPage orientation="horizontal">
        <div>Main screen</div>
        <div>Horizontal swipe from the main screen</div>
    </FlipPage>
    <FlipPage orientation="horizontal">
        <div>Second Main screen (vertical swipe from the main screen)</div>
        <div>Horizontal swipe from the Second Main screen</div>
    </FlipPage>          
</FlipPage>

Thanks for your time !

from react-flip-page.

enikolas avatar enikolas commented on August 28, 2024

Hello buddy,

Nice repo! I really appreciate it.

Firstly, as you requested in the README file, I have the intent on helping you out with unit tests. When I have the time, I'll send my first PR to help you with this.

About features. I have some in minds. I'll create some "issues" with my feature requests.

Regards,
Nikolas

from react-flip-page.

grassynull33 avatar grassynull33 commented on August 28, 2024

@darenju I would love to have an option where pages pivot from the very left (as opposed to the center) to simulate more of a traditional book.

from react-flip-page.

darenju avatar darenju commented on August 28, 2024

@YoonsLee Hmm, that would totally change the way the pages are split into halves. But it's possible to find a way to keep both features I guess.

from react-flip-page.

talkingtab avatar talkingtab commented on August 28, 2024

Hi, I'm trying to build some video books- each FlipPage could have some mix of possibly text, images, and video. I get the video, but flipping the page ends up with two halves which are no longer in sync.
screen shot 2018-02-24 at 2 15 25 pm

In the screen shot above it is one video, and the page flips left to right, but you can see that the two halves are no longer at the same point in the video. In addition clicking on one half brings up controls while the other continues to play.

It would be nice to have a demo with a video, but just some ideas of where to start debugging/fixing would help.
Thanks (and great package)!

from react-flip-page.

talkingtab avatar talkingtab commented on August 28, 2024

Update on video. I'm wondering if the issue is something to do with the video continuing to play while the transitions are in action. It seems like one possibility is to pause the video on any touch, mouse event so that in a page turn it does not continue to play.

from react-flip-page.

darenju avatar darenju commented on August 28, 2024

@talkingtab There is a onPageChange callback that gets executed when the page has been changed. I could implement a onStartSwiping event, so that you could pause your video accordingly.

@Selbahc Thank you for reporting! However, would you mind opening a new issue for your problem? It helps the repository to be cleaner.

Same for @talkingtab, even though we almost solved your problem.

Thank you!

from react-flip-page.

talkingtab avatar talkingtab commented on August 28, 2024

@darenju That would be a great help. Just fyi, here is the component I'm trying

import React, { Component } from "react";

class R5video extends Component {
    render() {
        return <video src="./MVI_OUT.mp4" type="video/mp4" controls />;
    }
}

export default R5video;

from react-flip-page.

darenju avatar darenju commented on August 28, 2024

[email protected] released with onStartSwiping and onStopSwiping callbacks.

In your case @talkingtab, you could do something like this:

<FlipPage onStartSwiping={() => this.videoComponent.pause()} onStopSwiping={() => this.videoComponent.resume()}>
  <R5video ref={(video) => { this.videoComponent = video; }} />
</FlipPage>
class R5video extends Component {
    pause() {
        this.video.pause();
    }

    resume() {
        this.video.play();
    }

    render() {
        return <video ref={(video) => { this.video = video; }} src="./MVI_OUT.mp4" type="video/mp4" controls />;
    }
}

from react-flip-page.

talkingtab avatar talkingtab commented on August 28, 2024

Wow! Thats great, I've got it installed, may take me a couple of days to walk through though. Still seeing the same thing, but not sure I have it hooked up right.

from react-flip-page.

Selbahc avatar Selbahc commented on August 28, 2024

@darenju Sure, it's done !

from react-flip-page.

slevy85 avatar slevy85 commented on August 28, 2024

Hi,

Thank you for the great repo.

I think it would be nice to have more methods than goToNextPage and goToPreviousPage.
For example getCurrentPage, hasNextPage, hasPreviousPage, others ?

Update:
I just realized we already had access to these methods and the sate through the ref , excuse-me I am still new to react.

Thank you

from react-flip-page.

slevy85 avatar slevy85 commented on August 28, 2024

Hi,

Do you think it is possible to revert the direction of the book through props ?
In other words, the first page will be at the right, we go next by swipping to the left.

Thank you

from react-flip-page.

darenju avatar darenju commented on August 28, 2024

You can now use the startAt property to set the default page. Then just set orientation to horizontal. Then, you can know which actual page you're on with the onPageChange callback, plus some maths:

<FlipPage onPageChange={(newPage) => { const actualPage = MAX_PAGES - newPage; }} />

from react-flip-page.

slevy85 avatar slevy85 commented on August 28, 2024

Thant you, the startAt property helped me a lot. I reverted my pages and started at the end :

<FlipPage startAt={2}>
   <Page3/>
   <Page2/>
   <Page1/>
</FlipPage>

from react-flip-page.

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.