A Pen by stefano perelli on CodePen.
Created
February 12, 2018 05:40
-
-
Save CodeMyUI/770fc307ee4c11b44cd7ece5bf227dfb to your computer and use it in GitHub Desktop.
letters effect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
var text = $(".text"); | |
$(window).scroll(function() { | |
var scroll = $(window).scrollTop(); | |
if (scroll >= 200) { | |
text.removeClass("hidden"); | |
} else { | |
text.addClass("hidden"); | |
} | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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 1.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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment