Skip to content

Instantly share code, notes, and snippets.

@tcyrus
Last active August 29, 2015 14:20
Show Gist options
  • Save tcyrus/d8ab0a270516f98190c5 to your computer and use it in GitHub Desktop.
Save tcyrus/d8ab0a270516f98190c5 to your computer and use it in GitHub Desktop.
The intro sequence to Last Week Tonight
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link href="style.css" rel="stylesheet">
<title>Last Week Tonight</title>
</head>
<body>
<div class="center">
<div class="inner">
<h1 id="i1">last</h1>
<br>
<h1 id="i2">week</h1>
<br>
<h1 id="i3">tonight</h1>
<br>
<div id="i4">
<h3>with</h3>
<h2>john oliver</h2></div>
</div>
<div class="line"></div>
</div>
</body>
</html>
@import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,200);
html {
height: 100%;
}
body {
background: radial-gradient(#fff, #ccc);
overflow: hidden;
font-family: 'Source Sans Pro';
text-transform: uppercase;
}
.line {
background: #999;
height: 2px;
width: 200%;
position: absolute;
top: 50%;
left: 60%;
animation: line-length 1s linear 0.5s forwards;
}
.center {
width: 100%;
height: 100%;
position: absolute;
top: 0;
display: flex;
animation: move 1s linear forwards;
}
.inner {
width: 200px;
margin: auto;
line-height: 24px;
}
h1, h2, h3 {
display: inline-block;
font-weight: 100;
}
h1 {
letter-spacing: 2px;
margin: 0;
font-size: 48px;
text-shadow: 0 0 1px #000;
}
h2 {
margin: 0;
letter-spacing: 2px;
margin-left: 8px;
color: #78100B;
text-shadow: 0 0 2px #78100B;
}
h3 {
vertical-align: super;
margin: 0;
font-size: 16px;
text-shadow: 0 0 2px #000;
}
/*animation*/
#i1 {}
#i2 {
transform: scale(-1, 1);
opacity: 0;
animation: show_text 1s linear 1.7s forwards, spin 0.1s linear 3.5s forwards;
}
#i3 {
opacity: 0;
animation: show_text 1s linear 2s forwards;
}
#i4 {
opacity: 0;
animation: show_text 1s linear 2.5s forwards;
}
/*Keyframes*/
@keyframes move {
from {
left: -100%;
}
to {
left: 0;
}
}
@keyframes spin {
from {
transform: scale(-1, 1);
}
to {
transform: scale(1, 1);
}
}
@keyframes line-length {
from {
width: 200%;
}
to {
width: 0;
}
}
@keyframes show_text {
from {
z-index: -9999;
opacity: 0;
}
to {
z-index: 1;
opacity: 1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment