CSS - Rotate Out Down Right Effect



Description

It provides to move or cause to move in a circle round an axis or centre.

Syntax

@keyframes rotateOutDownRight {
   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>
        .rodrAnimated {
            background-image: url(/https/www.tutorialspoint.com/html/images/test.png);
            background-repeat: no-repeat;
            background-position: left top;
            padding-top: 95px;
            margin-bottom: 160px;
            -webkit-animation-duration: 3s;
            animation-duration: 3s;
            -webkit-animation-fill-mode: both;
            animation-fill-mode: both;
        }


        @-webkit-keyframes rotateOutDownRight {
            0% {
                -webkit-transform-origin: right bottom;
                -webkit-transform: rotate(0);
                opacity: 1;
            }

            100% {
                -webkit-transform-origin: right bottom;
                -webkit-transform: rotate(-25deg);
                opacity: 0;
            }
        }

        @keyframes rotateOutDownRight {
            0% {
                transform-origin: right bottom;
                transform: rotate(0);
                opacity: 1;
            }

            100% {
                transform-origin: right bottom;
                transform: rotate(-25deg);
                opacity: 0;
            }
        }

        .rotateOutDownRight {
            -webkit-animation-name: rotateOutDownRight;
            animation-name: rotateOutDownRight;
        }
    </style>
</head>

<body>
    <div id="rodrAnimates" class="rodrAnimated"></div>
    <button onclick="rodrFun()">Click</button>

    <script>
        function rodrFun() {
            document.getElementById("rodrAnimates").classList.add('rotateOutDownRight');
        }
    </script>
</body>

</html>

Output

It will produce the following result:

Rotate Out Down Right Effect
css_animation.htm
Advertisements