I use -webkit-animation properties to rotate form elements to their places when user first view a page.
I use the following code to achieve that:
.bounce {
-webkit-animation-name: bounceup;
}
@-webkit-keyframes bounceup {
from {
opacity:0.5;
-webkit-transform: translateY(100px) rotate(180deg);
-webkit-box-shadow: 20px 20px 80px #000;
}
to {
opacity:1;
-webkit-transform: translateY(0px) rotate(0deg);
}
}
the server side code is PHP. in each form element in my php class I had the class 'bounce' and I add an inline property named -webkit-animation-duration which I increment by 0.18 between each for element.
php code:
private $animationDuration=0.7;
private function _getAnimationDuration() {
$ret= '-webkit-animation-duration: '.$this->animationDuration.'s';
$this->animationDuration+=0.1;
return $ret;
}
Here I add a property named 'style' to each form element with the result of the _getAnimationDuration() function.
The question is: can I somehow implement the _getAnimationDuration() function using pure CSS3 and HTML5 (without JavaScript)?
I want to add a animation duration css style that is different between each form element. each one increased by the same amount.