<ul class="text hidden">
<li>N</li>
<li class="ghost">T</li>
<li class="ghost">T</li>
<li>D</li>
<li class="ghost">A</li>
<li class="ghost">T</li>
<li class="ghost">A</li>
<li class="spaced">D</li>
<li class="ghost">e</li>
<li class="ghost">s</li>
<li class="ghost">i</li>
<li class="ghost">g</li>
<li class="ghost">n</li>
<li class="spaced">N</li>
<li class="ghost">e</li>
<li class="ghost">t</li>
<li class="ghost">w</li>
<li class="ghost">o</li>
<li class="ghost">r</li>
<li class="ghost">k</li>
</ul>
@import url('https://fonts.googleapis.com/css?family=Muli:300,400,700');
* {
margin: 0;
padding: 0;
}
body {
background-color: #000;
height: 200vh;
font-family: 'Muli', sans-serif;
}
.text {
position: fixed;
top: 50%;
left: 50%;
transform: translateX(-50%) translateY(-50%);
list-style: none;
border-bottom: 0;
}
.text.hidden {
border-bottom: 1px solid #fff;
}
.text li {
display: inline-block;
float: left;
font-weight: 700;
font-size: 2em;
color: #fff;
opacity: 1;
transition: all 0.5s ease-in-out;
max-width: 2em;
}
.text.hidden li.spaced {
padding-left: 0;
}
.text li.spaced {
padding-left: 0.5em;
}
.text.hidden li.ghost {
opacity: 0;
max-width: 0;
}
$(function() {
var text = $(".text");
$(window).scroll(function() {
var scroll = $(window).scrollTop();
if (scroll >= 200) {
text.removeClass("hidden");
} else {
text.addClass("hidden");
}
});
});
This Pen doesn't use any external CSS resources.