Skip to content
Advertisements

CSS Animation Drop

HTML CODE:

<!DOCTYPE html>
<html>
<head>
    <title>page</title>
     <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <link rel="stylesheet" type="text/css" href="1.page.css">
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css">
</head>
<body>
    
    <div class="center">
        <div class="down"></div>
    </div>

</body>
</html>

CSS CODE:

body{
    margin: 0;
    padding: 0;
    background-color: #262626;
}
.center{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
}
.down{
    position: relative;
    width: 200px;
    height: 320px;
    border-radius: 100px;
    background-color: transparent;
    border:4px solid #fff;
    overflow:hidden;
}
.down:before{
    content: "";
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #fff;
    left: 50%;
    top: 40px;
    transform: translate(-50%,0);
    animation: ani 1s linear infinite;
}
.down:after{
    content: "";
    position: absolute;
    width: 24px;
    height:60px;
    border-radius: 50%;
    background-color: #fff;
    left: 50%;
    top: 20px;
    transform: translate(-50%,0);
    border-radius:12px; 
}
@keyframes ani{
    0%{
        transform: translate(-50%,80px);
        opacity: 0;
    }
    80%{
        transform: translate(-50%,240px);
        opacity: 1;
    }
    100%{
        transform: translate(-50%,400px);
    }
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: