prevent-orientation
TypeScript icon, indicating that this package has built-in type declarations

2.1.0 • Public • Published

prevent-orientation

Prevent orientation mode on mobile device

NPM version NPM yearly download

screenshots

Installation

$ yarn add prevent-orientation

or

<script src="//unpkg.com/prevent-orientation"></script>

Usage

import {PreventOrientation} from 'prevent-orientation';

// Prevent to portrait orientation
new PreventOrientation().preventPortrait();

// Prevent to landscape orientation
new PreventOrientation().preventLandscape();

Customize

new PreventOrientation({
  text: 'Sorry, this device orientation is not supported',
  color: 'rgb(90, 90, 90)',
  background:
    'linear-gradient(to right, rgb(255, 175, 189), rgb(255, 195, 160))',
  fontSize: '1.2rem',
}).preventOrientationToAngle(0);

License

MIT

Package Sidebar

Install

npm i prevent-orientation

Weekly Downloads

34

Version

2.1.0

License

MIT

Unpacked Size

8.88 kB

Total Files

7

Last publish

Collaborators

  • nghiepit