Git Product home page Git Product logo

redux-slidedeck's Introduction

redux-slidedeck

Slide deck library built with redux. A port of react-slidedeck

redux-slidedeck's People

Contributors

taylorhakes avatar

Stargazers

Daniel Grant avatar  avatar

Watchers

James Cloos avatar B avatar  avatar

redux-slidedeck's Issues

Sub steps in slides (Slide Fragments)

Need to implement a fragment slide API. Basically parts of slide that fade-in based on user interaction (normally the right arrow).

My initial API thought was this

[
  <div>
    <div>Slide 1 Title</div>
    <div>
      <Fragment index="0"><span>Hello</span></Framework>
      <Fragment index="1"><span>World</span></Framework>
    </div>
  </div>,
  <div>Slide 2 Title</div>
]

In the above example, Hello would fade in on pressing right arrow and then World after the next right arrow key. The issue with this API is that a Fragment component may be very nested in the slide. The top component needs to know how many Fragments exist in the slide (to know when to fade-in vs go to next slide) and needs to tell the Fragment to fade-in and out.

Another API option is this

[
  (fragmentInfo) =>
  <div>
    <div>Slide 1 Title</div>
    <div>
      <Fragment index="0" {...fragmentInfo}><span>Hello</span></Framework>
      <Fragment index="1  {...fragmentInfo}"><span>World</span></Framework>
    </div>
  </div>,
  <div>Slide 2 Title</div>
]

This is more work, but fixes the problem of showing and hiding the Fragment correctly. It does not solve knowing how many Fragments are in the slide.

I don't have any ideas of how to solve this without adding a ton of boilerplate.

[
  {
    fragments: 2,
    slide:  (fragmentInfo) => (
      <div>
        <div>Slide 1 Title</div>
        <div>
          <Fragment index="0" {...fragmentInfo}><span>Hello</span></Framework>
          <Fragment index="1  {...fragmentInfo}"><span>World</span></Framework>
        </div>
     </div>)
  },
  <div>Slide 2 Title</div>
]

This solves both, but I don't like it at all. Any API ideas are welcome.

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.