0.1.4 • Published 5 years ago

vp-restrict-lib v0.1.4

Weekly downloads
22
License
-
Repository
github
Last release
5 years ago

Viewport Restrict Library (vp-restrict-lib)

This library created to restrict some viewport or orientation with overlay.

Getting started

Install the npm package with command:

npm i vp-restrict-lib --save

How to use

Code

Import the ViewportRestrict to your code

import ViewportRestrict from 'vp-restrict-lib';

class App extends Component {
    render() {
        return (
            <ViewportRestrict 
                type="desktop_landscape" 
                image={require('./test.jpg')}
                animation={true}
                animationSpeed={1000}
                backgroundColor="rgba(9, 18, 34, 1)"
            />
        );
    }
}

Props

PropsTypeParametersDefinition
type (Required)Stringportrait/landscape/desktop_landscapeViewport or orientation to restrict
imagenode/URLrequire('./img/scape.png')Image to show on overlay. This could be node directory or image url.
animationBooleantrueToggle Animation
animationSpeedNumber1500Change Rotating Animation Speed
backgroundColorStringrgba(9, 18, 34, 1)Change Background Color. Could be RGBA code or Hex Code
textStringSilahkan buka di smartphone kamu atau putar smartphone kamu ke posisi vertical untuk visual yang lebih baik.Text to display when overlay is showing

To Do

  • Custom Animation
  • Custom Breakpoint

License

MIT

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago