Saturday, 5 December 2020

                                CSS Animation


<!DOCTYPE html>
<html lang="en">

</html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CSS Animation</title>
</head>
<style>
    div {
        width100px;
        height100px;
        background-colorblueviolet;
        margin-bottom10px;
        positionrelative;
        /* animation-name: example1;
        animation-duration: 5s;
        animation-timing-function: linear;
        animation-delay: 2s;
        animation-iteration-count: 3;
        animation-direction: alternate;
        animation-fill-mode: forwards; */
        /* Same as above */
        /* animation: name duration timing-function delay iteration-count direction fill-mode; */
        animation: example1 5s linear 2s 3 alternate forwards;
        animation-play-staterunning;
    }

    #div1 {
        animation-timing-functionlinear;
    }

    #div2 {
        animation-timing-functionease;
    }

    #div3 {
        animation-timing-functionease-in;
    }

    #div4 {
        animation-timing-functionease-out;
    }

    #div5 {
        animation-timing-functionease-in-out;
    }

    /* @keyframes example1{ 
        from {background-color: blueviolet; left: 0px; top: 0px;}
        to {background-color: chartreuse; left: 200px; top: 0px;}
    } 
    Same as Above but can use more than two animations */
    @keyframes example1 {
        0% {
            background-coloryellow;
            left0px;
            /*left: 0px; top: 0px;*/
        }

        25% {
            background-colorchartreuse;
            left100px;
            /*left: 200px; top: 0px;*/
        }

        50% {
            background-colorblue;
            left250px;
            /* left: 200px; top: 200p;*/
        }

        75% {
            background-colorspringgreen;
            left350px;
            /* left: 0px; top: 200px;*/
        }

        100% {
            background-colorcrimson;
            left400px;
            /* left: 0px; top: 0px;*/
        }

    }
</style>

<body>
    <div id="div1">CSS Animation Box</div>
    <div id="div2">CSS Animation Box</div>
    <div id="div3">CSS Animation Box</div>
    <div id="div4">CSS Animation Box</div>
    <div id="div5">CSS Animation Box</div>
</body>

</html>

No comments:

Post a Comment

Get Phone Number Details Using Python

 Get Phone Number Details Using Python Import Python module PHONENUMBERS using command " pip install phonenumbers" in you CLI Then...