Skip to content

Instantly share code, notes, and snippets.

@tofbabs
Created October 10, 2020 05:04
Show Gist options
  • Save tofbabs/f1f7e06dd1ff4771ec4e56d8736ee0fd to your computer and use it in GitHub Desktop.
Save tofbabs/f1f7e06dd1ff4771ec4e56d8736ee0fd to your computer and use it in GitHub Desktop.
<div class="video-background">
<div class="video-foreground">
<iframe src="https://www.youtube.com/embed/N9Y86YCRRDg?&amp;autoplay=1&amp;loop=1&amp;playlist=N9Y86YCRRDg&amp;rel=0&amp;controls=0&amp;mute=1" frameborder="0" allowfullscreen></iframe>
</div>
</div>
<style>
* { box-sizing: border-box; }
.video-background {
background: #000;
position: fixed;
top: 0; right: 0; bottom: 0; left: 0;
z-index: -99;
}
.video-foreground,
.video-background iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
}
@media (min-aspect-ratio: 16/9) {
.video-foreground { height: 300%; top: -100%; }
}
@media (max-aspect-ratio: 16/9) {
.video-foreground { width: 300%; left: -100%; }
}
@media all and (max-width: 600px) {
.vid-info { width: 50%; padding: .5rem; }
.vid-info h1 { margin-bottom: .2rem; }
}
@media all and (max-width: 500px) {
.vid-info .acronym { display: none; }
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment