1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| <div class="frame"> <div class="ball one"></div> <div class="ball two"></div> <div class="ball three"></div> </div>
<style> .frame { background-color: #EEEEEE; position: relative; width: 300px; height: 200px; } .ball { width: 100px; height: 100px; border-radius: 100%; position: absolute; animation: animX 3s cubic-bezier(0.36, 0, 0.64, 1) infinite alternate, animY 3s cubic-bezier(0.36, 0, 0.64, 1) infinite alternate, scale 3s cubic-bezier(0.36, 0, 0.64, 1) infinite alternate; } .ball.one { background-color: #FFFFCC; animation-delay: -6s, -4.5s, -4.5s; } .ball.two { background-color: #CCFFFF; animation-delay: -4s, -2.5s, -2.5s; } .ball.three { background-color: #FFCCCC; animation-delay: -2s, -0.5s, -0.5s; } @keyframes animX { 0% { left: 0px; } 100% { left: 200px; } } @keyframes animY { 0% { top: 0px; } 100% { top: 100px; } } @keyframes scale { 0% { transform: scale(0.7); } 100% { transform: scale(1); } } </style>
|