Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS Animating SVG with CSS Keyframe and Line Drawing Animations The Animation Challenge Solution

Something wrong with the second keyframe

First and second step:

/* --------------------------
  Keyframes
-------------------------- */
@keyframes star{

  50%{
    transform:translate3d(0,-10px,0);
  }
  80%{
    transform:translate3d(0,10px,0);
  }
    100%{
    transform:translate3d(0,-10px,0);
  }
}

@keyframes grow{
  30%{
  transform:scale(1);
  }
  50%{
    transform:scale(1.5)  rotate(-5deg);
    fill:yellow;
    }
  80%{
    transform: scale(1);
  }
}


/* --------------------------
  SVG Styles
--------------------------- */
.star{
  transform:translate3d(0,180px,0);
  animation: star .5s forwards, grow .6s ease-out forwards;
}

.star:nth-of-type(1){
  animation-delay:.5s,1.8s;
}

.star:nth-of-type(2){
  animation-delay:0s,1.5s;
}
  .star:nth-of-type(3){
  animation-delay:.9s,2s;
}

1 Answer

Hello Azzie

You are scaling 1.5 and Guil is scailing 1.15, that is why yours is shooting off and back.

Try changing the value and your results shall be the same as in the video.

@keyframes grow{
  30%{
  transform:scale(1);
  }
  50%{
    transform: scale(1.15)  rotate(-5deg);
    fill:yellow;
    }
  80%{
    transform: scale(1);
  }
}

Enjoy!