A Pen by Joe Villanueva on CodePen.
Created
September 21, 2014 02:43
-
-
Save CombatCreative/4f55478c828b3ff802f7 to your computer and use it in GitHub Desktop.
A Pen by Joe Villanueva.
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
<div> | |
<h1>Better List Item Rows</h1> | |
<ul class="container delayedEntry"> | |
<li>A lil somethin</li> | |
<li>A lil somethin</li> | |
<li>A lil somethin</li> | |
<li>A lil somethin</li> | |
<li>A lil somethin</li> | |
</ul> | |
</div> |
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(http://fonts.googleapis.com/css?family=Open+Sans:300); | |
@keyframes delayedEntry { | |
0% { transform: translateY(500%); } | |
100% { transform: translateY(0%); } | |
} | |
body { | |
height: 100%; | |
background-color: #22B7EB; | |
padding: 40px; | |
font-family: Open Sans, sans-serif; | |
} | |
div { | |
background-color: #FFFFFF; | |
padding: 20px; | |
.container { | |
display: flex; | |
flex-direction: column; | |
width: 100%; | |
margin: 0; | |
padding: 0; | |
overflow: hidden; | |
li { | |
list-style-type: none; | |
background-color: #EFEFEF; | |
border: 2px solid #FFFFFF; | |
padding: 5px; | |
transition: background-color 0.3s ease; | |
transform: translateY(500%); | |
&:hover { | |
background-color: #FFFFFF; | |
} | |
} | |
} | |
} | |
/* Choose the max number of visible rows for your situation */ | |
@for $i from 1 through 10 { | |
li:nth-child(#{$i}) { | |
animation: delayedEntry 0.2s cubic-bezier(.05,.58,.32,1) forwards; | |
$delay: "." + (#{$i}) + "s"; | |
animation-delay: unquote($delay); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment