Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. General Discussion
  3. disable mobile rotation / show notification when phone is landscape

disable mobile rotation / show notification when phone is landscape

Scheduled Pinned Locked Moved General Discussion
7 Posts 3 Posters 1.2k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T
    T
    Toby
    wrote on last edited by arminunruh
    #1

    Hi

    Is there a way to stop mobile rotation / lock screen?

    Cheers
    Toby

    1 Reply Last reply
    1
    • arminunruhA
      arminunruhA
      arminunruh
      Global Moderator
      wrote on last edited by
      #2

      no there isn't :/

      1 Reply Last reply
      0
      • Z
        Z
        zochovsky
        wrote on last edited by
        #3

        It would be great if this feature could be added.

        1 Reply Last reply
        0
        • arminunruhA
          arminunruhA
          arminunruh
          Global Moderator
          wrote on last edited by
          #4

          there is no way to do this!

          you can probably show a warning using custom css & custom html that shows up when the phone is in landscape mode using a combination of media queries and html classes

          like
          https://stackoverflow.com/questions/66044959/how-do-i-show-something-only-if-the-device-is-portrait-with-html-css

          and

          body.is-touchdevice

          body has a class of "is-touchdevice" when ure on a phone

          1 Reply Last reply
          0
          • arminunruhA
            arminunruhA
            arminunruh
            Global Moderator
            wrote on last edited by
            #5

            ok heres an example:

            custom html at bottom:

            <div class="rotate-notification">
            <div class="rotate-text _Default_no_spaces">Please rotate your phone</div>
            </div>
            

            custom css:

            .rotate-notification{
            display:none;
            z-index: 999999;
            background-color: black;
            width: 100%;
            height: 100vh;
            position: fixed;
            top: 0;
            left: 0;
            }
            
            .rotate-text{
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            color: white!important;
            }
            
            @media (orientation: landscape) and (max-width: 1024px){
            body.is-touchdevice .rotate-notification{
            display: block;
            }
            }
            

            haven't tested it :D

            1 Reply Last reply
            0
            • arminunruhA
              arminunruhA
              arminunruh
              Global Moderator
              wrote on last edited by
              #6

              instead of doing this you could also do:

              in
              lay options → Phone Breakpoint

              you can set this to a higher value, so the phone version would still show up on landscape mode, instead of the desktop version

              maybe that looks good enough then

              1 Reply Last reply
              0
              • arminunruhA
                arminunruhA
                arminunruh
                Global Moderator
                wrote on last edited by
                #7

                Or if you want an image:

                <div class="rotate-notification">
                <img src="https://media.istockphoto.com/id/1144546554/vector/rotating-phone-from-vertical-to-horizontal-position-phone-vector-icon.jpg?s=612x612&w=0&k=20&c=dnBtqmZ7_8Cjk2UubtE_o1gDkaIMvs1kStk45tzmEiY=">
                </div>
                

                css:

                .rotate-notification{
                display:none;
                z-index: 999999;
                background-color: black;
                width: 100%;
                height: 100vh;
                position: fixed;
                top: 0;
                left: 0;
                }
                
                .rotate-notification img{
                position: fixed;
                top: 50%;
                left: 50%;
                transform: translate(-50%, -50%);
                width: 150px;
                }
                
                @media (orientation: landscape) and (max-width: 1024px){
                body.is-touchdevice .rotate-notification{
                display: block;
                }
                }
                
                1 Reply Last reply
                0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                Online Users
                R
                robertobarbes
                Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
                laytheme.com
                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Recent
                • Tags
                • Popular
                • Users
                • Search