diff --git a/static/css/base.css b/static/css/base.css index d87bc00..87f974f 100644 --- a/static/css/base.css +++ b/static/css/base.css @@ -692,7 +692,7 @@ footer, .embed iframe, .embed object, -.embed embed { +.embed embed,.embed video { position: absolute; top: 0; left: 0; @@ -700,6 +700,51 @@ footer, height: 100%; margin: 0; } +/* -- Responsive background video +https://fvsch.com/code/video-background/ -- */ + +.fullscreen > .embed { + position: fixed; + height: auto; + top: 0; + right: 0; + bottom: 0; + left: 0; + padding-bottom: 0; +} + +/* 1. No object-fit support: */ +@media (min-aspect-ratio: 16/9) { + .fullscreen > .embed > iframe, + .fullscreen > .embed > object, + .fullscreen > .embed > embed, + .fullscreen > .embed > video { + height: 300%; + top: -100%; + } +} +@media (max-aspect-ratio: 16/9) { + .fullscreen > .embed > iframe, + .fullscreen > .embed > object, + .fullscreen > .embed > embed, + .fullscreen > .embed > video { + width: 300%; + left: -100%; + } +} +/* 2. If supporting object-fit, overriding (1): */ +@supports (object-fit: cover) { + .fullscreen > .embed > iframe, + .fullscreen > .embed > object, + .fullscreen > .embed > embed, + .fullscreen > .embed > video { + top: 0; + left: 0; + width: 100%; + height: 100%; + object-fit: cover; + } +} /*=== Browser (Screenshots) ================ */