Is there any way to test a CSS animation by Devtools?

Asked

Viewed 76 times

5

I have this simple animation done in CSS, but I’m having difficulties to "debug" your behavior. Every time I have to go in the code, save, and update in the browser.

Is there any way to test a direct animation by Devtools?

Type has to stop the animation in a certain second and evaluate how it is, or see how the element will be in a certain second?

.box {
	position: absolute;
	left: 50%;
	width: 400px;
	height: 200px;
	margin-left: -200px;
	overflow: hidden;
	background: #333;
}

.bola {
	position: absolute;
	width: 50px;
	height: 50px;
	top: 75px;
	left: 175px;
	background: #999;
	border-radius: 50%;
	-webkit-animation: bolax 2s ease-in-out infinite;
	animation: bolax 2s ease-in-out infinite;
}
.bola:nth-child(2) {
	animation-delay: 0.5s;
}

@-webkit-keyframes bolax {
	0%, 100% {
		-webkit-transform: translateX(-150px);
	}
	50% {
		-webkit-transform: translateX(150px);
	}
}
@keyframes bolax {
	0%, 100% {
		transform: translateX(-150px);
	}
	50% {
		transform: translateX(150px);
	}
}
	
<div class="box">
	<div class="bola"></div>
	<div class="bola"></div>
</div>

1 answer

5


Firefox has the Animation inspector, in it you can "debug" animations as well as advance/regress the state of it to view what would be your behavior on the screen. Just open the developer tools (F12) and search the "Animations tab".

Animation Inspector

  • It seems that’s the way it is. You know if the FF Devtools can edit the timing function to change the type of ease too? Or just this one Timeline as a resource?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.