Mehrere Webkit-Animationen

Ich versuche, mehrere Webkit-Animationen gleichzeitig auszuführen. Demo kannhier gesehen werden:

HTML:

<body>
  <div class="dot"></div>
</body>

JavaScript:

$(function(){

    $('body').append('<div class="dot" style="left:100px; top:200px"></div>');


});

CSS:

body{
  background: #333;
}

.dot{
    background: -webkit-radial-gradient(center, ellipse cover, #f00 90%, #fff 10%);
    border-radius: 6px;
    background: red;
    display: block;
    height: 6px;
    position: absolute;
    margin: 40px 0 0 40px;
    width: 6px;
    -webkit-box-shadow: 0 0 2px 2px #222;




    -webkit-animation: shrink 2.s ease-out;

    -webkit-animation: pulsate 4s infinite ease-in-out;
  }


  @-webkit-keyframes shrink{
    0%{
      -webkit-box-shadow: 0 0 2px 2px #222;
      -webkit-transform: scale(2);
    }
    50%{
      -webkit-box-shadow: 0 0 2px 2px #222;
          -webkit-transform: scale(1.5);
      }
    100%{
      -webkit-box-shadow: 0 0 2px 2px #222;
          -webkit-transform: scale(1);
      }
  }

    @-webkit-keyframes pulsate{
      0%{
          -webkit-transform: scale(1);
      -webkit-box-shadow: 0 0 2px 2px #222;
      }
      50%{
          -webkit-transform: scale(1.1);
      -webkit-box-shadow: 0 0 2px 2px #111;
      }
    100%{ 
          -webkit-transform: scale(1);
      -webkit-box-shadow: 0 0 2px 2px #222;
      }
  }

.dot hat zwei Animationen:

schrumpfenpulsieren (schwer zu sehen, aber es ist da)

Vielleicht muss ich einen guten Weg finden, um sie zu synchronisieren. Sobald die Animation verkleinert ist, pulsieren Sie. Ich kann sie nicht beide auf einmal ausführen, so pulsierend ist in .dot auskommentiert.

Irgendwelche Vorschläge? Vielen Dank.

Antworten auf die Frage(1)

Ihre Antwort auf die Frage