<div class="container">
<p>
<span>
The Future is Now.
</span>
</p>
<p>
<span>
Take Action.
</span>
</p>
</div>
*, ::before, ::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html, body {
height: 100%;
}
body {
font-family: Montserrat, Helvetica, sans-serif;
background: url("bg.jpg");
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.container {
max-width: 1600px;
margin: 0 auto;
padding: 100px 20px 0;
}
p {
text-transform: uppercase;
color: #222;
font-weight: 900;
color: transparent;
font-size: 0px;
}
p span {
display: inline-block;
position: relative;
overflow: hidden;
font-size: clamp(20px, 8vw, 120px);
}
p span::after {
content: "";
display: block;
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
transform: translateX(-100%);
}
p:nth-child(1) {
font-weight: 300;
animation: txt-appearance 0s 1s forwards;
}
p:nth-child(2) {
animation: txt-appearance 0s 1.25s forwards;
}
p:nth-child(1) span::after {
background: salmon;
animation: slide-in 0.75s ease-out forwards,
slide-out 0.75s 1s ease-out forwards;
}
p:nth-child(2) span::after {
background: royalblue;
animation: slide-in 0.75s 0.3s ease-out forwards,
slide-out 0.75s 1.3s ease-out forwards;
}
@keyframes slide-in {
100% {
transform: translateX(0%);
}
}
@keyframes slide-out {
100% {
transform: translateX(100%)
}
}
@keyframes txt-appearance {
100% {
color: #222;
}
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.