CSS - Rotate Out Up Right Effect
Description
It provides to move or cause to move in a circle round an axis or centre.
Syntax
@keyframes rotateOutUpRight {
0% {
transform-origin: right bottom;
transform: rotate(0);
opacity: 1;
}
100% {
transform-origin: right bottom;
transform: rotate(90deg);
opacity: 0;
}
}
Parameters
Transform − Transform applies to 2d and 3d transformation to an element.
Opacity − Opacity applies to an element to make translucence.
Example
<html>
<head>
<style>
.rourAnimated {
background-image: url(/html/images/test.png);
background-repeat: no-repeat;
background-position: left top;
padding-top: 95px;
margin-bottom: 60px;
margin-top: 150px;
-webkit-animation-duration: 3s;
animation-duration: 3s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
@-webkit-keyframes rotateOutUpRight {
0% {
-webkit-transform-origin: right bottom;
-webkit-transform: rotate(0);
opacity: 1;
}
100% {
-webkit-transform-origin: right bottom;
-webkit-transform: rotate(20deg);
opacity: 0;
}
}
@keyframes rotateOutUpRight {
0% {
transform-origin: right bottom;
transform: rotate(0);
opacity: 1;
}
100% {
transform-origin: right bottom;
transform: rotate(20deg);
opacity: 0;
}
}
.rotateOutUpRight {
-webkit-animation-name: rotateOutUpRight;
animation-name: rotateOutUpRight;
}
</style>
</head>
<body>
<div id="rourAnimates" class="rourAnimated"></div>
<button onclick="rourFun()">Click</button>
<script>
function rourFun() {
document.getElementById("rourAnimates").classList.add('rotateOutUpRight');
}
</script>
</body>
</html>
Output
It will produce the following result:
css_animation.htm
Advertisements