All Projects → arscan → Pleaserotate.js

arscan / Pleaserotate.js

Licence: mit
🔄 Politely ask your users to view your mobile website in portrait or landscape mode

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Pleaserotate.js

Swiftlysalesforce
The swiftest way to build iOS apps that connect to Salesforce
Stars: ✭ 115 (-4.96%)
Mutual labels:  mobile
Truffle Shuffle
An Android data-driven, percentage-based UI Card Gallery Library
Stars: ✭ 117 (-3.31%)
Mutual labels:  mobile
Koom
KOOM is an OOM killer on mobile platform by Kwai.
Stars: ✭ 2,247 (+1757.02%)
Mutual labels:  mobile
Go Gtp
GTP(GPRS Tunneling Protocol) implemented in pure Golang.
Stars: ✭ 116 (-4.13%)
Mutual labels:  mobile
Interact.js
JavaScript drag and drop, resizing and multi-touch gestures with inertia and snapping for modern browsers (and also IE9+)
Stars: ✭ 10,561 (+8628.1%)
Mutual labels:  mobile
Mentorship Android
Mentorship System is an application that matches women in tech to mentor each other, on career development, through 1:1 relations during a certain period of time. This is the Android application of this project.
Stars: ✭ 117 (-3.31%)
Mutual labels:  mobile
Powerup Android
PowerUp is an educational choose-your-own-adventure game that utilizes a users uploaded curriculum to empower pre-adolescents to take charge of their reproductive health. This is the Android version of the game.
Stars: ✭ 114 (-5.79%)
Mutual labels:  mobile
Hello imgui
Hello, Dear ImGui: cross-platform Gui apps for Windows / Mac / Linux / iOS / Android / Emscripten with the simplicity of a "Hello World" app
Stars: ✭ 120 (-0.83%)
Mutual labels:  mobile
Eruda
Console for mobile browsers
Stars: ✭ 11,547 (+9442.98%)
Mutual labels:  mobile
Onionbrowser
An open-source, privacy-enhancing web browser for iOS, utilizing the Tor anonymity network
Stars: ✭ 1,702 (+1306.61%)
Mutual labels:  mobile
Mobile Threat Catalogue
NIST/NCCoE Mobile Threat Catalogue
Stars: ✭ 116 (-4.13%)
Mutual labels:  mobile
Tenginekit
TengineKit - Free, Fast, Easy, Real-Time Face Detection & Face Landmarks & Face Attributes & Hand Detection & Hand Landmarks & Body Detection & Body Landmarks & Iris Landmarks & Yolov5 SDK On Mobile.
Stars: ✭ 2,103 (+1638.02%)
Mutual labels:  mobile
Model2app
Turn your Swift data model into a working CRUD app.
Stars: ✭ 118 (-2.48%)
Mutual labels:  mobile
Bodyweight Fitness Ios
Bodyweight Fitness (iOS)
Stars: ✭ 115 (-4.96%)
Mutual labels:  mobile
Dom7
Minimalistic JavaScript library for DOM manipulation, with a jQuery-compatible API
Stars: ✭ 119 (-1.65%)
Mutual labels:  mobile
Vux 2.0
根据vux修改升级的vux2,基于vue,weui的ui组件库
Stars: ✭ 115 (-4.96%)
Mutual labels:  mobile
Vuetify Swipeout
👆 A swipe out example built with Vue CLI 3 + Vuetify + Swiper.
Stars: ✭ 117 (-3.31%)
Mutual labels:  mobile
Flutter app sample
flutter app sample
Stars: ✭ 120 (-0.83%)
Mutual labels:  mobile
Quickmenu
The new era of mobile navigation for the web, we're out of hamburgers.
Stars: ✭ 119 (-1.65%)
Mutual labels:  mobile
Calendar
📆 calendar 日历
Stars: ✭ 119 (-1.65%)
Mutual labels:  mobile

pleaserotate.js

A simple way to force mobile users to view your site in portrait or landscape mode. Include this js file and it will replace your site with a friendly message until the users' device is in the proper orientation.

Example

View it in action over here (mobile device required to see it).

Basic Usage

Just include the script file anywhere in your doc:

<script src="pleaserotate.js"></script>

Style using CSS. Configure by creating a window.PleaseRotateOptions object before you include the script.

<style>
    /* style the elements with CSS */
    #pleaserotate-graphic{
        fill: #fff;
    }

    #pleaserotate-backdrop {
        color: #fff;
        background-color: #000;
    }
</style>

<script>
    /* you can pass in options here */
    PleaseRotateOptions = {
        forcePortrait: true // if you would prefer to force portrait mode
    };
</script>
<script src="pleaserotate.js"></script>

Using AMD or CommonJS

This supports AMD and CommonJS. Require pleaserotate.js and call PleaseRotate.start(options) to use.

Options

The current default options are:

var PleaseRotateOptions = {
    startOnPageLoad: true,
    onHide: function(){},
    onShow: function(){},
    forcePortrait: false,
    message: "Please Rotate Your Device",
    subMessage: "(or click to continue)",
    allowClickBypass: true,
    onlyMobile: true,
    zIndex: 1000,
    iconNode: null
};

Note Regarding Startup

Depending on where you including the javascript file, other parts of your site could render before pleaserotate.js has a chance to block them out. To help you work around that, pleaserotate.js attaches classes to the <html> element while running. Look for pleaserotate-showing and pleaserotate-hiding classes, which indicate that pleaserotate.js has finished loading and if it is currently showing the "Please Rotate" message or not. You can use CSS to hide parts of your page until those classes show up.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].