1.1.0 • Published 7 years ago

react-impressjs v1.1.0

Weekly downloads
54
License
MIT
Repository
github
Last release
7 years ago

React-impressJS

impress.js via React :tada:

NPM version NPM download Build Status LICENCE

Install

NPM install

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 :sparkles:

What's impress.js!?

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

Quick Navigation

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.

Basic Use

import { Impress, Step } from 'react-impressjs';

<Impress 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>

API

Impress props

nametypedescriptiondefault
rootDataObjectsetting impress basic configdefaults
fallbackMessageString or Elementfallback message is only visible when there is impress-not-supported-
hintOnBooleandisplay hint or nottrue
hintMessageString or Elementhint for presentation-
progressOnBooleanprogress of presentationfalse
const defaults = {
    width: 1024,
    height: 768,
    maxScale: 1,
    minScale: 0,
    perspective: 1000,
    transitionDuration: 1000
};

Step props

nametypedescriptiondefault
idStringid of dom node"step-" + ~timestamp~ idHelper(counter of Step)
classNameStringadditional css class of step dom node''
dataObjectsetting Step's presentationdefaultData
durationnumberdefine duration of the transition in ms1000
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
};

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';

If you have the better one, I'm glad you can share with us, expect yours! :grin::grin:

Development

This Component is still under development, if you have any suggestion, you could tell me in issue or fork this repo :muscle:

License

React-impressJS is released under the MIT license.

This project was bootstrapped with Create React App.

1.1.0

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.0.6

7 years ago

0.0.53

7 years ago

0.0.52

7 years ago

0.0.51

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago