Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Custom media queries (Mobile Only)</title>
- <style>
- .clone {
- position: absolute;
- top: 10px;
- left: 10px;
- text-decoration: none;
- background-color: white;
- width: 150px;
- text-align: center;
- color: red;
- font-family: arial black;
- padding: 5px 20px;
- }
- .sub_clone {
- position: absolute;
- top: 50px;
- left: 10px;
- text-decoration: none;
- background-color: white;
- width: 150px;
- text-align: center;
- color: red;
- font-family: arial black;
- padding: 5px 20px;
- }
- body {
- margin: 0;
- overflow: hidden;
- }
- .desktop {
- background-color: red;
- width: 100%;
- height: 100vh;
- position: absolute;
- display: none;
- }
- .desktop h1 {
- font-family: verdana;
- text-align: center;
- color: white;
- font-size: 100px;
- margin-top: 200px;
- }
- .media h1 {
- font-family: courier;
- text-align: center;
- color: red;
- font-size: 50px;
- }
- #media {
- position: absolute;
- top: 0px;
- left: 0;
- width: 100%;
- height: 100vh;
- display: none;
- }
- img {
- width: 80%;
- margin: 20px auto;
- display: block;
- }
- video {
- width: 80%;
- margin: auto;
- display: block;
- transform-origin: center top;
- transform: scaleY(1.5);
- padding-bottom: 20px;
- }
- #bt {
- width: 30px;
- height: 30px;
- border-radius: 50%;
- position: fixed;
- right: 0;
- top: 0;
- margin: 10px;
- }
- #bt_menu {
- width: 30px;
- height: 30px;
- border-radius: 50%;
- position: absolute;
- right: 0;
- top: 0;
- margin: 10px;
- }
- #menu {
- position: absolute;
- top: 0px;
- left: 0;
- width: 100%;
- height: 100vh;
- display: none;
- box-sizing: border-box;
- background-color: olive;
- padding-top: 40px;
- }
- .link {
- margin: 5px 0;
- text-decoration: none;
- display: block;
- color: white;
- font-family: verdana;
- font-size: 16px;
- padding: 5px 10px;
- font-weight: 900;
- background-color: red;
- }
- @media all and (max-width:425px) {
- #media {
- display: block;
- overflow-Y: scroll;
- }
- .clone{display:none;}
- .sub_clone{display:none;}
- }
- @media all and (min-width: 426px) and (max-width: 538px) and (orientation: landscape) {
- #media {
- display: block;
- overflow-Y: scroll;
- }
- .clone{display:none;}
- .sub_clone{display:none;}
- }
- @media all and (min-width: 824px) {
- .desktop {
- display: block;
- }
- }
- </style>
- </head>
- <body id='bd'>
- <section id='desktop' class='desktop'>
- <h1>Mobile Only</h1>
- </section>
- <section id='menu' class='menu'>
- <button id='bt_menu'></button>
- <a class='link' href='https://codepen.io/manuel-andrade/pen/GRMxLyV'>Javascript HTML5 video autoplay fullscreen
- </a>
- <a class='link' href='https://codepen.io/manuel-andrade/pen/VwMxWvP'>Anonymous function javascript
- </a>
- </section>
- <section id='media' class='media'>
- <button id='bt'></button>
- <img src='https://1xpto.netlify.app/pics/cat.gif' />
- <h1 class='lazy'>Lazy <br> Cat</h1>
- <video id='video' autoplay muted loop src='https://1xpto.netlify.app/video/video.mp4'></video>
- </section>
- <a id='clone' class='clone' title="Subscribe and hit the notification bell for more updates. It's free." href='https://www.youtube.com/channel/UCqLpDK0eOsG1eEeF9jOUZkw'>SUBSCRIBE</a>
- <a id='sub_clone' class='sub_clone' href='https://1xpto.netlify.app/video/video sample02.mp4'>VIDEO SAMPLE</a>
- <script>
- bt.onclick = () => {
- media.style.display = 'none';
- menu.style.display = 'block';
- menu.style.zIndex = '-1';
- }
- bt_menu.onclick = () => {
- media.style.display = 'block';
- menu.style.display = 'none';
- desktop.style.zIndex = '1';
- clone.style.zIndex = '1';
- sub_clone.style.zIndex = '1';
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement