Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How do I Re-create this website design? (Fluid/responsive video)

Featured Replies

Hi there,

 

I came a cross a great website designed for a school. I'm not sure If Im allowed to post links so Ill refrain from going into detail about the website itself.

The design is of a video which takes up the whole page that is responsive to the size of the window. The video is the full size of the page then if you shrink the page size, the video shrinks with it so it stays full screen on the page.

 

I don't think the site is using percentages because I noticed that if I "inspect element" of the page.. THat the width and height of the video is changing whenever I change the window size. It change from -700px to -200px to whatever... I feel like there must be some code that is looping and checking to see if the window size has changed and it adjusts the pixels of the video if the window has changed...

Any ideas how I can implement something like this in my site? Could I use jquery for this?

 

-THanks!

  • Author

   $(window).resize(function(){     resizeVideo();    });
      
    function resizeVideo(){                          
          vid.height=$(window).height();     
     
          var diff = (vid.width - $(window).width()) / 2;
          $('#my_video').css("margin-left",diff/2);
    }

So this is what I'm working with so far. Any mathematicians able to help with finding the right calculations to use?

 

EDIT

The Vid object I reference to in the code above

vid = document.getElementById("my_video");   

           <video id="my_video" autoplay>
                   <source src="vid.mp4">
           </video>

Edited by HighDarren

  • Author

 

Too Pro?

 

If you were Pro you'd know that you can scale the whole thing using some very simple CSS; no jQuery needed.

 

First Google SERP is this: http://www.codesynthesis.co.uk/tutorials/html-5-full-screen-and-responsive-videos

 

Now I'll get back to being amateur.

Thank for the link mate!

  • 3 weeks later...
  • Author

Are there any ways I can better manage aspect ratio of images when it comes to responsive design? Im using an image for the background but it looks strange if the browser is too wide or if it's too high because of it stretching.

Are there any ways I can better manage aspect ratio of images when it comes to responsive design? Im using an image for the background but it looks strange if the browser is too wide or if it's too high because of it stretching.

 

If it's for a background the bIackground-size property should help https://css-tricks.com/almanac/properties/b/background-size/

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.