CSS - Rotate in Down Left Effect



Description

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

Syntax

@keyframes rotateInDownLeft {
   0% {
      transform-origin: left bottom;
      transform: rotate(-90deg);
      opacity: 0;
   }
   100% {
      transform-origin: left bottom;
      transform: rotate(0);
      opacity: 1;
   }
} 

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>
        .ridlAnimated {
            background-image: url(/html/images/test.png);
            background-repeat: no-repeat;
            background-position: left top;
            padding-top: 120px;
            margin-bottom: 60px;
            margin-top: 80px;
            -webkit-animation-duration: 2s;
            animation-duration: 2s;
            -webkit-animation-fill-mode: both;
            animation-fill-mode: both;
        }



        @-webkit-keyframes rotateInDownLeft {
            0% {
                -webkit-transform-origin: left top;
                -webkit-transform: rotate(-90deg);
                opacity: 0;
            }

            100% {
                -webkit-transform-origin: left top;
                -webkit-transform: rotate(0);
                opacity: 1;
            }
        }

        @keyframes rotateInDownLeft {
            0% {
                transform-origin: left top;
                transform: rotate(-90deg);
                opacity: 0;
            }

            100% {
                transform-origin: left top;
                transform: rotate(0);
                opacity: 1;
            }
        }

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

<body>
    <div id="ridlAnimates" class="ridlAnimated"></div>
    <button onclick="ridlFun()">Click</button>
    <script>
        function ridlFun() {
            document.getElementById("ridlAnimates").classList.add('rotateInDownLeft');
        }
    </script>

</body>

</html>

Output

It will produce the following result:

Rotate in down left effect
css_animation.htm