prevent-orientation
Prevent orientation mode on mobile device
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