bounce animation using css

technical talkiess
0

 Bounce Animation:- 

<!DOCTYPE html>

<html lang="en">


<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Document</title>

    <style>

        .box {

            height: 121px;

            width: 121px;

            background-color: red;

            border-radius: 70px;

            position: absolute;

            bottom: 0;

            left: 0;

            /* animation: bounceX,bounceY;

            animation-duration: 3s;

            animation-timing-function: linear;

            animation-delay: 1s;

            animation-fill-mode: backwards;

            animation-iteration-count: infinite; */

            /* animation: bounceX 2s linear infinite,; */

            animation: bounceX 2s linear infinite,bounceY 2s ease-out infinite;

        }


        .container {

            position: relative;

            height: 80vh;

            width: 80vw;

            background-color: blue;

        }


        @keyframes bounceX {

            0%{

                left: 0%;

            }

       

            50%{

                left: 50%;

            }

       

            100%{

                left: 100%;

            }

            /* from{

                left: 0;


            }

            to{

                left: 100%;

            } */

            /* 0% {

                left: 0;

            }


            25% {

                left: 25%;

            }


            50% {

                left: 50%;

            }


            100% {

                left: 100%;

            } */


        }


        @keyframes bounceY {

       

            0%{

                bottom: 0%;

            }

           

            25%{

                bottom: 50%;

            }

            50%{

                bottom: 5%;

            }

       

            100%{

                bottom: 100%;

            }

            /* from{

                bottom: 0;


            }

            to{

                bottom: 100%;

            } */

            /* 0% {

                bottom: 0;

            }


            25% {

                bottom: 25%;

            }


            50% {

                bottom: 50%;

            }


            100% {

                bottom: 100%;

            } */

       

        }

        </style>

</head>


<body>

    <div class="container">


        <div class="box">

        </div>

    </div>

    <!--

   

     -->

</body>


</html>
Tags

Post a Comment

0Comments

Thanks you for commenting your questions. I will see question and respond you.

Post a Comment (0)