mirror of
https://github.com/webslides/WebSlides.git
synced 2025-08-23 13:23:23 +02:00
Responsive background video
This commit is contained in:
committed by
GitHub
parent
2c96d440e3
commit
d2bb7fa254
@@ -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) ================ */
|
||||
|
||||
|
Reference in New Issue
Block a user