Cycling text animation css -
i want make text cycling effect list of text
this i've tried far:
html
<ul class="descslider"> <li id="first"> <h3>batik</h3> <p class="lead">color</p> <hr> <p class="desc">description 1</p> </li> <li id="second"> <h3>batik</h3> <p class="lead">design</p> <hr> <p class="desc">description 2</p> </li> <li id="third"> <h3>batik</h3> <p class="lead">theme</p> <hr> <p class="desc">description 3</p> </li> </ul>
css
.descslider{ text-align: center; position: relative; height: 200px; overflow: hidden; margin: 0; padding: 0; } .descslider li{ width: 100%; list-style-type: none; position: absolute; height: 200px; top: -215px; text-align: center; } .descslider li#first { animation: cycle 12s ease-out infinite; } .descslider li#second { animation: cycletwo 12s ease-out infinite; } .descslider li#third { animation: cyclethree 12s ease-out infinite; } /* animation */ @keyframes cycle { 0% { top: -205px; opacity:1} 6% { top: 0px; opacity:1} 26% { top: 0px; opacity:1; z-index:20; } 33% { top: 205px; opacity: 0; z-index: 20; } 34% { top: -205px; opacity: 0; z-index: -1; } 92% { top: -205px; opacity: 0; z-index: 20; } 96% { top: -205px; opacity: 0; } 100%{ top: -205px; opacity: 0; } } @keyframes cycletwo { 0% { top: -205px; opacity: 0; } 26% { top: -205px; opacity: 0; } 32% { top: 0px; opacity: 1; } 38% { top: 0px; opacity: 1; } 56% { top: 0px; opacity: 1; z-index: 20; } 62% { top: 205px; opacity: 0; z-index: 20; } 63% { top: -205px; opacity: 0; z-index: -1; } 100%{ top: -205px; opacity: 0; z-index: -1; } } @keyframes cyclethree { 0% { top: -205px; opacity: 0; } 56% { top: -205px; opacity: 0; } 62% { top: 0px; opacity: 1; } 68% { top: 0px; opacity: 1; } 86% { top: 0px; opacity: 1; } 92% { top: 205px; opacity: 0; z-index: 20; } 93% { top: -205px; opacity: 0; z-index: -1; } 100%{ top: -205px; opacity: 0; z-index: -1; } }
you can see full code here: https://jsfiddle.net/08r36bc8/1/
i want make animation effect looks in: http://ihuntington.co/
how make text animation using css? thanks
Comments
Post a Comment