Skip to content

Instantly share code, notes, and snippets.

@atran
Created August 13, 2014 17:44
Show Gist options
  • Save atran/d4ee982e0d68b0edb059 to your computer and use it in GitHub Desktop.
Save atran/d4ee982e0d68b0edb059 to your computer and use it in GitHub Desktop.
Please rotate.
$('body').bind 'orientationchange', (e) ->
orientation = if Math.abs(window.orientation) is 90 then 'landscape' else 'portrait'
$('body').removeClass('portrait landscape')
.addClass(orientation)
.trigger('turn', orientation: orientation)
body.landscape::after {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
padding: 15%;
content: "Portrait only mode supported";
text-align: center;
font-size: 16px;
background: rgba(255, 255, 255, 0.9);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment