Giter Club home page Giter Club logo

react-impressjs's Introduction

React-impressJS

impress.js via React ๐ŸŽ‰

NPM version Build Status LICENCE

Why React-impressJS

Easy to create an impressive Slide/Introduction/Presentation in ReactJS.

Install

NPM install

Feature

Quick Navigation

Navigation on Mobile devise (YES! We provide mobile browser now ๐ŸŽ‰)

Just Swipe to navigate:

swipe right: Go to the previous Step.

swipe left: Go to the next Step.

Navigation on PC/Laptop

You can use Spacebar or Arrow keys to navigate, and here's all the keys for navigation:

โ† or โ†‘ or PageUp: Go to the previous Step.

โ†’ or โ†“ or Space or PageDown: Go to the next Step.

Home: Go to the first Step.

End: Go to the last Step.

p.s. You can also Click the Step directly.

Progress (Step Counter)

Provide progress bar and Slide Counter (current/total number), let presentation more clearly.

Hash Permalinks

You can navigate to the Step you want with #/step-id.

Usage

Components

React-impressJS have two components: <Impress /> and <Step />, as same as impress.js.

<Impress /> contains the root of impress and the camera, then put <Step /> inside impress component, magic happens โœจ

What's impress.js!?

It's an awesome presentation framework power of CSS3 transorms and transitions, please check THIS first!!

API

Impress props

name type description default
rootData Object setting impress basic config defaults
fallbackMessage String or Element fallback message is only visible when there is impress-not-supported -
hint Boolean display hint or not true
hintMessage String or Element hint for presentation -
progress Boolean progress of presentation false
const defaults = {
    width: 1024,
    height: 768,
    maxScale: 1,
    minScale: 0,
    perspective: 1000,
    transitionDuration: 1000
};

Step props

name type description default
id String id of dom node "step-" + timestamp idHelper(counter of Step)
className String additional css class of step dom node ''
data Object setting Step's presentation defaultData
duration number define duration of the transition in ms 1000
const defaultData = {
  x: 0,       // as data-x
  y: 0,       // as data-y
  z: 0,       // as data-z
  rotateX: 0, // as data-rotate-x
  rotateY: 0, // as data-rotate-y
  rotateZ: 0, // as data-rotate and data-rotate-z
  scale: 1    // as data-scale
};

Basic Use

import { Impress, Step } from 'react-impressjs';
// styles of react-impressjs
import 'react-impressjs/styles/react-impressjs.css';

<Impress 
    progress={true}
    fallbackMessage={<p>Sorry, your <b>device or browser</b> couldn't support well.</p>}
    >
    <Step id={'overview'} /> 
    <Step id={'any_id'} className={'class_name'} />
    <Step className={'without_id_is_ok'} 
          data={
            {
                x:100,
                y:-100,
                scale:2
            }}/>
    <Step duration={1500}>
        <h1>Any Element write in Step!</h1>
        <hr />
        <p>Made by your <b>Creativity</b> !!</p>
    </Step>
</Impress>

Style

Currently, you can use style of impress.js or React-impressJS in your app:

// style of impress
import 'react-impressjs/styles/impress-demo.css';

// style of react-impressjs
import 'react-impressjs/styles/react-impressjs.css';

We suggest you use the React-impressJS.

If you have the better one, I'm glad you can share with us, expect yours! ๐Ÿ˜๐Ÿ˜

Development

This Component is still under development, if you have any suggestion, you could tell me in issue or fork this repo ๐Ÿ’ช

License

React-impressJS is released under the MIT license.

This project was bootstrapped with Create React App.

react-impressjs's People

Contributors

bartekczyz avatar georgiowan 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  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  avatar  avatar

react-impressjs's Issues

Remove excess styles

First off I want to say that this is awesome. Thanks for putting this together for us.

One suggestion though is to remove excess styling that we do not need. It is just a pain to have to over write all these css styles for things that Im assuming most people are going to change. So far I have run into background color, font-size in the step class and backgrounds and padding on the a tag in the step.

I think it would be better if this was setup with out any styles that it did not need to do the animations to move from step to step. That way it would inherit my pre existing css and I would not have to even think about fighting with the styles that are there already.

Another thing to think about is to allow passing inline styles into the components. A lot of react projects have tried to move away from the idea of global css styles and it would be nice to not need to define classes just for this project.

TypeScript support

Hi @GeorgioWan! Thanks for your contribution and I really like this project and have used it to provide some impressjs template for my own usage. Since I'm using TypeScript in almost all my project, I'd be appreciated if you could add TS support in the library when you have time.

SSR support

Accessing document in top level cause problems in server side rendering. There is one of them at util.js:43 but maybe there is more. With typeof document === 'undefined' we can find out that it code is in node or browser and don't access dom in case of node. An if (typeof document === 'undefined') return () => ({}); in the util.js should work if I understand your code correctly.

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.