Oscillation Animation using HTML and CSS.

 OSCILLATION ANIMATION



                                                                   In this tutorial we have created web

 program that will show you OSCILLATION animation. You will find that Newton's

 rule i.e. " FOR EVERY ACTION THERE IS EQUAL AND OPPOSITE REACTION " is

 following by our  code. We have use  ANIMATION property of CSS and we have

 created this Program.




PROGRAM SOURCE CODE :-




<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width , initial-scale=1.0">
    <title>Design  a Simple Website Project</title>

<!-------------------------- CSS start------------------------------->

<style type="text/css">

    *{
        margin0;
        padding0;
        box-sizingborder-box;
    }

    html{
        font-size62.5%;
    }

    body{
        background-color#000099;
        overflow-x:hidden;
    }

    .main-div{
        width100vw;
        height100vh;
        displaygrid;
        place-items:center;
    }

    .center-div{
        width80%;
        height60%;
        background-color#000;
        border1rem solid gold;
        positionrelative;
    }

    ul{
        positionabsolute;
        top:0%;
        left50%;
        transformtranslateX(-50%);
        displayinline-flex;
    }

    li{
        list-style-typenone;
        width.6rem;
        height20rem;
        background-color#fff;
        transform-origintop;
    }

li::before{
        content" ";
        width4rem;
        height4rem;
        background-color#fff;
        border-radius50%;
        positionabsolute;
        top105%;
        transformtranslate(-40%,-50%);
    }


    li:first-child{
        margin0rem 3rem;
        animation: aone 2s linear infinite;
    }

    @keyframes aone{
        0%{
            transformrotate(0deg);
        }
        20%{
            transformrotate(60deg);
        }
        50%{
            transformrotate(0deg);
        }
        100%{
            transformrotate(0deg);
        }
    }

    li:last-child{
        animation: atwo 2s linear infinite;
        animation-delay1s;
    }

    @keyframes atwo{
        0%{
            transformrotate(0deg);
        }
        20%{
            transformrotate(-60deg);
        }
        50%{
            transformrotate(0deg);
        }
        100%{
            transformrotate(0deg);
        }
    }

    @media(max-width800px){
        html{
            font-size50%;
        }
    }

</style>

<!-------------------------- CSS End ------------------------------->

</head>
<body>
    <div class="main-div">
        <div class="center-div">
            <ul>
                <li></li>
                <li></li>
            </ul>
        </div>
    </div>
</body>
</html>




OUTPUT :-









( NOTE : - While executing program you have to replace links of images , audio's  or video's in this program by your links. So take care of it ! )