In CSS to apply multiple transformations to the same element in one rule it must be written like this:
.selector{ transform:translateY( *value* ) scale( *value*) rotateZ(*value*)
etc. But how do I add multiple transformations in multiple animations? Example:
@import 'https://necolas.github.io/normalize.css/latest/normalize.css';
/* //////////////////////////////// INITIAL //////////////////////////////// */
html, body{ height:100% } body{ background:#eee }
#btnCont{
display:block; width:100px; height:100px; margin:0 auto; position:relative;
transform:translateY(-50%); top:50%; perspective:1000px
}
#btn {
width:100%; height:100%; background:#333; color:#eee; border:0; outline:0;
text-transform:uppercase; transform:rotateX(93deg) translateX(0);
transform-origin:bottom
}
/* //////////////////////////////// __ANIM_ //////////////////////////////// */
.rotUp{
animation-name:rotateUp; animation-duration:1s; animation-fill-mode:forwards
}
.movUp{
animation-name:moveUp; animation-duration:1.5s; animation-fill-mode:forwards
}
@keyframes rotateUp{
0%{ transform:rotateX(93deg) }
100%{ transform:rotateX(0deg) }
}
@keyframes moveUp{
0%{ transform:translateX(0) }
100%{ transform:translateX(95px) }
}
<div id="btnCont"> <button id="btn" class="rotUp movUp">button</button> </div>
I want to perform rotateUp
and moveUp
simultaneously. As it is now, rotateUp
gets completely ignored.