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 Creating an SVG Animation Sequence

Leonardo Motta
Leonardo Motta
11,284 Points

This svg animation with css course here on TreeHouse needs a remake, I am sorry but the quality is not good.

A think the instructor could have told us the problems with different browsers and at least give some tip on how to handle it.

This code works on chrome/IE but not on firefox:

/* --------------------------
  Base
--------------------------- */

body {
  background: #8069a1;
  padding-top: 60px;
}

svg {
  margin: auto;
  display: block;
}

/* --------------------------
  Keyframes
--------------------------- */

@keyframes grow {
  0% {
    transform: scale(0);
  }
  30% {
    transform: scale(1.1);
  }
  60% {
    transform: scale(0.9);
  }
}

/* --------------------------
  SVG Styles
--------------------------- */

.outer,
.inner,
.inline,
.badge {
  animation: grow 1s ease-out backwards;
  transform-origin: 180px 180px;
}

.inner {
  animation-delay: 0.1s;
}

.inline {
  animation-delay: 0.15s;
}

This code now works on firefox and edge:

/* --------------------------
  Base
--------------------------- */

body {
  background: #8069a1;
  padding-top: 60px;
}

svg {
  margin: auto;
  display: block;
}

/* --------------------------
  Keyframes
--------------------------- */

@keyframes grow {
  0% {
    transform: scale(0);
  }
  30% {
    transform: scale(1.1);
  }
  60% {
    transform: scale(0.9);
  }
}

/* --------------------------
  SVG Styles
--------------------------- */
.badge * {
  transform-origin: 180px 180px;
}

.outer,
.inner,
.inline, {
  animation: grow 1s ease-out backwards;
}

.inner {
  animation-delay: 0.1s;
}

.inline {
  animation-delay: 0.15s;
}

I would like to know how to handle it? And I already found it is not just a problem with vendors prefixes.

1 Answer

Steven Parker
Steven Parker
231,248 Points

You can also report course problems directly to the Support staff.