css - "Filling Water" effect with infinite repeat wrapping -
i've been trying achieve effect seen here 1 wave in circle: http://www.jquery-az.com/css/demo.php?ex=131.0_1
unfortunately, i've been unable animation repeat smoothly own svg, seen here: http://jsbin.com/diserekigo/1/edit?html,css,output. you'll notice bottom "rectangle" part isn't filled either.
my css follows:
.circle { border-radius: 100%; border: 1px solid black; width: 200px; height: 200px; overflow: hidden; position: relative; perspective: 1px; } .liquid { position: absolute; left: 0; top: 0; z-index: 2; width: 100%; height: 100%; -webkit-transform: translate(0, 80%); transform: translate(0, 80%); } .wave { left: 0; width: 400%; position: absolute; bottom: 100%; margin-bottom: -1px; -webkit-animation: wave-front .7s infinite linear; animation: wave-front 0.7s infinite linear; } @-webkit-keyframes wave-front { 100% { -webkit-transform: translate(-100%, 0); transform: translate(-100%, 0); } } @keyframes wave-front { 100% { -webkit-transform: translate(-100%, 0); transform: translate(-100%, 0); } }
how can improve repeating behavior, make wave fill entire space beneath it?
you're missing lot original demo. why not copy , paste , make whatever local changes size , position wanted? of issues result of not having svg elements - original demo has 3, not 1. i've added them jsbin work:
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" style="display: none;"> <symbol id="wave"> <path d="m420,20c21.5-0.4,38.8-2.5,51.1-4.5c13.4-2.2,26.5-5.2,27.3-5.4c514,6.5,518,4.7,528.5,2.7c7.1-1.3,17.9-2.8,31.5-2.7c0,0,0,0,0,0v20h420z"></path> <path d="m420,20c-21.5-0.4-38.8-2.5-51.1-4.5c-13.4-2.2-26.5-5.2-27.3-5.4c326,6.5,322,4.7,311.5,2.7c304.3,1.4,293.6-0.1,280,0c0,0,0,0,0,0v20h420z"></path> <path d="m140,20c21.5-0.4,38.8-2.5,51.1-4.5c13.4-2.2,26.5-5.2,27.3-5.4c234,6.5,238,4.7,248.5,2.7c7.1-1.3,17.9-2.8,31.5-2.7c0,0,0,0,0,0v20h140z"></path> <path d="m140,20c-21.5-0.4-38.8-2.5-51.1-4.5c-13.4-2.2-26.5-5.2-27.3-5.4c46,6.5,42,4.7,31.5,2.7c24.3,1.4,13.6-0.1,0,0c0,0,0,0,0,0l0,20h140z"></path> </symbol> </svg> <div class="circle"> <div class="liquid"></div> <div id="water" class="water"> <svg viewbox="0 0 560 20" class="water_wave water_wave_back"> <use xlink:href="#wave"></use> </svg> <svg viewbox="0 0 560 20" class="water_wave water_wave_front"> <use xlink:href="#wave"></use> </svg> </div> </div>
you need javascript water fill.
Comments
Post a Comment