Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rickdaalhuizen90/88e38b774c18db45fc44a261d3e9513f to your computer and use it in GitHub Desktop.
Save rickdaalhuizen90/88e38b774c18db45fc44a261d3e9513f to your computer and use it in GitHub Desktop.
Full-screen video background

Full-screen video background

This technique based on Fullscreen Video Background which modify to make it possible for Video Parallax Background.

A Pen by Rick Daalhuizen on CodePen.

License.

<div class="layer"></div>
<text>
<h1>Nastya Ivanov</h1>
<p>
height: 180cm <br>
hair: blond <br>
eyes: grey <br>
</p>
</text>
<!-- HTML5 video tag -->
<video poster="http://mixhdwallpapers.com/wp-content/uploads/2014/07/13.jpg" autoplay loop muted>
<!-- .mp4 file for native playback in IE9+, Firefox, Chrome and Safari-->
<source src="http://thenewcode.com/assets/videos/indre.mp4" type="video/mp4" />
<!-- flash fallback for IE6, IE7, IE8 and Opera -->
<object type="application/x-shockwave-flash"
data="swf/flowplayer-3.2.18.swf">
<param name="movie" value="swf/flowplayer-3.2.18.swf" />
<param name="allowFullScreen" value="true" />
<param name="wmode" value="transparent" />
<!-- fallback image if flash fails -->
<img src="http://mixhdwallpapers.com/wp-content/uploads/2014/07/13.jpg" title="No Flash found" />
</object>
</video>
@import url(https://fonts.googleapis.com/css?family=Lato:300);
body {
margin: 0;
padding: 0;
}
video {
position: fixed;
width: 100%;
height: auto;
}
.layer {
position: fixed;
z-index: 1;
width: 100%;
height: 100%;
background-color: rgba(50, 50, 50, .5);
}
text {
position: absolute;
left: 5%;
top: 30%;
background-color: rgba(150,150,150,.5);
z-index: 2;
padding: 15px 35px;
font-family: "lato", sans-serif;
font-size: 1.2em;
font-weight: 200;
letter-spacing: 4px;
line-height: 30px;
color: rgba(50,50,50,.7);
-webkit-animation: fadein 2s; /* Safari, Chrome and Opera > 12.1 */
-moz-animation: fadein 2s; /* Firefox < 16 */
-ms-animation: fadein 2s; /* Internet Explorer */
-o-animation: fadein 2s; /* Opera < 12.1 */
animation: fadein 2s;
}
@keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
/* Firefox < 16 */
@-moz-keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
/* Safari, Chrome and Opera > 12.1 */
@-webkit-keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
/* Internet Explorer */
@-ms-keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
/* Opera < 12.1 */
@-o-keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
text p {
color: rgba(200,200,200,.7);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment