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 trialAlbert Yih
2,195 PointsTranslate3d not working with the scale up
Hi,
My translate3d animation isn't showing but the scale up and fill is. Any advice? Thanks
/* --------------------------
Base
--------------------------- */
body {
padding-top: 60px;
background: #0f4e7a;
}
svg {
margin: auto;
display: block;
width: 28%;
}
/* --------------------------
Keyframes
--------------------------- */
@keyframes slide {
50% {
transform: translate3d(0,110px,0);
}
80% {
transform: translate3d(0,20px,0);
}
100% {
transform: translate3d(0,0,0);
}
}
@keyframes grow {
0% {
transform: scale(1);
}
50% {
transform: scale(1.15) rotate(-5deg);
opacity: 1;
fill: #fdf097;
}
100% {
transform: scale(1);
}
}
@keyframes offset {
25%{
transform: rotate(0deg);
}
50%{
stroke-opacity: 1;
}
100% {
stroke-dashoffset: 0;
transform: rotate(180deg);
stroke-opacity: 0;
}
}
/* --------------------------
SVG Styles
--------------------------- */
.stars * {
transform-origin: 50% 50%;
}
.stars-bg {
stroke-opacity: 0;
stroke-dasharray: 815px;
stroke-dashoffset: 815px;
animation: offset .8s 1.0s ease-in-out forwards;
}
.star {
transform: translate3d(0, 180px, 0);
animation: slide .5s forwards,
grow .6s ease-out forwards;
}
.star:nth-of-type(1) {
animation-delay: .5s, 0.1s;
}
.star:nth-of-type(2) {
animation-delay: 0.2s;
}
.star:nth-of-type(3) {
animation-delay: .8s, 0.3s;
}
Iain Simmons
Treehouse Moderator 32,305 PointsWhat browser are you using?
Caesar Bell
24,827 PointsChrome Version 48.0.2564.103
2 Answers
Jun Zhang
10,785 Points.star:nth-of-type(2) { animation-delay: 0.2s; }
is missing the second time duration (for "pulsing" effect)
Caesar Bell
24,827 PointsI was having a similar error. You can use the translate3d(x, y, z) but it seems to be a glitch when you assign two @keyframe to an animation method. Remove the "grow .6s ease-out forwards" and then try and run it. The scale up effect should then run. Just make sure you put your semi-colon after your animation state. That line should look like this animation: slide .5s forwards;
I am not sure how Guil Hernandez got it to work with assigning two keyframes to the animation.
Gina Scalpone
21,330 PointsGina Scalpone
21,330 PointsWhy are you using translated3d? You don't do anything with the z-axis on any of those transforms, so you'd be better off just using translate. It also more broadly supported.